-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for resource-specific tags
- Loading branch information
Showing
7 changed files
with
243 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,5 @@ module "vpc" { | |
tags = { | ||
app = "example" | ||
env = "production" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,106 @@ | ||
variable "internet_gateway" { | ||
description = "Internet Gateway which belongs to `var.vpc`" | ||
variable "default_tags" { | ||
type = map(string) | ||
default = {} | ||
|
||
description = <<EOS | ||
Map of tags assigned to all AWS resources created by this module. | ||
EOS | ||
} | ||
|
||
variable "internet_gateway" { | ||
type = object({ | ||
id = string | ||
}) | ||
|
||
description = <<EOS | ||
Internet Gateway which belongs to `var.vpc` | ||
EOS | ||
} | ||
|
||
variable "subnet_bits" { | ||
variable "nat_gateway_eip_tags" { | ||
type = map(string) | ||
default = {} | ||
|
||
description = <<EOS | ||
Number of bits to add to the VPC CIDR to get the size of the subnet CIDR | ||
Map of tags assigned to the NAT Gateway EIP. | ||
EOS | ||
} | ||
|
||
This will be the `newbits` argument of [`cidrsubnet`](https://www.terraform.io/docs/language/functions/cidrsubnet.html). | ||
variable "nat_gateway_tags" { | ||
type = map(string) | ||
default = {} | ||
|
||
description = <<EOS | ||
Map of tags assigned to the NAT Gateway | ||
EOS | ||
} | ||
|
||
type = number | ||
variable "private_route_table_tags" { | ||
type = map(string) | ||
default = {} | ||
|
||
description = <<EOS | ||
Map of tags assigned to the private route table. | ||
EOS | ||
} | ||
|
||
variable "subnet_index" { | ||
variable "private_subnet_tags" { | ||
type = map(string) | ||
default = {} | ||
|
||
description = <<EOS | ||
The number of the subnet which will be used to calculate the subnet CIDR | ||
Map of tags assigned to the private subnet. | ||
EOS | ||
} | ||
|
||
This will be used in the `netnum` argument of [`cidrsubnet`](https://www.terraform.io/docs/language/functions/cidrsubnet.html): | ||
variable "public_route_table_tags" { | ||
type = map(string) | ||
default = {} | ||
|
||
* for the public subnet, it will be `2 * var.subnet_index`, | ||
* for the private subnet, it will be `2 * var.subnet_index + 1`. | ||
description = <<EOS | ||
Map of tags assigned to the public route table. | ||
EOS | ||
} | ||
|
||
variable "public_subnet_tags" { | ||
type = map(string) | ||
default = {} | ||
|
||
description = <<EOS | ||
Map of tags assigned to the public subnet. | ||
EOS | ||
} | ||
|
||
variable "subnet_bits" { | ||
type = number | ||
|
||
description = <<EOS | ||
Number of bits to add to the VPC CIDR to get the size of the subnet CIDR. | ||
This will be the `newbits` argument of [`cidrsubnet`](https://www.terraform.io/docs/language/functions/cidrsubnet.html). | ||
EOS | ||
} | ||
|
||
variable "tags" { | ||
description = "Map of tags to assign to all resources supporting tags (in addition to the `Name` tag)" | ||
variable "subnet_index" { | ||
type = number | ||
|
||
description = <<EOS | ||
The number of the subnet which will be used to calculate the subnet CIDR. | ||
type = map(string) | ||
This will be used in the `netnum` argument of [`cidrsubnet`](https://www.terraform.io/docs/language/functions/cidrsubnet.html): | ||
* for the public subnet, it will be `2 * var.subnet_index`, | ||
* for the private subnet, it will be `2 * var.subnet_index + 1`. | ||
EOS | ||
} | ||
|
||
variable "vpc" { | ||
description = "VPC in which the subnets and routing tables will be created" | ||
|
||
type = object({ | ||
id = string | ||
cidr_block = string | ||
}) | ||
|
||
description = <<EOS | ||
VPC in which the subnets and routing tables will be created. | ||
EOS | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.