Skip to content

Resource: awsNeptuneEventSubscription

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsNeptuneClusterDefault = new aws.neptuneCluster.NeptuneCluster(
  this,
  "default",
  {
    applyImmediately: "true",
    backupRetentionPeriod: 5,
    clusterIdentifier: "neptune-cluster-demo",
    engine: "neptune",
    iamDatabaseAuthenticationEnabled: "true",
    preferredBackupWindow: "07:00-09:00",
    skipFinalSnapshot: true,
  }
);
const awsNeptuneClusterInstanceExample =
  new aws.neptuneClusterInstance.NeptuneClusterInstance(this, "example", {
    applyImmediately: "true",
    clusterIdentifier: awsNeptuneClusterDefault.id,
    engine: "neptune",
    instanceClass: "db.r4.large",
  });
const awsSnsTopicDefault = new aws.snsTopic.SnsTopic(this, "default_2", {
  name: "neptune-events",
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsSnsTopicDefault.overrideLogicalId("default");
const awsNeptuneEventSubscriptionDefault =
  new aws.neptuneEventSubscription.NeptuneEventSubscription(this, "default_3", {
    eventCategories: [
      "maintenance",
      "availability",
      "creation",
      "backup",
      "restoration",
      "recovery",
      "deletion",
      "failover",
      "failure",
      "notification",
      "configuration change",
      "read replica",
    ],
    name: "neptune-event-sub",
    snsTopicArn: awsSnsTopicDefault.arn,
    sourceIds: [awsNeptuneClusterInstanceExample.id],
    sourceType: "db-instance",
    tags: {
      env: "test",
    },
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsNeptuneEventSubscriptionDefault.overrideLogicalId("default");

Argument Reference

The following arguments are supported:

  • enabled - (Optional) A boolean flag to enable/disable the subscription. Defaults to true.
  • eventCategories - (Optional) A list of event categories for a sourceType that you want to subscribe to. Run awsNeptuneDescribeEventCategories to find all the event categories.
  • name - (Optional) The name of the Neptune event subscription. By default generated by Terraform.
  • namePrefix - (Optional) The name of the Neptune event subscription. Conflicts with name.
  • snsTopicArn - (Required) The ARN of the SNS topic to send events to.
  • sourceIds - (Optional) A list of identifiers of the event sources for which events will be returned. If not specified, then all sources are included in the response. If specified, a sourceType must also be specified.
  • sourceType - (Optional) The type of source that will be generating the events. Valid options are dbInstance, dbSecurityGroup, dbParameterGroup, dbSnapshot, dbCluster or dbClusterSnapshot. If not set, all sources will be subscribed to.
  • tags - (Optional) A map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Attributes Reference

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

  • id - The name of the Neptune event notification subscription.
  • arn - The Amazon Resource Name of the Neptune event notification subscription.
  • customerAwsId - The AWS customer account associated with the Neptune event notification subscription.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Timeouts

Configuration options:

  • create - (Default 40M)
  • delete - (Default 40M)
  • update - (Default 40M)

Import

awsNeptuneEventSubscription can be imported by using the event subscription name, e.g.,

$ terraform import aws_neptune_event_subscription.example my-event-subscription