Created
May 16, 2022 06:27
-
-
Save srcecde/07c912778040c9ecbada6d8bbdec3de9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: "2010-09-09" | |
Description: "Create EC2 instance | FindInMap" | |
Parameters: | |
Environment: | |
Type: String | |
AllowedValues: | |
- dev | |
- prod | |
- qa | |
Mappings: | |
EnvMap: #logical id/map name | |
dev: | |
instanceType: "t2.large" | |
name: "dev" | |
qa: | |
instanceType: "t2.medium" | |
name: "qa" | |
prod: | |
instanceType: "t2.xlarge" | |
name: "prod" | |
Resources: | |
Instance: #logical id/name | |
Type: AWS::EC2::Instance | |
Properties: | |
InstanceType: !FindInMap [EnvMap, !Ref Environment, instanceType] | |
ImageId: ami-0dba2cb6798deb6d8 | |
Tags: | |
- Key: "Name" | |
Value: !FindInMap [EnvMap, !Ref Environment, name] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment