Provides a resource to create an association between a VPC endpoint and a subnet.
Basic usage:
resource "aws_vpc_endpoint_subnet_association" "sn_ec2" {
vpc_endpoint_id = aws_vpc_endpoint.ec2.id
subnet_id = aws_subnet.sn.id
}
This resource supports the following arguments:
vpc_endpoint_id
- (Required) The ID of the VPC endpoint with which the subnet will be associated.subnet_id
- (Required) The ID of the subnet to be associated with the VPC endpoint.This resource exports the following attributes in addition to the arguments above:
id
- The ID of the association.create
- (Default 10m
)delete
- (Default 10m
)In Terraform v1.5.0 and later, use an import
block to import VPC Endpoint Subnet Associations using vpc_endpoint_id
together with subnet_id
. For example:
import {
to = aws_vpc_endpoint_subnet_association.example
id = "vpce-aaaaaaaa/subnet-bbbbbbbbbbbbbbbbb"
}
Using terraform import
, import VPC Endpoint Subnet Associations using vpc_endpoint_id
together with subnet_id
. For example:
% terraform import aws_vpc_endpoint_subnet_association.example vpce-aaaaaaaa/subnet-bbbbbbbbbbbbbbbbb