aws_internet_gateway

Provides a resource to create a VPC Internet Gateway.

Example Usage

resource "aws_internet_gateway" "gw" {
  vpc_id = "${aws_vpc.main.id}"

  tags {
    Name = "main"
  }
}

Argument Reference

The following arguments are supported:

  • vpc_id - (Required) The VPC ID to create in.
  • tags - (Optional) A mapping of tags to assign to the resource.
resource "aws_internet_gateway" "gw" {
  vpc_id = "${aws_vpc.main.id}"
}

resource "aws_instance" "foo" {
  depends_on = ["aws_internet_gateway.gw"]
}

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The ID of the Internet Gateway.

Import

Internet Gateways can be imported using the id, e.g.

$ terraform import aws_internet_gateway.gw igw-c0a643a9

© 2018 HashiCorp
Licensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/aws/r/internet_gateway.html