AWS Amazon Neptune Cluster Instance
This page shows how to write Terraform and CloudFormation for Amazon Neptune Cluster Instance and write them securely.
aws_neptune_cluster_instance (Terraform)
The Cluster Instance in Amazon Neptune can be configured in Terraform with the resource name aws_neptune_cluster_instance. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_neptune_cluster_instance" "dbR4LargeCount2" {
count = 2
cluster_identifier = aws_neptune_cluster.default.id
engine = "neptune"
instance_class = "db.r4.large"
apply_immediately = true
resource "aws_neptune_cluster_instance" "dbR4LargeCount2" {
count = 2
cluster_identifier = aws_neptune_cluster.default.id
engine = "neptune"
instance_class = "db.r4.large"
apply_immediately = true
resource "aws_neptune_cluster_instance" "_" {
count = 1
identifier = "pslab-cluster-instance"
cluster_identifier = aws_neptune_cluster._.id
engine = "neptune"
instance_class = "db.t3.medium"
resource "aws_neptune_cluster_instance" "default" {
count = 1
cluster_identifier = aws_neptune_cluster.default.id
engine = "neptune"
instance_class = "db.t3.medium" # Smallest instance type listed for neptune https://aws.amazon.com/neptune/pricing/
apply_immediately = true
resource "aws_neptune_cluster_instance" "default" {
count = 1
cluster_identifier = aws_neptune_cluster.default.id
engine = "neptune"
instance_class = "db.t3.medium" # Smallest instance type listed for neptune https://aws.amazon.com/neptune/pricing/
apply_immediately = true
Parameters
-
addressoptional computed - string -
apply_immediatelyoptional computed - bool -
arnoptional computed - string -
auto_minor_version_upgradeoptional - bool -
availability_zoneoptional computed - string -
cluster_identifierrequired - string -
dbi_resource_idoptional computed - string -
endpointoptional computed - string -
engineoptional - string -
engine_versionoptional computed - string -
idoptional computed - string -
identifieroptional computed - string -
identifier_prefixoptional computed - string -
instance_classrequired - string -
kms_key_arnoptional computed - string -
neptune_parameter_group_nameoptional - string -
neptune_subnet_group_nameoptional computed - string -
portoptional - number -
preferred_backup_windowoptional computed - string -
preferred_maintenance_windowoptional computed - string -
promotion_tieroptional - number -
publicly_accessibleoptional - bool -
storage_encryptedoptional computed - bool -
tagsoptional - map from string to string -
writeroptional computed - bool -
timeoutssingle block
Explanation in Terraform Registry
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][1] 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
instance_classsizes.
AWS::Neptune::DBInstance (CloudFormation)
The DBInstance in Neptune can be configured in CloudFormation with the resource name AWS::Neptune::DBInstance. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
# Type: AWS::Neptune::DBInstance
# Properties:
# DBClusterIdentifier: !Ref unitGraphCluster
# DBInstanceClass: db.t3.medium
Type: AWS::Neptune::DBInstance
Properties:
DBInstanceClass: db.t3.medium
DBClusterIdentifier: !Ref PalomaDBCluster
Outputs:
Type: AWS::Neptune::DBInstance
Properties:
DBClusterIdentifier: !Ref NeptuneCluster
DBInstanceClass: !Ref NeptuneInstanceClass
DBSubnetGroupName: !Ref NeptuneSubnetGroup
Tags:
Type: AWS::Neptune::DBInstance
Properties:
DBClusterIdentifier: !Ref NeptuneCluster
DBInstanceClass: !Ref NeptuneInstanceClass
DBSubnetGroupName: !Ref NeptuneSubnetGroup
Tags:
Type: AWS::Neptune::DBInstance
Properties:
DBClusterIdentifier: !Ref NeptuneCluster
DBInstanceClass: !Ref NeptuneInstanceClass
DBSubnetGroupName: !Ref NeptuneSubnetGroup
Tags:
"Type" : "AWS::Neptune::DBInstance",
"Properties" :
{
"DBClusterIdentifier" : "neptune-test-cluster",
"DBInstanceClass" : "db.r4.large"
},
"Type" : "AWS::Neptune::DBInstance",
"Properties" :
{
"DBClusterIdentifier" : "neptune-test-cluster",
"DBInstanceClass" : "db.r4.large"
},
"Type" : "AWS::Neptune::DBInstance",
"Properties" :
{
"DBClusterIdentifier" : "neptune-test-cluster",
"DBInstanceClass" : "db.r4.large"
},
"Type" : "AWS::Neptune::DBInstance",
"Properties" :
{
"DBClusterIdentifier" : "neptune-test-cluster",
"DBInstanceClass" : "db.r4.large"
},
"Type" : "AWS::Neptune::DBInstance",
"Properties" :
{
"DBClusterIdentifier" : "neptune-test-cluster",
"DBInstanceClass" : "db.r4.large"
},
Parameters
-
DBParameterGroupNameoptional - String -
DBInstanceClassrequired - String -
AllowMajorVersionUpgradeoptional - Boolean -
DBClusterIdentifieroptional - String -
AvailabilityZoneoptional - String -
PreferredMaintenanceWindowoptional - String -
AutoMinorVersionUpgradeoptional - Boolean -
DBSubnetGroupNameoptional - String -
DBInstanceIdentifieroptional - String -
DBSnapshotIdentifieroptional - String -
Tagsoptional - List of Tag
Explanation in CloudFormation Registry
The
AWS::Neptune::DBInstancetype creates an Amazon Neptune DB instance. Updating DB Instances You can set a deletion policy for your DB instance to control how AWS CloudFormation handles the instance when the stack is deleted. For Neptune DB instances, you can choose to retain the instance, to delete the instance, or to create a snapshot of the instance. The default AWS CloudFormation behavior depends on theDBClusterIdentifierproperty:+ ForAWS::Neptune::DBInstanceresources that don't specify theDBClusterIdentifierproperty, AWS CloudFormation saves a snapshot of the DB instance.
- For
AWS::Neptune::DBInstanceresources that do specify theDBClusterIdentifierproperty, AWS CloudFormation deletes the DB instance. Deleting DB Instances Important If a DB instance is deleted or replaced during an update, AWS CloudFormation deletes all automated snapshots. However, it retains manual DB snapshots. During an update that requires replacement, you can apply a stack policy to prevent DB instances from being replaced.When properties labeled Update requires: Replacement are updated, AWS CloudFormation first creates a replacement DB instance, changes references from other dependent resources to point to the replacement DB instance, and finally deletes the old DB instance.
Important We highly recommend that you take a snapshot of the database before updating the stack. If you don't, you lose the data when AWS CloudFormation replaces your DB instance. To preserve your data, perform the following procedure: Deactivate any applications that are using the DB instance so that there's no activity on the DB instance.
Create a snapshot of the DB instance.
If you want to restore your instance using a DB snapshot, modify the updated template with your DB instance changes and add the
DBSnapshotIdentifierproperty with the ID of the DB snapshot that you want to use.Update the stack.
Frequently asked questions
What is AWS Amazon Neptune Cluster Instance?
AWS Amazon Neptune Cluster Instance is a resource for Amazon Neptune of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Amazon Neptune Cluster Instance?
For Terraform, the gilyas/infracost, infracost/infracost and ps-interactive/labs-shared-terraform source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the jammymalina/converter-rust, Pappa/Paloma and rnzsgh/compute-example-python-cfn source code examples are useful. See the CloudFormation Example section for further details.