title: CloudFormation template fails with error "Service: AmazonEC2; Status Code: 400; Error Code: Unsupported"
body: <p>I have created CloudFormaton Template with below resources</p>
  <pre><code>---
  Resources: 
    InsuranceVPC:
      Type: AWS::EC2::VPC
      Properties:
        CidrBlock: 11.0.0.0/16
        EnableDnsSupport: 'false'
        EnableDnsHostnames: 'false'
        InstanceTenancy: dedicated
        Tags:
         - Key: work
           Value: insurance
         - Key: name
           Value: InsuranceVPC
  
    InsuranceInternetGateway:
      Type: AWS::EC2::InternetGateway
      Properties:
        Tags:
        - Key: work
          Value: insurance
        - Key: name
          Value: InsuranceInternetGateway
  
    InsuranceSubnet:
      Type: AWS::EC2::Subnet
      Properties:
        VpcId:
          Ref: InsuranceVPC
        CidrBlock: 11.0.2.0/24
        AvailabilityZone: &quot;ap-south-1a&quot;
        Tags:
        - Key: work
          Value: insurance
        - Key: name
          Value: InsuranceSubnet
  
    AttachGateway:
      Type: AWS::EC2::VPCGatewayAttachment
      Properties:
        VpcId:
           Ref: InsuranceVPC
        InternetGatewayId:
           Ref: InsuranceInternetGateway
  
    Ec2Instance: 
      Type: AWS::EC2::Instance
      Properties: 
        ImageId: &quot;ami-0732b62d310b80e97&quot;
        InstanceType: &quot;t2.medium&quot;
        KeyName: &quot;DevOpsAutomation&quot;
        NetworkInterfaces: 
          - AssociatePublicIpAddress: &quot;true&quot;
            DeviceIndex: &quot;0&quot;
            GroupSet: 
              - Ref: &quot;InsuranceSecurityGroup&quot;
            SubnetId: 
              Ref: &quot;InsuranceSubnet&quot;
  
    InsuranceSecurityGroup:
      Type: AWS::EC2::SecurityGroup
      Properties:
          GroupDescription: Allow http and ssh to client host
          VpcId:
             Ref: InsuranceVPC
          SecurityGroupIngress:
          - IpProtocol: tcp
            FromPort: 80
            ToPort: 80
            CidrIp: 0.0.0.0/0
          - IpProtocol: tcp
            FromPort: 22
            ToPort: 22
            CidrIp: 0.0.0.0/0
          SecurityGroupEgress:
          - IpProtocol: tcp
            FromPort: 80
            ToPort: 80
            CidrIp: 0.0.0.0/0
  </code></pre>
  <p>All resources creations are successful except EC2Instance which fails with below error:</p>
  <p><code>The requested configuration is currently not supported. Please check the documentation for supported configurations. (Service: AmazonEC2; Status Code: 400; Error Code: Unsupported; Request ID: a59a2d39-3aa9-4f7b-9cbd-db05dca0d61e)</code></p>
  <p><code>The following resource(s) failed to create: [Ec2Instance]. . Rollback requested by use</code></p>
  <p>What I have checked:</p>
  <ol>
  <li>The ImageID and InstanceType exist in the same region (or AZ)</li>
  <li>All other objects and its dependencies are met</li>
  <li>though I understand I haven't yet created route table, route entries but that shouldn't affect EC2 instance resource creation</li>
  <li>I am privileged user to create resources.</li>
  </ol>
  <p>Please help or guide what I am missing here</p>