AWS Amazon Neptune Event Subscription

This page shows how to write Terraform and CloudFormation for Amazon Neptune Event Subscription and write them securely.

aws_neptune_event_subscription (Terraform)

The Event Subscription in Amazon Neptune can be configured in Terraform with the resource name aws_neptune_event_subscription. The following sections describe 1 example of how to use the resource and its parameters.

Example Usage from GitHub

aws_neptune_event_subscription.tf#L1
resource "aws_neptune_event_subscription" "default" {
  name          = "neptune-event-subscription"
  enabled       = true
  sns_topic_arn = aws_sns_topic.default.arn
  tags          = local.tags
  source_type   = "db-instance"

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

Explanation in Terraform Registry

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

neptune-template.yml#L78
    Type: AWS::Neptune::DBInstance
    Properties:
      AllowMajorVersionUpgrade: true
      AutoMinorVersionUpgrade: true
      DBClusterIdentifier: !Ref Cluster
      DBInstanceClass: {{instanceType}}
serverless.yml#L63
  #     Type: AWS::Neptune::DBInstance
  #     Properties:
  #       DBClusterIdentifier: !Ref unitGraphCluster
  #       DBInstanceClass: db.t3.medium
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:
db.cfn.yml#L171
    Type: AWS::Neptune::DBInstance
    Properties:
      DBClusterIdentifier: !Ref NeptuneCluster
      DBInstanceClass: !Ref NeptuneInstanceClass
      DBSubnetGroupName: !Ref NeptuneSubnetGroup
      Tags:
with_encryption.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_false_string.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 Event Subscription?

AWS Amazon Neptune Event Subscription 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 Event Subscription?

For Terraform, the gmirsky/terraform-aws-neptune source code example is useful. See the Terraform Example section for further details.

For CloudFormation, the byu-oit/handel, jammymalina/converter-rust and rnzsgh/compute-example-cfn source code examples are useful. See the CloudFormation Example section for further details.