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
        {
            VpcEndpointId = aws_vpc_endpoint.Ec2.Id,
            SubnetId = aws_subnet.Sn.Id,
        });
    }

}
package main

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

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

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

const snEc2 = new aws.ec2.VpcEndpointSubnetAssociation("snEc2", {
    vpcEndpointId: aws_vpc_endpoint.ec2.id,
    subnetId: aws_subnet.sn.id,
});

Create a VpcEndpointSubnetAssociation Resource

new VpcEndpointSubnetAssociation(name: string, args: VpcEndpointSubnetAssociationArgs, opts?: CustomResourceOptions);
@overload
def VpcEndpointSubnetAssociation(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 subnet_id: Optional[str] = None,
                                 vpc_endpoint_id: Optional[str] = None)
@overload
def VpcEndpointSubnetAssociation(resource_name: str,
                                 args: VpcEndpointSubnetAssociationArgs,
                                 opts: Optional[ResourceOptions] = None)
func NewVpcEndpointSubnetAssociation(ctx *Context, name string, args VpcEndpointSubnetAssociationArgs, opts ...ResourceOption) (*VpcEndpointSubnetAssociation, error)
public VpcEndpointSubnetAssociation(string name, VpcEndpointSubnetAssociationArgs args, CustomResourceOptions? opts = null)
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.
args VpcEndpointSubnetAssociationArgs
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 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.

public static get(name: string, id: Input<ID>, state?: VpcEndpointSubnetAssociationState, opts?: CustomResourceOptions): VpcEndpointSubnetAssociation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        subnet_id: Optional[str] = None,
        vpc_endpoint_id: Optional[str] = None) -> VpcEndpointSubnetAssociation
func GetVpcEndpointSubnetAssociation(ctx *Context, name string, id IDInput, state *VpcEndpointSubnetAssociationState, opts ...ResourceOption) (*VpcEndpointSubnetAssociation, error)
public static VpcEndpointSubnetAssociation Get(string name, Input<string> id, VpcEndpointSubnetAssociationState? state, CustomResourceOptions? opts = null)
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.