Skip to content

Commit dccb97c

Browse files
Update variables definitions
1 parent 608eb2a commit dccb97c

File tree

5 files changed

+12
-18
lines changed

5 files changed

+12
-18
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,6 @@ No modules.
472472
| <a name="input_flow_log_traffic_type"></a> [flow\_log\_traffic\_type](#input\_flow\_log\_traffic\_type) | The type of traffic to capture. Valid values: ACCEPT, REJECT, ALL | `string` | `"ALL"` | no |
473473
| <a name="input_igw_tags"></a> [igw\_tags](#input\_igw\_tags) | Additional tags for the internet gateway | `map(string)` | `{}` | no |
474474
| <a name="input_instance_tenancy"></a> [instance\_tenancy](#input\_instance\_tenancy) | A tenancy option for instances launched into the VPC | `string` | `"default"` | no |
475-
| <a name="input_internet_gateway_block_enabled"></a> [internet\_gateway\_block\_enabled](#input\_internet\_gateway\_block\_enabled) | Enable AWS VPC Block Public Access Options. Default is `false` | `bool` | `false` | no |
476-
| <a name="input_internet_gateway_block_mode"></a> [internet\_gateway\_block\_mode](#input\_internet\_gateway\_block\_mode) | Block mode. Needs to be one of `block-bidirectional`, `block-ingress`, `off`. Default is `off` | `string` | `"off"` | no |
477475
| <a name="input_intra_acl_tags"></a> [intra\_acl\_tags](#input\_intra\_acl\_tags) | Additional tags for the intra subnets network ACL | `map(string)` | `{}` | no |
478476
| <a name="input_intra_dedicated_network_acl"></a> [intra\_dedicated\_network\_acl](#input\_intra\_dedicated\_network\_acl) | Whether to use dedicated network ACL (not default) and custom rules for intra subnets | `bool` | `false` | no |
479477
| <a name="input_intra_inbound_acl_rules"></a> [intra\_inbound\_acl\_rules](#input\_intra\_inbound\_acl\_rules) | Intra subnets inbound network ACLs | `list(map(string))` | <pre>[<br/> {<br/> "cidr_block": "0.0.0.0/0",<br/> "from_port": 0,<br/> "protocol": "-1",<br/> "rule_action": "allow",<br/> "rule_number": 100,<br/> "to_port": 0<br/> }<br/>]</pre> | no |
@@ -586,6 +584,7 @@ No modules.
586584
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |
587585
| <a name="input_use_ipam_pool"></a> [use\_ipam\_pool](#input\_use\_ipam\_pool) | Determines whether IPAM pool is used for CIDR allocation | `bool` | `false` | no |
588586
| <a name="input_vpc_block_public_access_exclusions"></a> [vpc\_block\_public\_access\_exclusions](#input\_vpc\_block\_public\_access\_exclusions) | List of VPC Block Public Access Exclusions | `map(any)` | `{}` | no |
587+
| <a name="input_vpc_block_public_access_options"></a> [vpc\_block\_public\_access\_options](#input\_vpc\_block\_public\_access\_options) | Map of VPC Block Public Access Options | `map(string)` | `{}` | no |
589588
| <a name="input_vpc_flow_log_iam_policy_name"></a> [vpc\_flow\_log\_iam\_policy\_name](#input\_vpc\_flow\_log\_iam\_policy\_name) | Name of the IAM policy | `string` | `"vpc-flow-log-to-cloudwatch"` | no |
590589
| <a name="input_vpc_flow_log_iam_policy_use_name_prefix"></a> [vpc\_flow\_log\_iam\_policy\_use\_name\_prefix](#input\_vpc\_flow\_log\_iam\_policy\_use\_name\_prefix) | Determines whether the name of the IAM policy (`vpc_flow_log_iam_policy_name`) is used as a prefix | `bool` | `true` | no |
591590
| <a name="input_vpc_flow_log_iam_role_name"></a> [vpc\_flow\_log\_iam\_role\_name](#input\_vpc\_flow\_log\_iam\_role\_name) | Name to use on the VPC Flow Log IAM role created | `string` | `"vpc-flow-log-role"` | no |

examples/block-public-access/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ aws ec2 --region eu-west-1 describe-vpc-block-public-access-exclusions --exclusi
7373
| Name | Version |
7474
|------|---------|
7575
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
76-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.46 |
76+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.79 |
7777

7878
## Providers
7979

8080
| Name | Version |
8181
|------|---------|
82-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.46 |
82+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.79 |
8383

8484
## Modules
8585

examples/block-public-access/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ module "vpc" {
3232
private_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 4, k)]
3333

3434
### VPC Block Public Access Options
35-
# internet_gateway_block_enabled = true
36-
# internet_gateway_block_mode = "block-bidirectional"
35+
vpc_block_public_access_options = {
36+
internet_gateway_block_mode = "block-bidirectional"
37+
}
3738

3839
### VPC Block Public Access Exclusion at the VPC level
3940
# vpc_block_public_access_exclusions = {

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ resource "aws_vpc_ipv4_cidr_block_association" "this" {
6060
}
6161

6262
resource "aws_vpc_block_public_access_options" "this" {
63-
count = local.create_vpc && length(keys(var.vpc_block_public_access_options)) ? 1 : 0
63+
count = local.create_vpc && length(keys(var.vpc_block_public_access_options)) > 0 ? 1 : 0
6464

6565
internet_gateway_block_mode = try(var.vpc_block_public_access_options["internet_gateway_block_mode"], null)
6666
}
6767

6868
resource "aws_vpc_block_public_access_exclusion" "this" {
69-
for_each = {for k, v in var.vpc_block_public_access_exclusions: k => v if local.create_vpc}
69+
for_each = { for k, v in var.vpc_block_public_access_exclusions : k => v if local.create_vpc }
7070

7171
vpc_id = lookup(each.value, "exclude_vpc", false) ? local.vpc_id : null
7272

variables.tf

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,10 @@ variable "tags" {
116116
default = {}
117117
}
118118

119-
variable "internet_gateway_block_enabled" {
120-
description = "Enable AWS VPC Block Public Access Options. Default is `false`"
121-
type = bool
122-
default = false
123-
}
124-
125-
variable "internet_gateway_block_mode" {
126-
description = "Block mode. Needs to be one of `block-bidirectional`, `block-ingress`, `off`. Default is `off`"
127-
type = string
128-
default = "off"
119+
variable "vpc_block_public_access_options" {
120+
description = "Map of VPC Block Public Access Options"
121+
type = map(string)
122+
default = {}
129123
}
130124

131125
variable "vpc_block_public_access_exclusions" {

0 commit comments

Comments
 (0)