AWSTemplateFormatVersion: "2010-09-09" Description: AWS CloudFormation workshop - Conditions at property level (uksb-1q9p31idr) (tag:conditions). Parameters: LatestAmiId: Type: AWS::SSM::Parameter::Value Default: /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2 EnvType: Description: Specify the Environment type of the stack. Type: String AllowedValues: - test - prod Default: test ConstraintDescription: Specify either test or prod. Conditions: IsProduction: !Equals - !Ref EnvType - prod Resources: EC2Instance: Type: AWS::EC2::Instance Properties: ImageId: !Ref LatestAmiId InstanceType: !If [IsProduction, t2.small, t2.micro]