Skip to content

Commit

Permalink
Merge pull request #36 from unifio/yl-wip
Browse files Browse the repository at this point in the history
fix for 0.3.7
  • Loading branch information
yuhunglin authored Aug 7, 2018
2 parents 8dda436 + f02668d commit a01d3d0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
14 changes: 6 additions & 8 deletions az/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ locals {
nat_gateways_not_enabled_check = "${var.nat_gateways_enabled != "true" ? 1 : 0}"

# default subnet tags
default_subnet_tags = [
{
application = "${var.stack_item_fullname}"
managed_by = "terraform"
},
]
default_subnet_tags = {
application = "${var.stack_item_fullname}"
managed_by = "terraform"
}
}

## Provisions DMZ resources
Expand All @@ -69,7 +67,7 @@ resource "aws_subnet" "dmz" {
map_public_ip_on_launch = "${var.enable_dmz_public_ips}"
vpc_id = "${var.vpc_id}"

tags = "${concat(local.default_subnet_tags, var.additional_subnet_tags, list(map("Name", "${var.stack_item_label}-dmz-${count.index}")))}"
tags = "${merge(local.default_subnet_tags, var.additional_subnet_tags, map("Name", "${var.stack_item_label}-dmz-${count.index}"))}"
}

### Associates subnet with routing table
Expand Down Expand Up @@ -193,7 +191,7 @@ resource "aws_subnet" "lan" {
cidr_block = "${local.lan_cidrs_override_enabled == "true" ? element(var.lan_cidrs_override,count.index) : cidrsubnet(data.aws_vpc.base.cidr_block,lookup(var.az_cidrsubnet_newbits, local.azs_provisioned_count * local.lans_multiplier),count.index + lookup(var.az_cidrsubnet_offset, local.azs_provisioned_count))}"
vpc_id = "${var.vpc_id}"

tags = "${concat(local.default_subnet_tags, var.additional_subnet_tags, list(map("Name", "${var.stack_item_label}-lan-${count.index}")))}"
tags = "${merge(local.default_subnet_tags, var.additional_subnet_tags, map("Name", "${var.stack_item_label}-lan-${count.index}"))}"
}

### Provisions routing table
Expand Down
6 changes: 3 additions & 3 deletions az/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ variable "stack_item_label" {
}

variable "additional_subnet_tags" {
type = "list"
description = "Additional subnet to apply at the subnet level, if any"
default = []
type = "map"
description = "Additional tags to apply at the subnet level, if any"
default = {}
}

## VPC parameters
Expand Down
14 changes: 6 additions & 8 deletions base/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ terraform {
locals {
default_instance_tenancy = "${length(var.instance_tenancy) >= 1 ? "${var.instance_tenancy}" : "default"}"

default_vpc_tags = [
{
application = "${var.stack_item_fullname}"
managed_by = "terraform"
Name = "${var.stack_item_label}-vpc"
},
]
default_vpc_tags = {
application = "${var.stack_item_fullname}"
managed_by = "terraform"
Name = "${var.stack_item_label}-vpc"
}
}

## Provisions Virtual Private Cloud (VPC)
Expand All @@ -28,7 +26,7 @@ resource "aws_vpc" "vpc" {
enable_classiclink_dns_support = "${var.enable_classiclink_dns_support}"
assign_generated_ipv6_cidr_block = "${var.assign_generated_ipv6_cidr_block}"

tags = "${concat(local.default_vpc_tags, var.additional_vpc_tags)}"
tags = "${merge(local.default_vpc_tags, var.additional_vpc_tags)}"
}

## Provisions Internet gateways
Expand Down
4 changes: 2 additions & 2 deletions base/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ variable "stack_item_label" {
}

variable "additional_vpc_tags" {
type = "list"
type = "map"
description = "Additional tags to apply at the VPC level, if any"
default = []
default = {}
}

## VPC parameters
Expand Down

0 comments on commit a01d3d0

Please sign in to comment.