--- AWSTemplateFormatVersion: "2010-09-09" Conditions: isUsEast1: !Equals [!Ref "AWS::Region", "us-east-1"] Parameters: CloudformationType: Type: String Default: AWS::EC2::Instance AllowedValues: - AWS::EC2::Instance - AWS::AutoScaling::LaunchConfiguration Resources: AWSIAMRole1: Type: AWS::IAM::Role Condition: - isUsEast1 Properties: AssumeRolePolicyDocument: {} AWSIAMRole2: Type: AWS::IAM::Role Condition: False Properties: AssumeRolePolicyDocument: {} EC2InstanceOrLaunchConfig: Type: !Ref CloudformationType Properties: InstanceType: t3.nano ImageId: ami-0b90a8636b6f955c1