Commit e418582a authored by Daisuke Fujita's avatar Daisuke Fujita

Include group id to sg module name

parent 907543f8
......@@ -47,7 +47,7 @@ module Terraforming
private
def module_name_of(security_group)
normalize_module_name(security_group.group_name)
normalize_module_name("#{security_group.group_id}-#{security_group.group_name}")
end
def security_groups
......
......@@ -82,7 +82,7 @@ module Terraforming
describe ".tf" do
it "should generate tf" do
expect(described_class.tf(client)).to eq <<-EOS
resource "aws_security_group" "hoge" {
resource "aws_security_group" "sg-1234abcd-hoge" {
name = "hoge"
description = "Group for hoge"
owner_id = "012345678901"
......@@ -105,7 +105,7 @@ resource "aws_security_group" "hoge" {
}
resource "aws_security_group" "fuga" {
resource "aws_security_group" "sg-5678efgh-fuga" {
name = "fuga"
description = "Group for fuga"
owner_id = "098765432109"
......@@ -146,7 +146,7 @@ resource "aws_security_group" "fuga" {
],
"outputs" => {},
"resources" => {
"aws_security_group.hoge" => {
"aws_security_group.sg-1234abcd-hoge" => {
"type" => "aws_security_group",
"primary" => {
"id" => "sg-1234abcd",
......@@ -161,7 +161,7 @@ resource "aws_security_group" "fuga" {
}
}
},
"aws_security_group.fuga" => {
"aws_security_group.sg-5678efgh-fuga" => {
"type" => "aws_security_group",
"primary" => {
"id" => "sg-5678efgh",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment