Created
November 21, 2017 20:56
-
-
Save pbzona/e9a21dc37b3c0019a3f64bb44483cb3c to your computer and use it in GitHub Desktop.
CloudFormation - Declarative code example in YAML
This file contains hidden or 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
Parameters: | |
LargerInstance: | |
Description: Whether a larger instance should be used | |
Default: false | |
Type: String | |
AllowedValues: [true, false] | |
Resources: | |
EC2Instance: | |
Type: AWS::EC2::Instance | |
Properties: | |
InstanceType: | |
!If [UseLargerInstance, m4.large, t2.micro] | |
KeyName: 'default' # keypair must already exist | |
ImageId: ami-8c1be5f6 # AMI us-east-1 | |
Conditions: | |
UseLargerInstance: !Equals [true, !Ref LargerInstance] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment