1
votes

I tried to build ec2 instance using below code, I am getting error stating "The requested configuration is currently not supported (Service: AmazonEC2; Status Code: 400; Error Code: Unsupported; Request ID: 82c6f0ac-dc18-4f8f-ae21-0ea1558946a4; Proxy: null)"

Please assist:

{
"Parameters": {
    "InstanceType": {
        "Type": "String"
    },
    "KeyName": {
        "Description": "AWS::EC2::KeyPair::KeyName",
        "Type": "String"
    }
},
"Resources": {
    "MyEC2Instance": {
        "Type": "AWS::EC2::Instance",
        "Properties": {
            "ImageId": "ami-0476b0c0bd036545d",
            "KeyName": {
                "Ref": "KeyName"
            },
            "BlockDeviceMappings": [
                {
                    "DeviceName": "/dev/sdm",
                    "Ebs": {
                        "VolumeType": "io1",
                        "Iops": "200",
                        "DeleteOnTermination": "false",
                        "VolumeSize": "20"
                    }
                },
                {
                    "DeviceName": "/dev/sdk",
                    "NoDevice": {}
                }
            ]
        }
    }
}

}

1

1 Answers

0
votes

Your template is working fine (but I had to change AMI). So please double check your AMI for your region and instance architecture:

{
"Parameters": {
    "InstanceType": {
        "Type": "String",
        "Default": "t2.micro"
    },
    "KeyName": {
        "Description": "KeyName",
        "Type": "AWS::EC2::KeyPair::KeyName"
    }
},
"Resources": {
    "MyEC2Instance": {
        "Type": "AWS::EC2::Instance",
        "Properties": {
            "ImageId": "ami-0476b0c0bd036545d",
            "KeyName": {
                "Ref": "KeyName"
            },
            "BlockDeviceMappings": [
                {
                    "DeviceName": "/dev/sdm",
                    "Ebs": {
                        "VolumeType": "io1",
                        "Iops": "200",
                        "DeleteOnTermination": "false",
                        "VolumeSize": "20"
                    }
                },
                {
                    "DeviceName": "/dev/sdk",
                    "NoDevice": {}
                }
            ]
        }
    }
}

}