ClusterInstance class
A Cluster Instance Resource defines attributes that are specific to a single instance in a Neptune Cluster.
You can simply add neptune instances and Neptune manages the replication. You can use the count
meta-parameter to make multiple instances and join them all to the same Neptune Cluster, or you may specify different Cluster Instance resources with various instanceClass sizes.
Example Usage
The following example will create a neptune cluster with two neptune instances(one writer and one reader).
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const _default = new aws.neptune.Cluster("default", {
clusterIdentifier: "neptune-cluster-demo",
engine: "neptune",
backupRetentionPeriod: 5,
preferredBackupWindow: "07:00-09:00",
skipFinalSnapshot: true,
iamDatabaseAuthenticationEnabled: true,
applyImmediately: true,
});
const example: aws.neptune.ClusterInstance[] = [];
for (let range = 0; range < 2; range++) {
example.push(new aws.neptune.ClusterInstance(`example-${range}`, {
clusterIdentifier: _default.id,
engine: "neptune",
instanceClass: "db.r4.large",
applyImmediately: true,
}));
}
import pulumi
from typing import Any
import pulumi_aws as aws
default = aws.neptune.Cluster("default",
cluster_identifier="neptune-cluster-demo",
engine="neptune",
backup_retention_period=5,
preferred_backup_window="07:00-09:00",
skip_final_snapshot=True,
iam_database_authentication_enabled=True,
apply_immediately=True)
example: list[aws.neptune.ClusterInstance] = []
for example_range in [{"value": i} for i in range(0, 2)]:
example.append(aws.neptune.ClusterInstance(f"example-{example_range['value']}",
cluster_identifier=default.id,
engine="neptune",
instance_class="db.r4.large",
apply_immediately=True))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var @default = new Aws.Neptune.Cluster("default", new()
{
ClusterIdentifier = "neptune-cluster-demo",
Engine = "neptune",
BackupRetentionPeriod = 5,
PreferredBackupWindow = "07:00-09:00",
SkipFinalSnapshot = true,
IamDatabaseAuthenticationEnabled = true,
ApplyImmediately = true,
});
var example = new List<Aws.Neptune.ClusterInstance>();
for (var rangeIndex = 0; rangeIndex < 2; rangeIndex++)
{
var range = new { Value = rangeIndex };
example.Add(new Aws.Neptune.ClusterInstance($"example-{range.Value}", new()
{
ClusterIdentifier = @default.Id,
Engine = "neptune",
InstanceClass = "db.r4.large",
ApplyImmediately = true,
}));
}
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/neptune"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := neptune.NewCluster(ctx, "default", &neptune.ClusterArgs{
ClusterIdentifier: pulumi.String("neptune-cluster-demo"),
Engine: pulumi.String("neptune"),
BackupRetentionPeriod: pulumi.Int(5),
PreferredBackupWindow: pulumi.String("07:00-09:00"),
SkipFinalSnapshot: pulumi.Bool(true),
IamDatabaseAuthenticationEnabled: pulumi.Bool(true),
ApplyImmediately: pulumi.Bool(true),
})
if err != nil {
return err
}
var example []*neptune.ClusterInstance
for index := 0; index < 2; index++ {
key0 := index
__res, err := neptune.NewClusterInstance(ctx, fmt.Sprintf("example-%v", key0), &neptune.ClusterInstanceArgs{
ClusterIdentifier: _default.ID().ToIDOutput().ToStringOutput(),
Engine: pulumi.String("neptune"),
InstanceClass: pulumi.String("db.r4.large"),
ApplyImmediately: pulumi.Bool(true),
})
if err != nil {
return err
}
example = append(example, __res)
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_neptune_cluster" "default" {
cluster_identifier = "neptune-cluster-demo"
engine = "neptune"
backup_retention_period = 5
preferred_backup_window = "07:00-09:00"
skip_final_snapshot = true
iam_database_authentication_enabled = true
apply_immediately = true
}
resource "aws_neptune_clusterinstance" "example" {
count = 2
cluster_identifier = aws_neptune_cluster.default.id
engine = "neptune"
instance_class = "db.r4.large"
apply_immediately = true
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.neptune.Cluster;
import com.pulumi.aws.neptune.ClusterArgs;
import com.pulumi.aws.neptune.ClusterInstance;
import com.pulumi.aws.neptune.ClusterInstanceArgs;
import com.pulumi.codegen.internal.KeyedValue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var default_ = new Cluster("default", ClusterArgs.builder()
.clusterIdentifier("neptune-cluster-demo")
.engine("neptune")
.backupRetentionPeriod(5)
.preferredBackupWindow("07:00-09:00")
.skipFinalSnapshot(true)
.iamDatabaseAuthenticationEnabled(true)
.applyImmediately(true)
.build());
for (var i = 0; i < 2; i++) {
new ClusterInstance("example-" + i, ClusterInstanceArgs.builder()
.clusterIdentifier(default_.id())
.engine("neptune")
.instanceClass("db.r4.large")
.applyImmediately(true)
.build());
}
}
}
resources:
default:
type: aws:neptune:Cluster
properties:
clusterIdentifier: neptune-cluster-demo
engine: neptune
backupRetentionPeriod: 5
preferredBackupWindow: 07:00-09:00
skipFinalSnapshot: true
iamDatabaseAuthenticationEnabled: true
applyImmediately: true
example:
type: aws:neptune:ClusterInstance
properties:
clusterIdentifier: ${default.id}
engine: neptune
instanceClass: db.r4.large
applyImmediately: true
options: {}
Import
Using pulumi import, import aws.neptune.ClusterInstance using the instance identifier. For example:
$ pulumi import aws:neptune/clusterInstance:ClusterInstance example my-instance
Constructors
- ClusterInstance(String name, {ClusterInstanceArgs? args, CustomResourceOptions? options})
-
Creates a new ClusterInstance.
nameThe Pulumi resource name.argsArguments used to configure this ClusterInstance. The set of arguments for ClusterInstance.optionsResource options controlling this resource's behavior. - ClusterInstance.reference(String urn)
- Creates a typed reference to an existing ClusterInstance resource.
Properties
-
address
↔ Output<
String> -
The hostname of the instance. See also
endpointandport.latefinal -
applyImmediately
↔ Output<
bool> -
Specifies whether any instance modifications
are applied immediately, or during the next maintenance window. Default is
false.latefinal -
arn
↔ Output<
String> -
ARN of neptune instance
latefinal
-
autoMinorVersionUpgrade
↔ Output<
bool?> -
Indicates that minor engine upgrades will be applied automatically to the instance during the maintenance window. Default is
true.latefinal -
availabilityZone
↔ Output<
String> -
The EC2 Availability Zone that the neptune instance is created in.
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
clusterIdentifier
↔ Output<
String> -
The identifier of the
aws.neptune.Clusterin which to launch this instance.latefinal -
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
dbiResourceId
↔ Output<
String> -
The region-unique, immutable identifier for the neptune instance.
latefinal
-
endpoint
↔ Output<
String> -
The connection endpoint in
address:portformat.latefinal -
engine
↔ Output<
String?> -
The name of the database engine to be used for the neptune instance. Defaults to
neptune. Valid Values:neptune.latefinal -
engineVersion
↔ Output<
String> -
The neptune engine version. Currently configuring this argumnet has no effect.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
-
identifier
↔ Output<
String> -
The identifier for the neptune instance, if omitted, this provider will assign a random, unique identifier.
latefinal
-
identifierPrefix
↔ Output<
String> -
Creates a unique identifier beginning with the specified prefix. Conflicts with
identifier.latefinal -
instanceClass
↔ Output<
String> -
The instance class to use.
latefinal
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
kmsKeyArn
↔ Output<
String> -
The ARN for the KMS encryption key if one is set to the neptune cluster.
latefinal
-
neptuneParameterGroupName
↔ Output<
String> -
The name of the neptune parameter group to associate with this instance.
latefinal
-
neptuneSubnetGroupName
↔ Output<
String> -
A subnet group to associate with this neptune instance. NOTE: This must match the
neptuneSubnetGroupNameof the attachedaws.neptune.Cluster.latefinal -
port
↔ Output<
int?> -
The port on which the DB accepts connections. Defaults to
8182.latefinal -
preferredBackupWindow
↔ Output<
String> -
The daily time range during which automated backups are created if automated backups are enabled. Eg: "04:00-09:00"
latefinal
-
preferredMaintenanceWindow
↔ Output<
String> -
The window to perform maintenance in.
Syntax: "ddd:hh24:mi-ddd:hh24:mi". Eg: "Mon:00:00-Mon:03:00".
latefinal
-
promotionTier
↔ Output<
int?> -
Default 0. Failover Priority setting on instance level. The reader who has lower tier has higher priority to get promoter to writer.
latefinal
-
publiclyAccessible
↔ Output<
bool?> -
Bool to control if instance is publicly accessible. Default is
false.latefinal -
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
skipFinalSnapshot
↔ Output<
bool?> -
Determines whether a final DB snapshot is created before the DB instance is deleted.
latefinal
-
storageEncrypted
↔ Output<
bool> -
Specifies whether the neptune cluster is encrypted.
latefinal
-
storageType
↔ Output<
String> -
Storage type associated with the cluster
standard/iopt1.latefinal -
A map of tags to assign to the instance. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.latefinal -
A map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block.latefinal -
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
-
writer
↔ Output<
bool> -
Boolean indicating if this instance is writable.
Falseindicates this instance is a read replica.latefinal
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {ClusterInstanceState? state, CustomResourceOptions? options}) → ClusterInstance -
Gets an existing ClusterInstance resource's state with the given
nameandid.