{
    "ResponseMetadata": {
        "RequestId": "4ca8b6a8-bc40-11e2-95ee-bd3eac9f6692"
    }, 
    "TemplateBody": {
        "Description": "AWS CloudFormation Sample Template EC2WithEBSSample: Create an Amazon EC2 instance running the Amazon Linux AMI with a new EBS volume attached. The instance and the volume are pinned to the same availability zone. We recommend that you do untargeted launches rather than pinning instances this way.The AMI is chosen based on the region in which the stack is run. **WARNING** This template creates an Amazon EC2 instance and an EBS Volume. You will be billed for the AWS resources used if you create a stack from this template.", 
        "Parameters": {
            "SSHLocation": {
                "ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x.", 
                "Description": "The IP address range that can be used to SSH to the EC2 instances", 
                "Default": "0.0.0.0/0", 
                "MinLength": "9", 
                "AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})", 
                "MaxLength": "18", 
                "Type": "String"
            }, 
            "KeyName": {
                "Type": "String", 
                "Description": "Name of an existing EC2 KeyPair to enable SSH access to the instance"
            }
        }, 
        "AWSTemplateFormatVersion": "2010-09-09", 
        "Outputs": {
            "InstanceId": {
                "Description": "InstanceId of the newly created EC2 instance", 
                "Value": {
                    "Ref": "Ec2Instance"
                }
            }, 
            "PublicIP": {
                "Description": "Public IP address of the newly created EC2 instance", 
                "Value": {
                    "Fn::GetAtt": [
                        "Ec2Instance", 
                        "PublicIp"
                    ]
                }
            }, 
            "PublicDNS": {
                "Description": "Public DNSName of the newly created EC2 instance", 
                "Value": {
                    "Fn::GetAtt": [
                        "Ec2Instance", 
                        "PublicDnsName"
                    ]
                }
            }
        }, 
        "Resources": {
            "InstanceSecurityGroup": {
                "Type": "AWS::EC2::SecurityGroup", 
                "Properties": {
                    "SecurityGroupIngress": [
                        {
                            "ToPort": "22", 
                            "IpProtocol": "tcp", 
                            "CidrIp": {
                                "Ref": "SSHLocation"
                            }, 
                            "FromPort": "22"
                        }
                    ], 
                    "GroupDescription": "Enable SSH access via port 22"
                }
            }, 
            "Ec2Instance": {
                "Type": "AWS::EC2::Instance", 
                "Properties": {
                    "KeyName": {
                        "Ref": "KeyName"
                    }, 
                    "AvailabilityZone": {
                        "Fn::FindInMap": [
                            "RegionMap", 
                            {
                                "Ref": "AWS::Region"
                            }, 
                            "TestAz"
                        ]
                    }, 
                    "SecurityGroups": [
                        {
                            "Ref": "InstanceSecurityGroup"
                        }
                    ], 
                    "Volumes": [
                        {
                            "Device": "/dev/sdk", 
                            "VolumeId": {
                                "Ref": "NewVolume"
                            }
                        }
                    ], 
                    "ImageId": {
                        "Fn::FindInMap": [
                            "RegionMap", 
                            {
                                "Ref": "AWS::Region"
                            }, 
                            "AMI"
                        ]
                    }
                }
            }, 
            "NewVolume": {
                "Type": "AWS::EC2::Volume", 
                "Properties": {
                    "AvailabilityZone": {
                        "Fn::FindInMap": [
                            "RegionMap", 
                            {
                                "Ref": "AWS::Region"
                            }, 
                            "TestAz"
                        ]
                    }, 
                    "Size": "100"
                }
            }
        }, 
        "Mappings": {
            "RegionMap": {
                "us-east-1": {
                    "AMI": "ami-7f418316", 
                    "TestAz": "us-east-1a"
                }, 
                "ap-northeast-1": {
                    "AMI": "ami-dcfa4edd", 
                    "TestAz": "ap-northeast-1a"
                }, 
                "sa-east-1": {
                    "AMI": "ami-3e3be423", 
                    "TestAz": "sa-east-1a"
                }, 
                "ap-southeast-1": {
                    "AMI": "ami-74dda626", 
                    "TestAz": "ap-southeast-1a"
                }, 
                "ap-southeast-2": {
                    "AMI": "ami-b3990e89", 
                    "TestAz": "ap-southeast-2a"
                }, 
                "us-west-2": {
                    "AMI": "ami-16fd7026", 
                    "TestAz": "us-west-2a"
                }, 
                "us-west-1": {
                    "AMI": "ami-951945d0", 
                    "TestAz": "us-west-1a"
                }, 
                "eu-west-1": {
                    "AMI": "ami-24506250", 
                    "TestAz": "eu-west-1a"
                }
            }
        }
    }
}