2014-07-23 23:41:48 +02:00
|
|
|
---
|
|
|
|
layout: "aws"
|
|
|
|
page_title: "AWS: aws_internet_gateway"
|
|
|
|
sidebar_current: "docs-aws-resource-internet-gateway"
|
2014-10-22 05:21:56 +02:00
|
|
|
description: |-
|
|
|
|
Provides a resource to create a VPC Internet Gateway.
|
2014-07-23 23:41:48 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
# aws\_internet\_gateway
|
|
|
|
|
|
|
|
Provides a resource to create a VPC Internet Gateway.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
2017-04-17 12:17:54 +02:00
|
|
|
```hcl
|
2014-07-23 23:41:48 +02:00
|
|
|
resource "aws_internet_gateway" "gw" {
|
2017-02-18 23:48:50 +01:00
|
|
|
vpc_id = "${aws_vpc.main.id}"
|
2015-02-11 14:33:59 +01:00
|
|
|
|
2017-02-18 23:48:50 +01:00
|
|
|
tags {
|
|
|
|
Name = "main"
|
|
|
|
}
|
2014-07-23 23:41:48 +02:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `vpc_id` - (Required) The VPC ID to create in.
|
2015-02-11 14:33:59 +01:00
|
|
|
* `tags` - (Optional) A mapping of tags to assign to the resource.
|
2014-07-23 23:41:48 +02:00
|
|
|
|
2017-02-18 23:48:50 +01:00
|
|
|
-> **Note:** It's recommended to denote that the AWS Instance or Elastic IP depends on the Internet Gateway. For example:
|
2015-03-13 22:04:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
resource "aws_internet_gateway" "gw" {
|
|
|
|
vpc_id = "${aws_vpc.main.id}"
|
|
|
|
}
|
|
|
|
|
2017-02-18 23:48:50 +01:00
|
|
|
resource "aws_instance" "foo" {
|
|
|
|
depends_on = ["aws_internet_gateway.gw"]
|
2015-03-13 22:04:27 +01:00
|
|
|
}
|
|
|
|
|
2015-03-13 21:39:17 +01:00
|
|
|
|
2014-07-23 23:41:48 +02:00
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `id` - The ID of the Internet Gateway.
|
|
|
|
|
2016-07-21 00:28:59 +02:00
|
|
|
|
|
|
|
## Import
|
|
|
|
|
2017-02-18 23:48:50 +01:00
|
|
|
Internet Gateways can be imported using the `id`, e.g.
|
2016-07-21 00:28:59 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
$ terraform import aws_internet_gateway.gw igw-c0a643a9
|
|
|
|
```
|