Resource: awsVpcEndpointConnectionNotification
Provides a VPC Endpoint connection notification resource. Connection notifications notify subscribers of VPC Endpoint events.
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 awsVpcEndpointServiceFoo = new aws.vpcEndpointService.VpcEndpointService(
this,
"foo",
{
acceptanceRequired: false,
networkLoadBalancerArns: ["${aws_lb.test.arn}"],
}
);
const dataAwsIamPolicyDocumentTopic =
new aws.dataAwsIamPolicyDocument.DataAwsIamPolicyDocument(this, "topic", {
statement: [
{
actions: ["SNS:Publish"],
effect: "Allow",
principals: [
{
identifiers: ["vpce.amazonaws.com"],
type: "Service",
},
],
resources: ["arn:aws:sns:*:*:vpce-notification-topic"],
},
],
});
const awsSnsTopicTopic = new aws.snsTopic.SnsTopic(this, "topic_2", {
name: "vpce-notification-topic",
policy: dataAwsIamPolicyDocumentTopic.json,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsSnsTopicTopic.overrideLogicalId("topic");
const awsVpcEndpointConnectionNotificationFoo =
new aws.vpcEndpointConnectionNotification.VpcEndpointConnectionNotification(
this,
"foo_3",
{
connectionEvents: ["Accept", "Reject"],
connectionNotificationArn: awsSnsTopicTopic.arn,
vpcEndpointServiceId: awsVpcEndpointServiceFoo.id,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsVpcEndpointConnectionNotificationFoo.overrideLogicalId("foo");
Argument Reference
The following arguments are supported:
vpcEndpointServiceId
- (Optional) The ID of the VPC Endpoint Service to receive notifications for.vpcEndpointId
- (Optional) The ID of the VPC Endpoint to receive notifications for.connectionNotificationArn
- (Required) The ARN of the SNS topic for the notifications.connectionEvents
- (Required) One or more endpoint events for which to receive notifications.
\~> NOTE: One of vpcEndpointServiceId
or vpcEndpointId
must be specified.
Attributes Reference
In addition to all arguments above, the following attributes are exported:
id
- The ID of the VPC connection notification.state
- The state of the notification.notificationType
- The type of notification.
Import
VPC Endpoint connection notifications can be imported using the vpcEndpointConnectionNotificationId
, e.g.,