Skip to content
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

feat(module/subnet_set): ma_public_ip_on_launch per subnet #102

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions modules/subnet_set/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_cidrs"></a> [cidrs](#input\_cidrs) | Map describing configuration of subnets and route tables to create and/or use in the set.<br>Keys are CIDR blocks, values can consist of following items:<br>- `create_subnet` - (Optional\|bool) When `true` (default), subnet is created, otherwise existing one is used.<br>- `create_route_table` - (Optional\|bool) When `true` a dedicated route table is created, unless existing subnet is used.<br>- `associate_route_table` - (Optional\|bool) Unless set to `false`, route table is associated with the subnet.<br>- `existing_route_table_id` - (Optional\|string) Id of an existing route table to associate with the subnet.<br>- `name` - (Optional\|string) Name (tag) of a subnet and, optionally a route table, to create or use. Defaults to set name appended with zone letter id.<br>- `route_table_name` - (Optional\|string) Name (tag) of a subnet and, optionally a route table, to create or use. Defaults to `name` value.<br>- `ipv6_cidr_block` - (Optional\|string) IPv6 CIDR block. The subnet size must use a /64 prefix length.<br>- `local_tags` - (Optional\|map) Map of tags to assign to created resources. | `map(any)` | n/a | yes |
| <a name="input_cidrs"></a> [cidrs](#input\_cidrs) | Map describing configuration of subnets and route tables to create and/or use in the set.<br>Keys are CIDR blocks, values can consist of following items:<br>- `create_subnet` - (Optional\|bool) When `true` (default), subnet is created, otherwise existing one is used.<br>- `create_route_table` - (Optional\|bool) When `true` a dedicated route table is created, unless existing subnet is used.<br>- `associate_route_table` - (Optional\|bool) Unless set to `false`, route table is associated with the subnet.<br>- `existing_route_table_id` - (Optional\|string) Id of an existing route table to associate with the subnet.<br>- `name` - (Optional\|string) Name (tag) of a subnet and, optionally a route table, to create or use. Defaults to set name appended with zone letter id.<br>- `route_table_name` - (Optional\|string) Name (tag) of a subnet and, optionally a route table, to create or use. Defaults to `name` value.<br>- `ipv6_cidr_block` - (Optional\|string) IPv6 CIDR block. The subnet size must use a /64 prefix length.<br>- `map_public_ip_on_launch` - (Optional\|bool) Specify true to indicate that instances launched into the subnet should be assigned a public IP address.<br>- `local_tags` - (Optional\|map) Map of tags to assign to created resources. | `map(any)` | n/a | yes |
| <a name="input_create_shared_route_table"></a> [create\_shared\_route\_table](#input\_create\_shared\_route\_table) | Boolean flag whether to create a shared route tables. | `bool` | `false` | no |
| <a name="input_global_tags"></a> [global\_tags](#input\_global\_tags) | Optional map of arbitrary tags to apply to all the created resources. | `map(string)` | `{}` | no |
| <a name="input_has_secondary_cidrs"></a> [has\_secondary\_cidrs](#input\_has\_secondary\_cidrs) | The input that depends on the secondary CIDR ranges of the VPC `vpc_id`. The actual value (true or false) is ignored, the input is used only to delay subnet creation until the secondary CIDR ranges are processed by Terraform. | `bool` | `true` | no |
| <a name="input_map_public_ip_on_launch"></a> [map\_public\_ip\_on\_launch](#input\_map\_public\_ip\_on\_launch) | See the [provider's documentation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet#map_public_ip_on_launch). | `bool` | `null` | no |
| <a name="input_nacl_associations"></a> [nacl\_associations](#input\_nacl\_associations) | NACLs associations with subnets | `map(string)` | `{}` | no |
| <a name="input_name"></a> [name](#input\_name) | Subnet set name, used to construct default subnet names. | `string` | `null` | no |
| <a name="input_propagating_vgws"></a> [propagating\_vgws](#input\_propagating\_vgws) | See the [provider's documentation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table). | `list(string)` | `[]` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/subnet_set/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ resource "aws_subnet" "this" {
ipv6_cidr_block = try(each.value.ipv6_cidr_block, null)
availability_zone = each.key
vpc_id = var.vpc_id
map_public_ip_on_launch = var.map_public_ip_on_launch
map_public_ip_on_launch = try(each.value.map_public_ip_on_launch, null)
tags = merge(var.global_tags, each.value.local_tags, { Name = each.value.name })

depends_on = [
Expand Down
7 changes: 1 addition & 6 deletions modules/subnet_set/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ variable "cidrs" {
- `name` - (Optional|string) Name (tag) of a subnet and, optionally a route table, to create or use. Defaults to set name appended with zone letter id.
- `route_table_name` - (Optional|string) Name (tag) of a subnet and, optionally a route table, to create or use. Defaults to `name` value.
- `ipv6_cidr_block` - (Optional|string) IPv6 CIDR block. The subnet size must use a /64 prefix length.
- `map_public_ip_on_launch` - (Optional|bool) Specify true to indicate that instances launched into the subnet should be assigned a public IP address.
- `local_tags` - (Optional|map) Map of tags to assign to created resources.
EOF
type = map(any)
Expand All @@ -31,12 +32,6 @@ variable "create_shared_route_table" {
type = bool
}

variable "map_public_ip_on_launch" {
description = "See the [provider's documentation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet#map_public_ip_on_launch)."
default = null
type = bool
}

variable "propagating_vgws" {
description = "See the [provider's documentation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table)."
default = []
Expand Down
Loading