-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updating main.tf and adding to locals.tf to resolve ipv6 error (#132)
* updating main.tf and adding to locals.tf to resolve ipv6 error\ * reverting the ipv4 blocks back to previous to ensure empty string error isnt masked * added null validator to the ipv4 block as well
- Loading branch information
Showing
2 changed files
with
7 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
locals { | ||
name_prefix = var.bastion_launch_template_name | ||
security_group = join("", flatten([aws_security_group.bastion_host_security_group[*].id, var.bastion_security_group_id])) | ||
|
||
// the compact() function checks for null values and gets rid of them | ||
// the length is a check to ensure we dont have an empty array, as an empty array would throw an error for the cidr_block argument | ||
ipv4_cidr_block = length(compact(data.aws_subnet.subnets[*].cidr_block)) == 0 ? null : concat(data.aws_subnet.subnets[*].cidr_block, var.cidrs) | ||
ipv6_cidr_block = length(compact(data.aws_subnet.subnets[*].ipv6_cidr_block)) == 0 ? null : concat(data.aws_subnet.subnets[*].ipv6_cidr_block, var.ipv6_cidrs) | ||
} | ||
|
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