Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Changed "tags {" to "tags = {" as required by terraform 0.12 #442

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/terraforming/template/tf/alb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resource "aws_alb" "<%= module_name_of(load_balancer) %>" {
}

<%- end -%>
tags {
tags = {
<% tags.each do |tag| -%>
"<%= tag.key %>" = "<%= tag.value %>"
<% end -%>
Expand Down
4 changes: 2 additions & 2 deletions lib/terraforming/template/tf/dynamo_db.erb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ resource "aws_dynamodb_table" "<%= table.table_name -%>" {
}
<%- end -%>
<%- tags(table).each do |tag| -%>
tags {
tags = {
<%= tag.key %> = "<%= tag.value -%>"
}
<%- end -%>
Expand All @@ -63,4 +63,4 @@ resource "aws_dynamodb_table" "<%= table.table_name -%>" {
}
<%- end -%>
}
<%- end -%>
<%- end -%>
2 changes: 1 addition & 1 deletion lib/terraforming/template/tf/ec2.erb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ resource "aws_instance" "<%= module_name_of(instance) %>" {
<% end -%>

<% end -%>
tags {
tags = {
<% instance.tags.each do |tag| -%>
"<%= tag.key %>" = "<%= tag.value %>"
<% end -%>
Expand Down
2 changes: 1 addition & 1 deletion lib/terraforming/template/tf/elastic_file_system.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "aws_efs_file_system" "<%= module_name_of(efs) %>" {
performance_mode = "<%= efs.performance_mode %>"
<% end -%>
<% if efs.name -%>
tags {
tags = {
Name = "<%= efs.name %>"
}
<% end -%>
Expand Down
2 changes: 1 addition & 1 deletion lib/terraforming/template/tf/elb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ resource "aws_elb" "<%= module_name_of(load_balancer) %>" {
timeout = <%= load_balancer.health_check.timeout %>
}

tags {
tags = {
<% @client.describe_tags(load_balancer_names: [load_balancer.load_balancer_name]).tag_descriptions.first.tags.each do |tag| -%>
"<%= tag.key %>" = "<%= tag.value %>"
<% end -%>
Expand Down
2 changes: 1 addition & 1 deletion lib/terraforming/template/tf/internet_gateway.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
resource "aws_internet_gateway" "<%= module_name_of(internet_gateway) %>" {
vpc_id = "<%= internet_gateway.attachments[0].vpc_id %>"

tags {
tags = {
<% internet_gateway.tags.each do |tag| -%>
"<%= tag.key %>" = "<%= tag.value %>"
<% end -%>
Expand Down
2 changes: 1 addition & 1 deletion lib/terraforming/template/tf/network_acl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ resource "aws_network_acl" "<%= module_name_of(network_acl) %>" {
}

<% end -%>
tags {
tags = {
<% network_acl.tags.each do |tag| -%>
"<%= tag.key %>" = "<%= tag.value %>"
<% end -%>
Expand Down
2 changes: 1 addition & 1 deletion lib/terraforming/template/tf/network_interface.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resource "aws_network_interface" "<%= module_name_of(network_interface) %>" {
}
<% end -%>
<% if network_interface.tag_set.length > 0 -%>
tags {
tags = {
<% network_interface.tag_set.each do |tag| -%>
"<%= tag.key %>" = "<%= tag.value %>"
<% end -%>
Expand Down
2 changes: 1 addition & 1 deletion lib/terraforming/template/tf/route53_zone.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "aws_route53_zone" "<%= module_name_of(hosted_zone) %>" {
vpc_region = "<%= vpc.vpc_region %>"
<%- end -%>

tags {
tags = {
<% tags_of(hosted_zone).each do |tag| -%>
"<%= tag.key %>" = "<%= tag.value %>"
<% end -%>
Expand Down
2 changes: 1 addition & 1 deletion lib/terraforming/template/tf/route_table.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ resource "aws_route_table" "<%= module_name_of(route_table) %>" {
propagating_vgws = <%= propagaving_vgws_of(route_table).inspect %>

<% end -%>
tags {
tags = {
<% route_table.tags.each do |tag| -%>
"<%= tag.key %>" = "<%= tag.value %>"
<% end -%>
Expand Down
2 changes: 1 addition & 1 deletion lib/terraforming/template/tf/security_group.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ resource "aws_security_group" "<%= module_name_of(security_group) %>" {

<% end -%>
<% if security_group.tags.length > 0 -%>
tags {
tags = {
<% security_group.tags.each do |tag| -%>
"<%= tag.key %>" = "<%= tag.value %>"
<% end -%>
Expand Down
2 changes: 1 addition & 1 deletion lib/terraforming/template/tf/subnet.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resource "aws_subnet" "<%= module_name_of(subnet) %>" {
availability_zone = "<%= subnet.availability_zone %>"
map_public_ip_on_launch = <%= subnet.map_public_ip_on_launch %>

tags {
tags = {
<% subnet.tags.each do |tag| -%>
"<%= tag.key %>" = "<%= tag.value %>"
<% end -%>
Expand Down
2 changes: 1 addition & 1 deletion lib/terraforming/template/tf/vpc.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resource "aws_vpc" "<%= module_name_of(vpc) %>" {
enable_dns_support = <%= enable_dns_support?(vpc) %>
instance_tenancy = "<%= vpc.instance_tenancy %>"

tags {
tags = {
<% vpc.tags.each do |tag| -%>
"<%= tag.key %>" = "<%= tag.value %>"
<% end -%>
Expand Down
2 changes: 1 addition & 1 deletion lib/terraforming/template/tf/vpn_gateway.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
resource "aws_vpn_gateway" "<%= module_name_of(vpn_gateway) %>" {
vpc_id = "<%= vpn_gateway.vpc_attachments[0].vpc_id %>"
availability_zone = "<%= vpn_gateway.availability_zone %>"
tags {
tags = {
<% vpn_gateway.tags.each do |tag| -%>
"<%= tag.key %>" = "<%= tag.value %>"
<% end -%>
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/terraforming/resource/alb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ module Resource
prefix = "hoge"
}

tags {
tags = {
"Environment" = "Production"
}
}
Expand All @@ -128,7 +128,7 @@ module Resource

enable_deletion_protection = true

tags {
tags = {
}
}

Expand Down
2 changes: 1 addition & 1 deletion spec/lib/terraforming/resource/dynamo_db_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ module Resource
projection_type = "INCLUDE"
non_key_attributes = ["fghi", "jklm"]
}
tags {
tags = {
abcd = "efgh"
}
stream_enabled = true
Expand Down
6 changes: 3 additions & 3 deletions spec/lib/terraforming/resource/ec2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ module Resource
iops = 24
}

tags {
tags = {
"Name" = "hoge"
}
}
Expand All @@ -357,7 +357,7 @@ module Resource
delete_on_termination = true
}

tags {
tags = {
}
}

Expand All @@ -373,7 +373,7 @@ module Resource
private_ip = "10.0.0.102"
source_dest_check = true

tags {
tags = {
}
}

Expand Down
4 changes: 2 additions & 2 deletions spec/lib/terraforming/resource/efs_file_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ module Resource
creation_token = "console-1234abcd-1234-abcd-a123-d34db33f0000"
file_system_id = "fs-0000abcd"
performance_mode = "generalPurpose"
tags {
tags = {
Name = "efs_name_0"
}
}
resource "aws_efs_file_system" "fs-abcd1234" {
creation_token = "console-0000abcd-4321-dcba-a123-d34db33f0000"
file_system_id = "fs-abcd1234"
performance_mode = "generalPurpose"
tags {
tags = {
Name = "efs_name_1"
}
}
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/terraforming/resource/elb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ module Resource
timeout = 5
}

tags {
tags = {
"name" = "elb-1"
}
}
Expand Down Expand Up @@ -242,7 +242,7 @@ module Resource
timeout = 5
}

tags {
tags = {
"name" = "elb-1"
}
}
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/terraforming/resource/internet_gateway_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ module Resource
resource "aws_internet_gateway" "igw-1234abcd" {
vpc_id = "vpc-1234abcd"

tags {
tags = {
}
}

resource "aws_internet_gateway" "test" {
vpc_id = "vpc-5678efgh"

tags {
tags = {
"Name" = "test"
}
}
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/terraforming/resource/network_acl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ module Resource
cidr_block = "0.0.0.0/0"
}

tags {
tags = {
"Name" = "hoge"
}
}
Expand Down Expand Up @@ -178,7 +178,7 @@ module Resource
icmp_type = "4"
}

tags {
tags = {
"Name" = "fuga"
}
}
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/terraforming/resource/network_interface_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ module Resource
instance = "i-12345678"
device_index = 0
}
tags {
tags = {
"Name" = "fuga"
}
}
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/terraforming/resource/route53_zone_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ module Resource
name = "hoge.net"
comment = ""

tags {
tags = {
"Environment" = "dev"
}
}
Expand All @@ -100,7 +100,7 @@ module Resource
vpc_id = "vpc-1234abcd"
vpc_region = "ap-northeast-1"

tags {
tags = {
"Environment" = "dev"
}
}
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/terraforming/resource/route_table_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ module Resource

propagating_vgws = ["vgw-1a4j20b"]

tags {
tags = {
"Name" = "my-route-table"
}
}
Expand All @@ -166,7 +166,7 @@ module Resource
gateway_id = "vgw-2345cdef"
}

tags {
tags = {
"Name" = "my-route-table-2"
}
}
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/terraforming/resource/security_group_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ module Resource
self = true
}

tags {
tags = {
"Name" = "fuga"
}
}
Expand Down Expand Up @@ -299,7 +299,7 @@ module Resource
ipv6_cidr_blocks = ["::/0"]
}

tags {
tags = {
"Name" = "piyo"
}
}
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/terraforming/resource/subnet_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module Resource
availability_zone = "ap-northeast-1c"
map_public_ip_on_launch = false

tags {
tags = {
"Name" = "hoge"
}
}
Expand All @@ -62,7 +62,7 @@ module Resource
availability_zone = "ap-northeast-1c"
map_public_ip_on_launch = false

tags {
tags = {
"Name" = "fuga"
}
}
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/terraforming/resource/vpc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module Resource
enable_dns_support = true
instance_tenancy = "default"

tags {
tags = {
"Name" = "hoge"
}
}
Expand All @@ -74,7 +74,7 @@ module Resource
enable_dns_support = true
instance_tenancy = "default"

tags {
tags = {
"Name" = "fuga"
}
}
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/terraforming/resource/vpn_gateway_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ module Resource
resource "aws_vpn_gateway" "vgw-1234abcd" {
vpc_id = "vpc-1234abcd"
availability_zone = "us-east-1c"
tags {
tags = {
}
}

resource "aws_vpn_gateway" "test" {
vpc_id = "vpc-5678efgh"
availability_zone = "us-east-1d"
tags {
tags = {
"Name" = "test"
}
}
Expand Down