{
    "Resources": {
        "VPC": {
            "type" : "AWS :: EC2 :: VPC",
            "Properties": {
                "CidrBlock": "10.0.0.0/16",
                "EnableDnsSupport": true,
                "EnableDnsHostnames": true
            }
        },
        "InternetGateway": {
            "Type": "AWS :: EC2 :: InternetGateway",
            "Properties": {
            }
        },
        "InternetGatewayAttachment": {
            "Type": "AWS :: EC2 :: VPCGatewayAttachment",
            "Properties": {
                "InternetGatewayId": {
                    "Ref" : "InternetGateway"
                },
                "VpcId": {
                    "Ref": "VPC"
                }
            }
        },
        "PublicSubnet": {
            "Type": "AWS :: EC2 :: Subnet",
            "Properties": {
                "VpcId": {
                    "Ref": "VPC"
                },
                "AvailabilityZone": "us-east-1a",
                "CidrBlock": "10.0.1.0/24",
                "MapPublicOnLaunch": true
            }
        },
        "PublicRouteTable": {
            "Type": "AWS :: EC2 :: RouteTable",
            "Properties": {
                "VpcId": {
                    "Ref": "Vpc"
                }
            }
        },
        "DefaultPublicSubnet": {
            "Type": "Aws :: EC2 :: Route",
            "DependsOn": "InternetGatewayAttachment",
            "Properties": {
                "RouteTableId": {
                    "Ref" : "PublicRouteTable"
                },
                "DestinationCidrBlock": "0.0.0.0/0",
                "GatewayId": {
                    "Ref": "InternetGateway"
                }
            }
        },
        "PublicSubnetRouteTableAssociation": {
            "Type": "Aws :: EC2 :: SubnetRouteTableAssociation",
            "Properties": {
                "RouteTableId": {
                    "Ref": "PublicRouteTable"
                },
                "SubnetId": {
                    "Ref": "PublicSubnet"
                }
            }
        },
        "SecurityGroup": {
            "Type": "Aws :: EC2 :: SecurityGroup",
            "Properties": {
                "GroupDescription" : "Allow SSH Access",
                "SecurityGroupIngress": [
                    {
                        "IpProtocol": "tcp",
                        "FromPort" : "22",
                        "ToPort": "22",
                        "CidrIp": "0.0.0.0/0"
                    }
                ],
                "VpcId":{
                    "Ref": "VPC"
                }
            }
        },
        "EC2Instance": {
            "Type": "AWS :: EC2 :: Instance",
            "Properties": {
                "ImageId": "ami-00874d747dde814fa",
                "InstanceType": "t2.micro",
                "KeyName": "chefsHub",
                "SubnetId": {
                    "Ref": "PublicSubnet"
                },
                "SecurityGroupIds": [
                    {
                        "Ref": "SecurityGroup"
                    }
                ]
            }
        }
    }
}
