1. Packages
  2. AWS
  3. API Docs
  4. ec2
  5. VpcEndpointConnectionNotification
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.ec2.VpcEndpointConnectionNotification

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const topic = aws.iam.getPolicyDocument({
        statements: [{
            effect: "Allow",
            principals: [{
                type: "Service",
                identifiers: ["vpce.amazonaws.com"],
            }],
            actions: ["SNS:Publish"],
            resources: ["arn:aws:sns:*:*:vpce-notification-topic"],
        }],
    });
    const topicTopic = new aws.sns.Topic("topic", {
        name: "vpce-notification-topic",
        policy: topic.then(topic => topic.json),
    });
    const foo = new aws.ec2.VpcEndpointService("foo", {
        acceptanceRequired: false,
        networkLoadBalancerArns: [test.arn],
    });
    const fooVpcEndpointConnectionNotification = new aws.ec2.VpcEndpointConnectionNotification("foo", {
        vpcEndpointServiceId: foo.id,
        connectionNotificationArn: topicTopic.arn,
        connectionEvents: [
            "Accept",
            "Reject",
        ],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    topic = aws.iam.get_policy_document(statements=[{
        "effect": "Allow",
        "principals": [{
            "type": "Service",
            "identifiers": ["vpce.amazonaws.com"],
        }],
        "actions": ["SNS:Publish"],
        "resources": ["arn:aws:sns:*:*:vpce-notification-topic"],
    }])
    topic_topic = aws.sns.Topic("topic",
        name="vpce-notification-topic",
        policy=topic.json)
    foo = aws.ec2.VpcEndpointService("foo",
        acceptance_required=False,
        network_load_balancer_arns=[test["arn"]])
    foo_vpc_endpoint_connection_notification = aws.ec2.VpcEndpointConnectionNotification("foo",
        vpc_endpoint_service_id=foo.id,
        connection_notification_arn=topic_topic.arn,
        connection_events=[
            "Accept",
            "Reject",
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sns"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		topic, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
    			Statements: []iam.GetPolicyDocumentStatement{
    				{
    					Effect: pulumi.StringRef("Allow"),
    					Principals: []iam.GetPolicyDocumentStatementPrincipal{
    						{
    							Type: "Service",
    							Identifiers: []string{
    								"vpce.amazonaws.com",
    							},
    						},
    					},
    					Actions: []string{
    						"SNS:Publish",
    					},
    					Resources: []string{
    						"arn:aws:sns:*:*:vpce-notification-topic",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		topicTopic, err := sns.NewTopic(ctx, "topic", &sns.TopicArgs{
    			Name:   pulumi.String("vpce-notification-topic"),
    			Policy: pulumi.String(topic.Json),
    		})
    		if err != nil {
    			return err
    		}
    		foo, err := ec2.NewVpcEndpointService(ctx, "foo", &ec2.VpcEndpointServiceArgs{
    			AcceptanceRequired: pulumi.Bool(false),
    			NetworkLoadBalancerArns: pulumi.StringArray{
    				test.Arn,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ec2.NewVpcEndpointConnectionNotification(ctx, "foo", &ec2.VpcEndpointConnectionNotificationArgs{
    			VpcEndpointServiceId:      foo.ID(),
    			ConnectionNotificationArn: topicTopic.Arn,
    			ConnectionEvents: pulumi.StringArray{
    				pulumi.String("Accept"),
    				pulumi.String("Reject"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var topic = Aws.Iam.GetPolicyDocument.Invoke(new()
        {
            Statements = new[]
            {
                new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
                {
                    Effect = "Allow",
                    Principals = new[]
                    {
                        new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
                        {
                            Type = "Service",
                            Identifiers = new[]
                            {
                                "vpce.amazonaws.com",
                            },
                        },
                    },
                    Actions = new[]
                    {
                        "SNS:Publish",
                    },
                    Resources = new[]
                    {
                        "arn:aws:sns:*:*:vpce-notification-topic",
                    },
                },
            },
        });
    
        var topicTopic = new Aws.Sns.Topic("topic", new()
        {
            Name = "vpce-notification-topic",
            Policy = topic.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
        });
    
        var foo = new Aws.Ec2.VpcEndpointService("foo", new()
        {
            AcceptanceRequired = false,
            NetworkLoadBalancerArns = new[]
            {
                test.Arn,
            },
        });
    
        var fooVpcEndpointConnectionNotification = new Aws.Ec2.VpcEndpointConnectionNotification("foo", new()
        {
            VpcEndpointServiceId = foo.Id,
            ConnectionNotificationArn = topicTopic.Arn,
            ConnectionEvents = new[]
            {
                "Accept",
                "Reject",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.iam.IamFunctions;
    import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
    import com.pulumi.aws.sns.Topic;
    import com.pulumi.aws.sns.TopicArgs;
    import com.pulumi.aws.ec2.VpcEndpointService;
    import com.pulumi.aws.ec2.VpcEndpointServiceArgs;
    import com.pulumi.aws.ec2.VpcEndpointConnectionNotification;
    import com.pulumi.aws.ec2.VpcEndpointConnectionNotificationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var topic = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
                .statements(GetPolicyDocumentStatementArgs.builder()
                    .effect("Allow")
                    .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                        .type("Service")
                        .identifiers("vpce.amazonaws.com")
                        .build())
                    .actions("SNS:Publish")
                    .resources("arn:aws:sns:*:*:vpce-notification-topic")
                    .build())
                .build());
    
            var topicTopic = new Topic("topicTopic", TopicArgs.builder()
                .name("vpce-notification-topic")
                .policy(topic.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
                .build());
    
            var foo = new VpcEndpointService("foo", VpcEndpointServiceArgs.builder()
                .acceptanceRequired(false)
                .networkLoadBalancerArns(test.arn())
                .build());
    
            var fooVpcEndpointConnectionNotification = new VpcEndpointConnectionNotification("fooVpcEndpointConnectionNotification", VpcEndpointConnectionNotificationArgs.builder()
                .vpcEndpointServiceId(foo.id())
                .connectionNotificationArn(topicTopic.arn())
                .connectionEvents(            
                    "Accept",
                    "Reject")
                .build());
    
        }
    }
    
    resources:
      topicTopic:
        type: aws:sns:Topic
        name: topic
        properties:
          name: vpce-notification-topic
          policy: ${topic.json}
      foo:
        type: aws:ec2:VpcEndpointService
        properties:
          acceptanceRequired: false
          networkLoadBalancerArns:
            - ${test.arn}
      fooVpcEndpointConnectionNotification:
        type: aws:ec2:VpcEndpointConnectionNotification
        name: foo
        properties:
          vpcEndpointServiceId: ${foo.id}
          connectionNotificationArn: ${topicTopic.arn}
          connectionEvents:
            - Accept
            - Reject
    variables:
      topic:
        fn::invoke:
          Function: aws:iam:getPolicyDocument
          Arguments:
            statements:
              - effect: Allow
                principals:
                  - type: Service
                    identifiers:
                      - vpce.amazonaws.com
                actions:
                  - SNS:Publish
                resources:
                  - arn:aws:sns:*:*:vpce-notification-topic
    

    Create VpcEndpointConnectionNotification Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new VpcEndpointConnectionNotification(name: string, args: VpcEndpointConnectionNotificationArgs, opts?: CustomResourceOptions);
    @overload
    def VpcEndpointConnectionNotification(resource_name: str,
                                          args: VpcEndpointConnectionNotificationArgs,
                                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpcEndpointConnectionNotification(resource_name: str,
                                          opts: Optional[ResourceOptions] = None,
                                          connection_events: Optional[Sequence[str]] = None,
                                          connection_notification_arn: Optional[str] = None,
                                          vpc_endpoint_id: Optional[str] = None,
                                          vpc_endpoint_service_id: Optional[str] = None)
    func NewVpcEndpointConnectionNotification(ctx *Context, name string, args VpcEndpointConnectionNotificationArgs, opts ...ResourceOption) (*VpcEndpointConnectionNotification, error)
    public VpcEndpointConnectionNotification(string name, VpcEndpointConnectionNotificationArgs args, CustomResourceOptions? opts = null)
    public VpcEndpointConnectionNotification(String name, VpcEndpointConnectionNotificationArgs args)
    public VpcEndpointConnectionNotification(String name, VpcEndpointConnectionNotificationArgs args, CustomResourceOptions options)
    
    type: aws:ec2:VpcEndpointConnectionNotification
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args VpcEndpointConnectionNotificationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args VpcEndpointConnectionNotificationArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args VpcEndpointConnectionNotificationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpcEndpointConnectionNotificationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpcEndpointConnectionNotificationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var vpcEndpointConnectionNotificationResource = new Aws.Ec2.VpcEndpointConnectionNotification("vpcEndpointConnectionNotificationResource", new()
    {
        ConnectionEvents = new[]
        {
            "string",
        },
        ConnectionNotificationArn = "string",
        VpcEndpointId = "string",
        VpcEndpointServiceId = "string",
    });
    
    example, err := ec2.NewVpcEndpointConnectionNotification(ctx, "vpcEndpointConnectionNotificationResource", &ec2.VpcEndpointConnectionNotificationArgs{
    	ConnectionEvents: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ConnectionNotificationArn: pulumi.String("string"),
    	VpcEndpointId:             pulumi.String("string"),
    	VpcEndpointServiceId:      pulumi.String("string"),
    })
    
    var vpcEndpointConnectionNotificationResource = new VpcEndpointConnectionNotification("vpcEndpointConnectionNotificationResource", VpcEndpointConnectionNotificationArgs.builder()
        .connectionEvents("string")
        .connectionNotificationArn("string")
        .vpcEndpointId("string")
        .vpcEndpointServiceId("string")
        .build());
    
    vpc_endpoint_connection_notification_resource = aws.ec2.VpcEndpointConnectionNotification("vpcEndpointConnectionNotificationResource",
        connection_events=["string"],
        connection_notification_arn="string",
        vpc_endpoint_id="string",
        vpc_endpoint_service_id="string")
    
    const vpcEndpointConnectionNotificationResource = new aws.ec2.VpcEndpointConnectionNotification("vpcEndpointConnectionNotificationResource", {
        connectionEvents: ["string"],
        connectionNotificationArn: "string",
        vpcEndpointId: "string",
        vpcEndpointServiceId: "string",
    });
    
    type: aws:ec2:VpcEndpointConnectionNotification
    properties:
        connectionEvents:
            - string
        connectionNotificationArn: string
        vpcEndpointId: string
        vpcEndpointServiceId: string
    

    VpcEndpointConnectionNotification Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The VpcEndpointConnectionNotification resource accepts the following input properties:

    ConnectionEvents List<string>

    One or more endpoint events for which to receive notifications.

    NOTE: One of vpc_endpoint_service_id or vpc_endpoint_id must be specified.

    ConnectionNotificationArn string
    The ARN of the SNS topic for the notifications.
    VpcEndpointId string
    The ID of the VPC Endpoint to receive notifications for.
    VpcEndpointServiceId string
    The ID of the VPC Endpoint Service to receive notifications for.
    ConnectionEvents []string

    One or more endpoint events for which to receive notifications.

    NOTE: One of vpc_endpoint_service_id or vpc_endpoint_id must be specified.

    ConnectionNotificationArn string
    The ARN of the SNS topic for the notifications.
    VpcEndpointId string
    The ID of the VPC Endpoint to receive notifications for.
    VpcEndpointServiceId string
    The ID of the VPC Endpoint Service to receive notifications for.
    connectionEvents List<String>

    One or more endpoint events for which to receive notifications.

    NOTE: One of vpc_endpoint_service_id or vpc_endpoint_id must be specified.

    connectionNotificationArn String
    The ARN of the SNS topic for the notifications.
    vpcEndpointId String
    The ID of the VPC Endpoint to receive notifications for.
    vpcEndpointServiceId String
    The ID of the VPC Endpoint Service to receive notifications for.
    connectionEvents string[]

    One or more endpoint events for which to receive notifications.

    NOTE: One of vpc_endpoint_service_id or vpc_endpoint_id must be specified.

    connectionNotificationArn string
    The ARN of the SNS topic for the notifications.
    vpcEndpointId string
    The ID of the VPC Endpoint to receive notifications for.
    vpcEndpointServiceId string
    The ID of the VPC Endpoint Service to receive notifications for.
    connection_events Sequence[str]

    One or more endpoint events for which to receive notifications.

    NOTE: One of vpc_endpoint_service_id or vpc_endpoint_id must be specified.

    connection_notification_arn str
    The ARN of the SNS topic for the notifications.
    vpc_endpoint_id str
    The ID of the VPC Endpoint to receive notifications for.
    vpc_endpoint_service_id str
    The ID of the VPC Endpoint Service to receive notifications for.
    connectionEvents List<String>

    One or more endpoint events for which to receive notifications.

    NOTE: One of vpc_endpoint_service_id or vpc_endpoint_id must be specified.

    connectionNotificationArn String
    The ARN of the SNS topic for the notifications.
    vpcEndpointId String
    The ID of the VPC Endpoint to receive notifications for.
    vpcEndpointServiceId String
    The ID of the VPC Endpoint Service to receive notifications for.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VpcEndpointConnectionNotification resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    NotificationType string
    The type of notification.
    State string
    The state of the notification.
    Id string
    The provider-assigned unique ID for this managed resource.
    NotificationType string
    The type of notification.
    State string
    The state of the notification.
    id String
    The provider-assigned unique ID for this managed resource.
    notificationType String
    The type of notification.
    state String
    The state of the notification.
    id string
    The provider-assigned unique ID for this managed resource.
    notificationType string
    The type of notification.
    state string
    The state of the notification.
    id str
    The provider-assigned unique ID for this managed resource.
    notification_type str
    The type of notification.
    state str
    The state of the notification.
    id String
    The provider-assigned unique ID for this managed resource.
    notificationType String
    The type of notification.
    state String
    The state of the notification.

    Look up Existing VpcEndpointConnectionNotification Resource

    Get an existing VpcEndpointConnectionNotification resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: VpcEndpointConnectionNotificationState, opts?: CustomResourceOptions): VpcEndpointConnectionNotification
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            connection_events: Optional[Sequence[str]] = None,
            connection_notification_arn: Optional[str] = None,
            notification_type: Optional[str] = None,
            state: Optional[str] = None,
            vpc_endpoint_id: Optional[str] = None,
            vpc_endpoint_service_id: Optional[str] = None) -> VpcEndpointConnectionNotification
    func GetVpcEndpointConnectionNotification(ctx *Context, name string, id IDInput, state *VpcEndpointConnectionNotificationState, opts ...ResourceOption) (*VpcEndpointConnectionNotification, error)
    public static VpcEndpointConnectionNotification Get(string name, Input<string> id, VpcEndpointConnectionNotificationState? state, CustomResourceOptions? opts = null)
    public static VpcEndpointConnectionNotification get(String name, Output<String> id, VpcEndpointConnectionNotificationState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ConnectionEvents List<string>

    One or more endpoint events for which to receive notifications.

    NOTE: One of vpc_endpoint_service_id or vpc_endpoint_id must be specified.

    ConnectionNotificationArn string
    The ARN of the SNS topic for the notifications.
    NotificationType string
    The type of notification.
    State string
    The state of the notification.
    VpcEndpointId string
    The ID of the VPC Endpoint to receive notifications for.
    VpcEndpointServiceId string
    The ID of the VPC Endpoint Service to receive notifications for.
    ConnectionEvents []string

    One or more endpoint events for which to receive notifications.

    NOTE: One of vpc_endpoint_service_id or vpc_endpoint_id must be specified.

    ConnectionNotificationArn string
    The ARN of the SNS topic for the notifications.
    NotificationType string
    The type of notification.
    State string
    The state of the notification.
    VpcEndpointId string
    The ID of the VPC Endpoint to receive notifications for.
    VpcEndpointServiceId string
    The ID of the VPC Endpoint Service to receive notifications for.
    connectionEvents List<String>

    One or more endpoint events for which to receive notifications.

    NOTE: One of vpc_endpoint_service_id or vpc_endpoint_id must be specified.

    connectionNotificationArn String
    The ARN of the SNS topic for the notifications.
    notificationType String
    The type of notification.
    state String
    The state of the notification.
    vpcEndpointId String
    The ID of the VPC Endpoint to receive notifications for.
    vpcEndpointServiceId String
    The ID of the VPC Endpoint Service to receive notifications for.
    connectionEvents string[]

    One or more endpoint events for which to receive notifications.

    NOTE: One of vpc_endpoint_service_id or vpc_endpoint_id must be specified.

    connectionNotificationArn string
    The ARN of the SNS topic for the notifications.
    notificationType string
    The type of notification.
    state string
    The state of the notification.
    vpcEndpointId string
    The ID of the VPC Endpoint to receive notifications for.
    vpcEndpointServiceId string
    The ID of the VPC Endpoint Service to receive notifications for.
    connection_events Sequence[str]

    One or more endpoint events for which to receive notifications.

    NOTE: One of vpc_endpoint_service_id or vpc_endpoint_id must be specified.

    connection_notification_arn str
    The ARN of the SNS topic for the notifications.
    notification_type str
    The type of notification.
    state str
    The state of the notification.
    vpc_endpoint_id str
    The ID of the VPC Endpoint to receive notifications for.
    vpc_endpoint_service_id str
    The ID of the VPC Endpoint Service to receive notifications for.
    connectionEvents List<String>

    One or more endpoint events for which to receive notifications.

    NOTE: One of vpc_endpoint_service_id or vpc_endpoint_id must be specified.

    connectionNotificationArn String
    The ARN of the SNS topic for the notifications.
    notificationType String
    The type of notification.
    state String
    The state of the notification.
    vpcEndpointId String
    The ID of the VPC Endpoint to receive notifications for.
    vpcEndpointServiceId String
    The ID of the VPC Endpoint Service to receive notifications for.

    Import

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

    $ pulumi import aws:ec2/vpcEndpointConnectionNotification:VpcEndpointConnectionNotification foo vpce-nfn-09e6ed3b4efba2263
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi