-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for resource-specific tags #26
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -14,8 +14,8 @@ module "vpc" { | |
interface = ["logs"] | ||
} | ||
|
||
tags = { | ||
default_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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please split "add |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not document
default_tags
in the README?