2015-07-10 14:12:11 +02:00
|
|
|
---
|
|
|
|
layout: "aws"
|
|
|
|
page_title: "AWS: aws_vpc_endpoint"
|
|
|
|
sidebar_current: "docs-aws-resource-vpc-endpoint"
|
|
|
|
description: |-
|
|
|
|
Provides a VPC Endpoint resource.
|
|
|
|
---
|
|
|
|
|
|
|
|
# aws\_vpc\_endpoint
|
|
|
|
|
|
|
|
Provides a VPC Endpoint resource.
|
|
|
|
|
2016-12-05 13:55:37 +01:00
|
|
|
~> **NOTE on VPC Endpoints and VPC Endpoint Route Table Associations:** Terraform provides
|
|
|
|
both a standalone [VPC Endpoint Route Table Association](vpc_endpoint_route_table_association.html)
|
|
|
|
(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.
|
|
|
|
|
2015-07-10 14:12:11 +02:00
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
Basic usage:
|
|
|
|
|
2017-04-17 12:17:54 +02:00
|
|
|
```hcl
|
2015-07-10 14:12:11 +02:00
|
|
|
resource "aws_vpc_endpoint" "private-s3" {
|
2017-02-18 23:48:50 +01:00
|
|
|
vpc_id = "${aws_vpc.main.id}"
|
|
|
|
service_name = "com.amazonaws.us-west-2.s3"
|
2015-07-10 14:12:11 +02:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## 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 form `com.amazonaws.region.service`.
|
2015-09-24 16:58:58 +02:00
|
|
|
* `policy` - (Optional) A policy to attach to the endpoint that controls access to the service.
|
2015-07-10 14:12:11 +02:00
|
|
|
* `route_table_ids` - (Optional) One or more route table IDs.
|
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `id` - The ID of the VPC endpoint.
|
2016-06-06 12:02:07 +02:00
|
|
|
* `prefix_list_id` - The prefix list ID of the exposed service.
|
2016-11-21 09:43:56 +01:00
|
|
|
* `cidr_blocks` - The list of CIDR blocks for the exposed service.
|
2016-07-19 18:22:30 +02:00
|
|
|
|
|
|
|
## Import
|
|
|
|
|
2016-12-05 13:55:37 +01:00
|
|
|
VPC Endpoints can be imported using the `vpc endpoint id`, e.g.
|
2016-07-19 18:22:30 +02:00
|
|
|
|
|
|
|
```
|
2016-07-21 00:28:59 +02:00
|
|
|
$ terraform import aws_vpc_endpoint.endpoint1 vpce-3ecf2a57
|
2016-11-04 20:47:52 +01:00
|
|
|
```
|