Last active
May 27, 2022 15:43
-
-
Save JamesAtIntegratnIO/8dc16140a7c9eb2337ebc1e7878053fb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| name = { | |
| "example-pods" = "10.1.1.0/18" | |
| "example-services" = "10.1.2.0/23" | |
| } |
This file contains hidden or 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
| locals { | |
| secondary_ip_range = [ | |
| { | |
| range_name = "example-pods" | |
| ip_cidr_range = "10.1.1.0/18" | |
| }, | |
| { | |
| range_name = "example-services" | |
| ip_cidr_range = "10.1.2.0/23" | |
| } | |
| ] | |
| } | |
| output "name" { | |
| value = { for r in local.secondary_ip_range : r.range_name => r.ip_cidr_range } | |
| } |
This file contains hidden or 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
| secondary_ip_ranges = { | |
| "example-pods" = { | |
| "ip_cidr_range" = "10.1.1.0/18" | |
| "name" = "example-pods" | |
| } | |
| "example-services" = { | |
| "ip_cidr_range" = "10.1.2.0/23" | |
| "name" = "example-services" | |
| } | |
| } |
This file contains hidden or 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
| locals { | |
| secondary_ip_range = [ | |
| { | |
| range_name = "example-pods" | |
| ip_cidr_range = "10.1.1.0/18" | |
| }, | |
| { | |
| range_name = "example-services" | |
| ip_cidr_range = "10.1.2.0/23" | |
| } | |
| ] | |
| } | |
| // loop through secondary_ip_range and output zipmap the range_name and ip_cidr_range as a map | |
| output "secondary_ip_ranges" { | |
| value = { for k in local.secondary_ip_range : k.range_name => { | |
| "name" = k.range_name, | |
| "ip_cidr_range" = k.ip_cidr_range | |
| } } | |
| } | |
This file contains hidden or 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
| name = [ | |
| "10.1.1.0/18", | |
| "10.1.2.0/23", | |
| ] |
This file contains hidden or 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
| locals { | |
| secondary_ip_range = [ | |
| { | |
| range_name = "example-pods" | |
| ip_cidr_range = "10.1.1.0/18" | |
| }, | |
| { | |
| range_name = "example-services" | |
| ip_cidr_range = "10.1.2.0/23" | |
| } | |
| ] | |
| } | |
| output "name" { | |
| value = [for r in local.secondary_ip_range : r.ip_cidr_range] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment