AWS Amazon Neptune Cluster Endpoint

This page shows how to write Terraform and CloudFormation for Amazon Neptune Cluster Endpoint and write them securely.

aws_neptune_cluster_endpoint (Terraform)

The Cluster Endpoint in Amazon Neptune can be configured in Terraform with the resource name aws_neptune_cluster_endpoint. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

The following arguments are supported:

  • cluster_identifier - (Required, Forces new resources) The DB cluster identifier of the DB cluster associated with the endpoint.
  • cluster_identifier_endpoint - (Required, Forces new resources) The identifier of the endpoint.
  • endpoint_type - (Required) The type of the endpoint. One of: READER, WRITER, ANY.
  • excluded_members - (Optional) List of DB instance identifiers that aren't part of the custom endpoint group. All other eligible instances are reachable through the custom endpoint. Only relevant if the list of static members is empty.
  • static_members - (Optional) List of DB instance identifiers that are part of the custom endpoint group.
  • tags - (Optional) A map of tags to assign to the Neptune cluster. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

In addition to all arguments above, the following attributes are exported:

  • arn - The Neptune Cluster Endpoint Amazon Resource Name (ARN).
  • endpoint - The DNS address of the endpoint.
  • id - The Neptune Cluster Endpoint Identifier.
  • tags_all - A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Explanation in Terraform Registry

Provides an Neptune Cluster Endpoint Resource.

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

serverless.yml#L31
      Type: "AWS::Neptune::DBInstance"
      Properties:
        DBClusterIdentifier:
          Ref: "NeptuneDBCluster"
        DBInstanceClass: "db.r4.xlarge"
      DependsOn:
serverless.yml#L31
      Type: "AWS::Neptune::DBInstance"
      Properties:
        DBClusterIdentifier:
          Ref: "NeptuneDBCluster"
        DBInstanceClass: "db.r4.xlarge"
      DependsOn:
serverless.yml#L30
      Type: "AWS::Neptune::DBInstance"
      Properties:
        DBClusterIdentifier:
          Ref: "NeptuneDBCluster"
        DBInstanceClass: "db.r4.xlarge"
      DependsOn:
db.cfn.yml#L171
    Type: AWS::Neptune::DBInstance
    Properties:
      DBClusterIdentifier: !Ref NeptuneCluster
      DBInstanceClass: !Ref NeptuneInstanceClass
      DBSubnetGroupName: !Ref NeptuneSubnetGroup
      Tags:
db.cfn.yml#L171
    Type: AWS::Neptune::DBInstance
    Properties:
      DBClusterIdentifier: !Ref NeptuneCluster
      DBInstanceClass: !Ref NeptuneInstanceClass
      DBSubnetGroupName: !Ref NeptuneSubnetGroup
      Tags:
with_encryption_false_string.json#L17
      "Type" : "AWS::Neptune::DBInstance",
      "Properties" :
      {
        "DBClusterIdentifier" : "neptune-test-cluster",
        "DBInstanceClass" : "db.r4.large"
      },
with_encryption_false_boolean.json#L17
      "Type" : "AWS::Neptune::DBInstance",
      "Properties" :
      {
        "DBClusterIdentifier" : "neptune-test-cluster",
        "DBInstanceClass" : "db.r4.large"
      },
with_encryption.json#L17
      "Type" : "AWS::Neptune::DBInstance",
      "Properties" :
      {
        "DBClusterIdentifier" : "neptune-test-cluster",
        "DBInstanceClass" : "db.r4.large"
      },
with_no_encryption.json#L16
      "Type" : "AWS::Neptune::DBInstance",
      "Properties" :
      {
        "DBClusterIdentifier" : "neptune-test-cluster",
        "DBInstanceClass" : "db.r4.large"
      },
with_no_encryption.json#L16
      "Type" : "AWS::Neptune::DBInstance",
      "Properties" :
      {
        "DBClusterIdentifier" : "neptune-test-cluster",
        "DBInstanceClass" : "db.r4.large"
      },

Parameters

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 the DBClusterIdentifier property:+ For AWS::Neptune::DBInstance resources that don't specify the DBClusterIdentifier property, AWS CloudFormation saves a snapshot of the DB instance.

  • For AWS::Neptune::DBInstance resources that do specify the DBClusterIdentifier 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 Endpoint?

AWS Amazon Neptune Cluster Endpoint 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 Endpoint?

For CloudFormation, the ACloudGuru-Resources/Course_Go_Serverless_with_a_Graph_Database, YuriU/aws-neptune-examples and erankitcs/AWS_PhotoSimilarity source code examples are useful. See the CloudFormation Example section for further details.