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
-
address
optional computed - string -
apply_immediately
optional computed - bool -
arn
optional computed - string -
auto_minor_version_upgrade
optional - bool -
availability_zone
optional computed - string -
cluster_identifier
required - string -
dbi_resource_id
optional computed - string -
endpoint
optional computed - string -
engine
optional - string -
engine_version
optional computed - string -
id
optional computed - string -
identifier
optional computed - string -
identifier_prefix
optional computed - string -
instance_class
required - string -
kms_key_arn
optional computed - string -
neptune_parameter_group_name
optional - string -
neptune_subnet_group_name
optional computed - string -
port
optional - number -
preferred_backup_window
optional computed - string -
preferred_maintenance_window
optional computed - string -
promotion_tier
optional - number -
publicly_accessible
optional - bool -
storage_encrypted
optional computed - bool -
tags
optional - map from string to string -
writer
optional computed - bool -
timeouts
single 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_class
sizes.
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
-
DBParameterGroupName
optional - String -
DBInstanceClass
required - String -
AllowMajorVersionUpgrade
optional - Boolean -
DBClusterIdentifier
optional - String -
AvailabilityZone
optional - String -
PreferredMaintenanceWindow
optional - String -
AutoMinorVersionUpgrade
optional - Boolean -
DBSubnetGroupName
optional - String -
DBInstanceIdentifier
optional - String -
DBSnapshotIdentifier
optional - String -
Tags
optional - List of Tag
Explanation in CloudFormation Registry
The
AWS::Neptune::DBInstance
type 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 theDBClusterIdentifier
property:+ ForAWS::Neptune::DBInstance
resources that don't specify theDBClusterIdentifier
property, AWS CloudFormation saves a snapshot of the DB instance.
- For
AWS::Neptune::DBInstance
resources that do specify theDBClusterIdentifier
property, 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
DBSnapshotIdentifier
property 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.