|
|
@@ -24,6 +24,10 @@ resource "aws_internet_gateway" "tut-gateway" {
|
|
|
// Se adjunta a la VPC
|
|
|
// Se definen sus direcciones
|
|
|
resource "aws_subnet" "tut-subnet-1" {
|
|
|
+ depends_on = [
|
|
|
+ aws_vpc.tut-vpc
|
|
|
+ ]
|
|
|
+
|
|
|
assign_ipv6_address_on_creation = true
|
|
|
availability_zone = "us-west-2a"
|
|
|
cidr_block = cidrsubnet(aws_vpc.tut-vpc.cidr_block, 8, 1)
|
|
|
@@ -39,6 +43,11 @@ resource "aws_subnet" "tut-subnet-1" {
|
|
|
// Rutas para salida a Internet
|
|
|
// Toma por defecto la tabla predefinida en la VPC
|
|
|
resource "aws_default_route_table" "tut-routes" {
|
|
|
+ depends_on = [
|
|
|
+ aws_vpc.tut-vpc,
|
|
|
+ aws_internet_gateway.tut-gateway
|
|
|
+ ]
|
|
|
+
|
|
|
default_route_table_id = aws_vpc.tut-vpc.default_route_table_id
|
|
|
|
|
|
route {
|
|
|
@@ -58,6 +67,11 @@ resource "aws_default_route_table" "tut-routes" {
|
|
|
|
|
|
// Adjunta las rutas par salida a Internet en la sub-red
|
|
|
resource "aws_route_table_association" "tut-route-1" {
|
|
|
+ depends_on = [
|
|
|
+ aws_subnet.tut-subnet-1,
|
|
|
+ aws_default_route_table.tut-routes
|
|
|
+ ]
|
|
|
+
|
|
|
subnet_id = aws_subnet.tut-subnet-1.id
|
|
|
route_table_id = aws_default_route_table.tut-routes.id
|
|
|
}
|