Resource: aws_vpc_endpoint_connection_notification

Provides a VPC Endpoint connection notification resource. Connection notifications notify subscribers of VPC Endpoint events.

Example Usage

data "aws_iam_policy_document" "topic" {
  statement {
    effect = "Allow"

    principals {
      type        = "Service"
      identifiers = ["vpce.amazonaws.com"]
    }

    actions   = ["SNS:Publish"]
    resources = ["arn:aws:sns:*:*:vpce-notification-topic"]
  }
}

resource "aws_sns_topic" "topic" {
  name   = "vpce-notification-topic"
  policy = data.aws_iam_policy_document.topic.json
}

resource "aws_vpc_endpoint_service" "foo" {
  acceptance_required        = false
  network_load_balancer_arns = [aws_lb.test.arn]
}

resource "aws_vpc_endpoint_connection_notification" "foo" {
  vpc_endpoint_service_id     = aws_vpc_endpoint_service.foo.id
  connection_notification_arn = aws_sns_topic.topic.arn
  connection_events           = ["Accept", "Reject"]
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import VPC Endpoint connection notifications using the VPC endpoint connection notification id. For example:

import {
  to = aws_vpc_endpoint_connection_notification.foo
  id = "vpce-nfn-09e6ed3b4efba2263"
}

Using terraform import, import VPC Endpoint connection notifications using the VPC endpoint connection notification id. For example:

% terraform import aws_vpc_endpoint_connection_notification.foo vpce-nfn-09e6ed3b4efba2263