FEATURES OPEN SOURCE ABOUT DOCS LOGIN REGISTER

aws_nat_gateway

Provides a resource to create a VPC NAT Gateway.

Example Usage

resource "aws_nat_gateway" "gw" {
    allocation_id = "${aws_eip.nat.id}"
    subnet_id = "${aws_subnet.public.id}"
}

Argument Reference

The following arguments are supported:

-> Note: It’s recommended to denote that the NAT Gateway depends on the Internet Gateway for the VPC in which the NAT Gateway’s subnet is located. For example:

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

resource "aws_nat_gateway" "gw" {
  //other arguments

  depends_on = ["aws_internet_gateway.gw"]
}

Attributes Reference

The following attributes are exported:

Import

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

$ terraform import aws_nat_gateway.private_gw nat-05dba92075d71c408

See the source of this document at Terraform.io