Resource: aws_vpc_endpoint_subnet_association

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

Example Usage

Basic usage:

resource "aws_vpc_endpoint_subnet_association" "sn_ec2" {
  vpc_endpoint_id = aws_vpc_endpoint.ec2.id
  subnet_id       = aws_subnet.sn.id
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

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

Timeouts

Configuration options:

Import

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