cowork
This commit is contained in:
@ -1,7 +1,16 @@
|
||||
resource "aws_route" "route-add" {
|
||||
route_table_id = var.route_public_id
|
||||
resource "aws_route" "route-igw-add" {
|
||||
count = format("%.1s", var.gw_type) == "i" ? 1 : 0
|
||||
route_table_id = var.route_id
|
||||
destination_cidr_block = "0.0.0.0/0"
|
||||
gateway_id = var.igw_id
|
||||
depends_on = [var.route_public_id]
|
||||
depends_on = [var.route_id]
|
||||
# depends_on = [aws_route_table.testing]
|
||||
}
|
||||
resource "aws_route" "route-nat-add" {
|
||||
count = format("%.1s", var.gw_type) == "i" ? 0 : 1
|
||||
route_table_id = var.route_id
|
||||
destination_cidr_block = "0.0.0.0/0"
|
||||
nat_gateway_id = var.nat_id
|
||||
depends_on = [var.route_id]
|
||||
# depends_on = [aws_route_table.testing]
|
||||
}
|
@ -1,9 +1,19 @@
|
||||
variable "route_public_id" {
|
||||
variable "route_id" {
|
||||
description = "value"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "gw_type" {
|
||||
description = "gateway type. nat or igw"
|
||||
type = string
|
||||
}
|
||||
variable "igw_id" {
|
||||
description = "value"
|
||||
type = string
|
||||
default = "null"
|
||||
}
|
||||
variable "nat_id" {
|
||||
description = "value"
|
||||
type = string
|
||||
default = "null"
|
||||
}
|
Reference in New Issue
Block a user