diff options
| author | Andrew Peabody <apeabody@gmail.com> | 2019-08-19 20:04:00 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-19 20:04:00 -0700 |
| commit | 7d7f6cc9d947c57e4b3d26f0099491ee8fe08c19 (patch) | |
| tree | 0e9ed4e87eb125cdaf344392936494eb929d6c03 | |
| parent | 793197ba6b65f12ae2c02a86a4010cf659c90eb6 (diff) | |
Programmatically retrieve ECS AMI
Update cf.yaml to programmatically retrieve Amazon ECS-Optimized AMI
-https://docs.aws.amazon.com/AmazonECS/latest/developerguide/retrieve-ecs-optimized_AMI.html
| -rw-r--r-- | cf.yml | 46 |
1 files changed, 6 insertions, 40 deletions
@@ -2,6 +2,11 @@ AWSTemplateFormatVersion: "2010-09-09" Description: Factorio Spot Price Server via Docker / ECS
Parameters:
+ ECSAMI:
+ Description: AWS ECS AMI ID
+ Type: AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>
+ Default: /aws/service/ecs/optimized-ami/amazon-linux-2/recommended/image_id
+
FactorioImageTag:
Type: String
Description: "(Examples include latest, stable, 0.17, 0.17.33) Refer to tag descriptions available here: https://hub.docker.com/r/factoriotools/factorio/)"
@@ -103,45 +108,6 @@ Conditions: Mappings:
- Region:
- 'us-east-2':
- ImageId: ami-0dca97e7cde7be3d5
- 'us-east-1':
- ImageId: ami-0fac5486e4cff37f4
- 'us-west-1':
- ImageId: ami-0c6e63b58aac1048e
- 'us-west-2':
- ImageId: ami-0e5e051fd0b505db6
- 'ap-east-1':
- ImageId: ami-02252d984c7e3595d
- 'ap-northeast-1':
- ImageId: ami-04a735b489d2a0320
- 'ap-northeast-2':
- ImageId: ami-0accbb5aa909be7bf
- 'ap-south-1':
- ImageId: ami-0a8bf4e187339e2c1
- 'ap-southeast-1':
- ImageId: ami-05c6d22d98f97471c
- 'ap-southeast-2':
- ImageId: ami-039bb4c3a7946ce19
- 'ca-central-1':
- ImageId: ami-01c07ee95e77abba8
- 'eu-central-1':
- ImageId: ami-0650e7d86452db33b
- 'eu-north-1':
- ImageId: ami-059aa04f0c253ad6b
- 'eu-west-1':
- ImageId: ami-0ae254c8a2d3346a7
- 'eu-west-2':
- ImageId: ami-0de1dc478496a9e9b
- 'eu-west-3':
- ImageId: ami-0d260f3e5ccd06043
- 'sa-east-1':
- ImageId: ami-038707d64e5b8e7ba
- 'us-gov-east-1':
- ImageId: ami-0a224902b35f8ad6c
- 'us-gov-west-1':
- ImageId: ami-04c68165
ServerState:
Running:
AutoScalingCapacity: 1
@@ -287,7 +253,7 @@ Resources: Properties:
AssociatePublicIpAddress: true
IamInstanceProfile: !Ref InstanceProfile
- ImageId: !FindInMap [ Region, !Ref 'AWS::Region', ImageId ]
+ ImageId: !Ref ECSAMI
InstanceType: !Ref InstanceType
KeyName:
!If [ KeyPairNameProvided, !Ref KeyPairName, !Ref 'AWS::NoValue' ]
|
