lib/sumomo/ec2.rb in sumomo-0.8.22 vs lib/sumomo/ec2.rb in sumomo-0.9.0

- old
+ new

@@ -275,11 +275,11 @@ if ami_name.nil? @ami_lookup_resources ||= {} unless @ami_lookup_resources[type] - @ami_lookup_resources[type] = make 'Custom::AMILookup' do + @ami_lookup_resources[type] = make 'Custom::AMILookup', name: "#{name}AmiLookup" do InstanceType type end end ami_name = @ami_lookup_resources[type] @@ -333,18 +333,18 @@ unless ingress.is_a? Array raise 'ec2: ingress option needs to be an array' end raise 'ec2: egress option needs to be an array' unless egress.is_a? Array - web_sec_group = make 'AWS::EC2::SecurityGroup' do + web_sec_group = make 'AWS::EC2::SecurityGroup', name: "#{name}SecurityGroup" do GroupDescription "Security group for layer: #{layer}" SecurityGroupIngress ingress SecurityGroupEgress egress VpcId network.vpc end - wait_handle = make 'AWS::CloudFormation::WaitConditionHandle' + wait_handle = make 'AWS::CloudFormation::WaitConditionHandle', name: "#{name}WaitConditionHandle" user_data = initscript(wait_handle, name, call('Fn::Join', "\n", script_arr)) role_policy_doc = { 'Version' => '2012-10-17', @@ -353,11 +353,11 @@ 'Principal' => { 'Service' => ['ec2.amazonaws.com'] }, 'Action' => ['sts:AssumeRole'] }] } - asg_role = make 'AWS::IAM::Role' do + asg_role = make 'AWS::IAM::Role', name: "#{name}Role" do AssumeRolePolicyDocument role_policy_doc Path '/' Policies [{ 'PolicyName' => 'root', 'PolicyDocument' => { @@ -402,15 +402,15 @@ }] + policies } }] end - asg_profile = make 'AWS::IAM::InstanceProfile' do + asg_profile = make 'AWS::IAM::InstanceProfile', name: "#{name}InstanceProfile" do Path '/' Roles [asg_role] end - launch_config = make 'AWS::AutoScaling::LaunchConfiguration' do + launch_config = make 'AWS::AutoScaling::LaunchConfiguration', name: "#{name}LaunchConfiguration" do AssociatePublicIpAddress has_public_ips KeyName keypair SecurityGroups [web_sec_group] + security_groups ImageId ami_name UserData user_data