mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-04-20 15:01:55 -04:00
* Add new aws_vpc_endpoint_route_table_association resource. This commit adds a new resource which allows to a list of route tables to be either added and/or removed from an existing VPC Endpoint. This resource would also be complimentary to the existing `aws_vpc_endpoint` resource where the route tables might not be specified (not a requirement for a VPC Endpoint to be created successfully) during creation, especially where the workflow is such where the route tables are not immediately known. Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com> Additions by Kit Ewbank <Kit_Ewbank@hotmail.com>: * Add functionality * Add documentation * Add acceptance tests * Set VPC endpoint route_table_ids attribute to "Computed" * Changes after review - Set resource ID in create function. * Changes after code review by @kwilczynski: * Removed error types and simplified the error handling in 'resourceAwsVPCEndpointRouteTableAssociationRead' * Simplified logging in 'resourceAwsVPCEndpointRouteTableAssociationDelete'
1.7 KiB
1.7 KiB
layout, page_title, sidebar_current, description
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| aws | AWS: aws_vpc_endpoint | docs-aws-resource-vpc-endpoint | Provides a VPC Endpoint resource. |
aws_vpc_endpoint
Provides a VPC Endpoint resource.
~> NOTE on VPC Endpoints and VPC Endpoint Route Table Associations: Terraform provides
both a standalone VPC Endpoint Route Table Association
(an association between a VPC endpoint and a single route_table_id) and a VPC Endpoint resource
with a route_table_ids attribute. Do not use the same route table ID in both a VPC Endpoint resource
and a VPC Endpoint Route Table Association resource. Doing so will cause a conflict of associations
and will overwrite the association.
Example Usage
Basic usage:
resource "aws_vpc_endpoint" "private-s3" {
vpc_id = "${aws_vpc.main.id}"
service_name = "com.amazonaws.us-west-2.s3"
}
Argument Reference
The following arguments are supported:
vpc_id- (Required) The ID of the VPC in which the endpoint will be used.service_name- (Required) The AWS service name, in the formcom.amazonaws.region.service.policy- (Optional) A policy to attach to the endpoint that controls access to the service.route_table_ids- (Optional) One or more route table IDs.
Attributes Reference
The following attributes are exported:
id- The ID of the VPC endpoint.prefix_list_id- The prefix list ID of the exposed service.cidr_blocks- The list of CIDR blocks for the exposed service.
Import
VPC Endpoints can be imported using the vpc endpoint id, e.g.
$ terraform import aws_vpc_endpoint.endpoint1 vpce-3ecf2a57