@@ -21,6 +21,13 @@ Parameters:
2121 m5.large, m5.xlarge, m5.2large, m5.4xlarge, m5.12xlarge, m5.24large,
2222 c5.large, c5.xlarge, c5.2xlarge, c5.4xlarge, c5.9xlarge, c5.18xlarge,
2323 r5.large, r5.xlarge, r5.2xlarge, r5.4xlarge, r5.12xlarge, r5.24xlarge ]
24+ Ec2AmiId :
25+ Description : AMI Id for EC2 Instance (Use amazon ECS optimized AMI only)
26+ Type : AWS::EC2::Image::Id
27+ Default : ami-0b22c910bce7178b6
28+ KeyPair :
29+ Description : KeyPair name to SSH into Instance
30+ Type : AWS::EC2::KeyPair::KeyName
2431
2532
2633
@@ -51,8 +58,8 @@ Resources:
5158 AutoScalingGroupLaunchConfiguration :
5259 Type : AWS::AutoScaling::LaunchConfiguration
5360 Properties :
54- KeyName : ecs-poc
55- ImageId : ami-07a63940735aebd38
61+ KeyName : !Ref KeyPair
62+ ImageId : !Ref Ec2AmiId
5663 InstanceType : !Ref Ec2InstanceType
5764 IamInstanceProfile : ecsInstanceRole
5865 SecurityGroups :
@@ -62,9 +69,8 @@ Resources:
6269 Fn::Base64 :
6370 Fn::Sub :
6471 - |
65- #!/bin/bash -xe
72+ #!/bin/bash
6673 echo ECS_CLUSTER=${ECSCluster} >> /etc/ecs/ecs.config
67- yum install -y aws-cfn-bootstrap
6874 - { ECSCluster: !Ref Cluster }
6975
7076Outputs :
0 commit comments