Skip to content

Commit

Permalink
feat: add vpc tags for resources and prefix fix (#50)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Geiger <ageiger@us.ibm.com>
  • Loading branch information
argeiger and argeiger authored Aug 2, 2022
1 parent 7205005 commit 6e3ab14
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dynamic_values/address_prefixes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module "prefix_map" {
{
zone_name = zone
addresses = [
for address in(lookup(var.address_prefixes, zone, null) == null ? [] : var.address_prefixes[zone]) :
for address in(var.address_prefixes != null ? lookup(var.address_prefixes, zone, null) == null ? [] : var.address_prefixes[zone] : []) :
{
name = "${var.prefix}-${zone}-${index(var.address_prefixes[zone], address) + 1}"
cidr = address
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ resource "ibm_is_public_gateway" "gateway" {
vpc = ibm_is_vpc.vpc.id
resource_group = var.resource_group_id
zone = each.value
tags = var.tags
}

##############################################################################
1 change: 1 addition & 0 deletions subnet.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ resource "ibm_is_subnet" "subnet" {
ipv4_cidr_block = length(keys(local.address_prefixes)) == 0 ? ibm_is_vpc_address_prefix.subnet_prefix[each.value.prefix_name].cidr : each.value.cidr
network_acl = ibm_is_network_acl.network_acl[each.value.acl].id
public_gateway = each.value.public_gateway
tags = var.tags
depends_on = [ibm_is_vpc_address_prefix.address_prefixes]
}

Expand Down

0 comments on commit 6e3ab14

Please sign in to comment.