Not able to Create AWS NATGATEWAY using terraform


#1

Hi Team,

I cannot able to create the nat gateway using the terraform. I am using the below code.

/*
Create Elastic IP
*/
resource “aws_eip” “tuto_eip” {
vpc = true
depends_on = [“aws_internet_gateway.gw”]
}

/*
Create NAT Gateway
/*
resource “aws_nat_gateway” “nat” {
allocation_id = “${aws_eip.tuto_eip.id}”
subnet_id = “${aws_subnet.private_subnet_eu_west_1a.id}”
}

In this code Elastic IP is creating properly. But the nat gateway not creating.

Please let us know how to create nat gateway.