VpcEndpointSubnetAssociation

Provides a resource to create an association between a VPC endpoint and a subnet.

NOTE on VPC Endpoints and VPC Endpoint Subnet Associations: This provider provides both a standalone VPC Endpoint Subnet Association (an association between a VPC endpoint and a single subnet_id) and a VPC Endpoint resource with a subnet_ids attribute. Do not use the same subnet ID in both a VPC Endpoint resource and a VPC Endpoint Subnet Association resource. Doing so will cause a conflict of associations and will overwrite the association.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var snEc2 = new Aws.Ec2.VpcEndpointSubnetAssociation("snEc2", new Aws.Ec2.VpcEndpointSubnetAssociationArgs
        {
            SubnetId = aws_subnet.Sn.Id,
            VpcEndpointId = aws_vpc_endpoint.Ec2.Id,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := ec2.NewVpcEndpointSubnetAssociation(ctx, "snEc2", &ec2.VpcEndpointSubnetAssociationArgs{
            SubnetId:      pulumi.String(aws_subnet.Sn.Id),
            VpcEndpointId: pulumi.String(aws_vpc_endpoint.Ec2.Id),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

sn_ec2 = aws.ec2.VpcEndpointSubnetAssociation("snEc2",
    subnet_id=aws_subnet["sn"]["id"],
    vpc_endpoint_id=aws_vpc_endpoint["ec2"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const snEc2 = new aws.ec2.VpcEndpointSubnetAssociation("sn_ec2", {
    subnetId: aws_subnet_sn.id,
    vpcEndpointId: aws_vpc_endpoint_ec2.id,
});

Create a VpcEndpointSubnetAssociation Resource

def VpcEndpointSubnetAssociation(resource_name, opts=None, subnet_id=None, vpc_endpoint_id=None, __props__=None);
name string
The unique name of the resource.
args VpcEndpointSubnetAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args VpcEndpointSubnetAssociationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args VpcEndpointSubnetAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

VpcEndpointSubnetAssociation Resource Properties

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

Inputs

The VpcEndpointSubnetAssociation resource accepts the following input properties:

SubnetId string

The ID of the subnet to be associated with the VPC endpoint.

VpcEndpointId string

The ID of the VPC endpoint with which the subnet will be associated.

SubnetId string

The ID of the subnet to be associated with the VPC endpoint.

VpcEndpointId string

The ID of the VPC endpoint with which the subnet will be associated.

subnetId string

The ID of the subnet to be associated with the VPC endpoint.

vpcEndpointId string

The ID of the VPC endpoint with which the subnet will be associated.

subnet_id str

The ID of the subnet to be associated with the VPC endpoint.

vpc_endpoint_id str

The ID of the VPC endpoint with which the subnet will be associated.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing VpcEndpointSubnetAssociation Resource

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

static get(resource_name, id, opts=None, subnet_id=None, vpc_endpoint_id=None, __props__=None);
func GetVpcEndpointSubnetAssociation(ctx *Context, name string, id IDInput, state *VpcEndpointSubnetAssociationState, opts ...ResourceOption) (*VpcEndpointSubnetAssociation, error)
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.

The following state arguments are supported:

SubnetId string

The ID of the subnet to be associated with the VPC endpoint.

VpcEndpointId string

The ID of the VPC endpoint with which the subnet will be associated.

SubnetId string

The ID of the subnet to be associated with the VPC endpoint.

VpcEndpointId string

The ID of the VPC endpoint with which the subnet will be associated.

subnetId string

The ID of the subnet to be associated with the VPC endpoint.

vpcEndpointId string

The ID of the VPC endpoint with which the subnet will be associated.

subnet_id str

The ID of the subnet to be associated with the VPC endpoint.

vpc_endpoint_id str

The ID of the VPC endpoint with which the subnet will be associated.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.