Skip to content

Commit 370c550

Browse files
cloudpossebotNuru
authored andcommitted
Minor cleanups
1 parent 00adbb7 commit 370c550

File tree

7 files changed

+18
-12
lines changed

7 files changed

+18
-12
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ Available targets:
286286

287287
| Name | Version |
288288
|------|---------|
289-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.13.0 |
289+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.71.0 |
290290

291291
## Modules
292292

@@ -430,12 +430,12 @@ Available targets:
430430
| <a name="output_nat_instance_ami_id"></a> [nat\_instance\_ami\_id](#output\_nat\_instance\_ami\_id) | ID of AMI used by NAT instance |
431431
| <a name="output_nat_instance_ids"></a> [nat\_instance\_ids](#output\_nat\_instance\_ids) | IDs of the NAT Instances created |
432432
| <a name="output_nat_ips"></a> [nat\_ips](#output\_nat\_ips) | IP Addresses in use by NAT |
433-
| <a name="output_private_network_acl"></a> [private\_network\_acl](#output\_private\_network\_acl) | n/a |
433+
| <a name="output_private_network_acl"></a> [private\_network\_acl](#output\_private\_network\_acl) | ID of the Network ACL created for private subnets |
434434
| <a name="output_private_route_table_ids"></a> [private\_route\_table\_ids](#output\_private\_route\_table\_ids) | IDs of the created private route tables |
435435
| <a name="output_private_subnet_cidrs"></a> [private\_subnet\_cidrs](#output\_private\_subnet\_cidrs) | IPv4 CIDR blocks of the created private subnets |
436436
| <a name="output_private_subnet_ids"></a> [private\_subnet\_ids](#output\_private\_subnet\_ids) | IDs of the created private subnets |
437437
| <a name="output_private_subnet_ipv6_cidrs"></a> [private\_subnet\_ipv6\_cidrs](#output\_private\_subnet\_ipv6\_cidrs) | IPv6 CIDR blocks of the created private subnets |
438-
| <a name="output_public_network_acl"></a> [public\_network\_acl](#output\_public\_network\_acl) | n/a |
438+
| <a name="output_public_network_acl"></a> [public\_network\_acl](#output\_public\_network\_acl) | ID of the Network ACL created for public subnets |
439439
| <a name="output_public_route_table_ids"></a> [public\_route\_table\_ids](#output\_public\_route\_table\_ids) | IDs of the created public route tables |
440440
| <a name="output_public_subnet_cidrs"></a> [public\_subnet\_cidrs](#output\_public\_subnet\_cidrs) | IPv4 CIDR blocks of the created public subnets |
441441
| <a name="output_public_subnet_ids"></a> [public\_subnet\_ids](#output\_public\_subnet\_ids) | IDs of the created public subnets |

docs/terraform.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
| Name | Version |
1212
|------|---------|
13-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.13.0 |
13+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.71.0 |
1414

1515
## Modules
1616

@@ -154,12 +154,12 @@
154154
| <a name="output_nat_instance_ami_id"></a> [nat\_instance\_ami\_id](#output\_nat\_instance\_ami\_id) | ID of AMI used by NAT instance |
155155
| <a name="output_nat_instance_ids"></a> [nat\_instance\_ids](#output\_nat\_instance\_ids) | IDs of the NAT Instances created |
156156
| <a name="output_nat_ips"></a> [nat\_ips](#output\_nat\_ips) | IP Addresses in use by NAT |
157-
| <a name="output_private_network_acl"></a> [private\_network\_acl](#output\_private\_network\_acl) | n/a |
157+
| <a name="output_private_network_acl"></a> [private\_network\_acl](#output\_private\_network\_acl) | ID of the Network ACL created for private subnets |
158158
| <a name="output_private_route_table_ids"></a> [private\_route\_table\_ids](#output\_private\_route\_table\_ids) | IDs of the created private route tables |
159159
| <a name="output_private_subnet_cidrs"></a> [private\_subnet\_cidrs](#output\_private\_subnet\_cidrs) | IPv4 CIDR blocks of the created private subnets |
160160
| <a name="output_private_subnet_ids"></a> [private\_subnet\_ids](#output\_private\_subnet\_ids) | IDs of the created private subnets |
161161
| <a name="output_private_subnet_ipv6_cidrs"></a> [private\_subnet\_ipv6\_cidrs](#output\_private\_subnet\_ipv6\_cidrs) | IPv6 CIDR blocks of the created private subnets |
162-
| <a name="output_public_network_acl"></a> [public\_network\_acl](#output\_public\_network\_acl) | n/a |
162+
| <a name="output_public_network_acl"></a> [public\_network\_acl](#output\_public\_network\_acl) | ID of the Network ACL created for public subnets |
163163
| <a name="output_public_route_table_ids"></a> [public\_route\_table\_ids](#output\_public\_route\_table\_ids) | IDs of the created public route tables |
164164
| <a name="output_public_subnet_cidrs"></a> [public\_subnet\_cidrs](#output\_public\_subnet\_cidrs) | IPv4 CIDR blocks of the created public subnets |
165165
| <a name="output_public_subnet_ids"></a> [public\_subnet\_ids](#output\_public\_subnet\_ids) | IDs of the created public subnets |

examples/existing-ips/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ module "subnets" {
2525

2626
availability_zones = var.availability_zones
2727
vpc_id = module.vpc.vpc_id
28-
igw_id = module.vpc.igw_id
29-
cidr_block = module.vpc.vpc_cidr_block
30-
nat_elastic_ips = [for az, eip in aws_eip.nat_ips : eip.public_ip]
28+
igw_id = [module.vpc.igw_id]
29+
cidr_block = [module.vpc.vpc_cidr_block]
30+
nat_elastic_ips = aws_eip.nat_ips.*.public_ip
3131
nat_gateway_enabled = true
3232
nat_instance_enabled = false
3333

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ resource "aws_eip" "default" {
201201
lifecycle {
202202
create_before_destroy = true
203203
}
204+
#bridgecrew:skip=BC_AWS_NETWORKING_48: Skipping requirement for EIPs to be attached to EC2 instances because we are attaching to NAT Gateway.
204205
}
205206

206207
module "utils" {

nat-instance.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ resource "aws_instance" "nat_instance" {
9393

9494
#bridgecrew:skip=BC_AWS_PUBLIC_12: Skipping `EC2 Should Not Have Public IPs` check. NAT instance requires public IP.
9595
#bridgecrew:skip=BC_AWS_GENERAL_31: Skipping `Ensure Instance Metadata Service Version 1 is not enabled` check until BridgeCrew support condition evaluation. See https://github.com/bridgecrewio/checkov/issues/793
96+
#bridgecrew:skip=BC_AWS_LOGGING_26: Skipping requirement for detailed monitoring of NAT instance.
9697
associate_public_ip_address = true #tfsec:ignore:AWS012
9798

9899
lifecycle {
@@ -116,6 +117,8 @@ resource "aws_instance" "nat_instance" {
116117
cpu_credits = var.nat_instance_cpu_credits_override
117118
}
118119
}
120+
121+
ebs_optimized = true
119122
}
120123

121124
resource "aws_eip_association" "nat_instance" {

outputs.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ output "private_route_table_ids" {
5151
}
5252

5353
output "public_network_acl" {
54-
value = local.public_open_network_acl_enabled ? aws_network_acl.public[0].id : null
54+
description = "ID of the Network ACL created for public subnets"
55+
value = local.public_open_network_acl_enabled ? aws_network_acl.public[0].id : null
5556
}
5657

5758
output "private_network_acl" {
58-
value = local.private_open_network_acl_enabled ? aws_network_acl.private[0].id : null
59+
description = "ID of the Network ACL created for private subnets"
60+
value = local.private_open_network_acl_enabled ? aws_network_acl.private[0].id : null
5961
}
6062

6163
output "nat_gateway_ids" {

public.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ resource "aws_subnet" "public" {
2323
ipv6_cidr_block = local.ipv6_enabled ? element(local.ipv6_public_subnet_cidrs, count.index) : null
2424
ipv6_native = local.ipv6_enabled && !local.ipv4_enabled
2525

26-
26+
#bridgecrew:skip=BC_AWS_NETWORKING_53:Public VPCs should be allowed to default to public IPs
2727
map_public_ip_on_launch = local.ipv4_enabled ? var.map_public_ip_on_launch : null
2828

2929
assign_ipv6_address_on_creation = local.ipv6_enabled ? var.public_assign_ipv6_address_on_creation : null

0 commit comments

Comments
 (0)