<commit_before>{
  "AWSTemplateFormatVersion" : "2010-09-09",
  "Description": "Deis on EC2: http://deis.io/",
  "Parameters" : {
    "KeyPair" : {
      "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the Deis hosts",
      "Type" : "String",
      "MinLength": "1",
      "MaxLength": "64",
      "AllowedPattern" : "[-_ a-zA-Z0-9]*",
      "ConstraintDescription" : "can contain only alphanumeric characters, spaces, dashes and underscores."
    },
    "ClusterSize": {
      "Default": "3",
      "MinValue": "3",
      "MaxValue": "12",
      "Description": "Number of nodes in cluster (3-12).",
      "Type": "Number"
    },
    "IamInstanceProfile" : {
      "Description" : "(Optional) Set IAM instance profile for Deis hosts (default: none)",
      "Type" : "String",
      "Default": ""
    },
    "SSHFrom" : {
      "Description" : "Lockdown SSH access to the Deis hosts (default: can be accessed from anywhere)",
      "Type" : "String",
      "MinLength": "9",
      "MaxLength": "18",
      "Default" : "0.0.0.0/0",
      "AllowedPattern" : "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
      "ConstraintDescription" : "must be a valid CIDR range of the form x.x.x.x/x."
    },
    "InstanceType" : {
      "Description" : "EC2 instance type (see http://aws.amazon.com/ec2/instance-types/)",
      "Type" : "String",
      "Default" : "m3.large",
      "AllowedValues" : [
        "m3.medium",
        "m3.large",
        "m3.xlarge",
        "m3.2xlarge",
        "m1.medium",
        "m1.large",
        "m1.xlarge",
        "c3.large",
        "c3.xlarge",
        "c3.2xlarge",
        "c3.4xlarge",
        "c3.8xlarge",
        "c1.medium",
        "c1.xlarge",
        "cc2.8xlarge",
        "g2.2xlarge",
        "cg1.4xlarge",
        "m2.xlarge",
        "m2.4xlarge",
        "cr1.8xlarge",
        "hi1.4xlarge",
        "hs1.8xlarge",
        "i2.xlarge",
        "i2.2xlarge",
        "i2.4xlarge",
        "i2.8xlarge",
        "r3.large",
        "r3.xlarge",
        "r3.2xlarge",
        "r3.4xlarge",
        "r3.8xlarge",
        "t2.medium"
      ],
      "ConstraintDescription" : "must be a valid EC2 instance type."
    },
    "EC2VirtualizationType" : {
      "Description" : "EC2 AMI virtualization type (see http://aws.amazon.com/amazon-linux-ami/instance-type-matrix/)",
      "Type": "String",
      "Default": "PV",
      "AllowedValues" : [ "PV", "HVM" ],
      "ConstraintDescription" : "must be either PV or HVM"
    },
    "EC2EBSVolumeType" : {
      "Description" : "EC2 EBS VolumeType",
      "Type": "String",
      "Default": "gp2",
      "AllowedValues" : [ "gp2", "io1", "standard" ],
      "ConstraintDescription" : "must be either 'gp2' for SSD, 'io1' for guaranteed IOPs, or 'standard' for magnetic"
    },
    "AssociatePublicIP": {
      "Description": "Whether to associate a public IP address to the instances",
      "Type": "String",
      "Default": "true",
      "AllowedValues" : [ "true", "false" ],
      "ConstraintDescription" : "must be either true or false"
    }
  },

  "Mappings" : {
    "CoreOSAMIs" : {
      "eu-central-1"   : { "PV" : "ami-448dbd59", "HVM" : "ami-468dbd5b" },
      "ap-northeast-1" : { "PV" : "ami-0a05160b", "HVM" : "ami-0c05160d" },
      "sa-east-1"      : { "PV" : "ami-27b00d3a", "HVM" : "ami-23b00d3e" },
      "ap-southeast-2" : { "PV" : "ami-b5295c8f", "HVM" : "ami-b7295c8d" },
      "ap-southeast-1" : { "PV" : "ami-ba0f27e8", "HVM" : "ami-b40f27e6" },
      "us-east-1"      : { "PV" : "ami-3e750856", "HVM" : "ami-3c750854" },
      "us-west-2"      : { "PV" : "ami-bf2d728f", "HVM" : "ami-bd2d728d" },
      "us-west-1"      : { "PV" : "ami-8f534dca", "HVM" : "ami-8d534dc8" },
      "eu-west-1"      : { "PV" : "ami-e76dec90", "HVM" : "ami-f96dec8e" }

    },
    "RootDevices" : {
      "HVM" : { "Name": "/dev/xvda" },
      "PV"  : { "Name": "/dev/sda" }
    },
    "SubnetConfig" : {
      "VPC"     : { "CIDR" : "10.21.0.0/16" },
      "Subnet1" : { "CIDR" : "10.21.1.0/24" },
      "Subnet2" : { "CIDR" : "10.21.2.0/24" }
    }
  },

  "Conditions" : {
    "UseIamInstanceProfile" : {
      "Fn::Not" : [{
        "Fn::Equals" : [
          { "Ref" : "IamInstanceProfile" },
           ""
        ]
      }]
    }
  },

  "Resources" : {
    "VPC" : {
      "Type" : "AWS::EC2::VPC",
      "Properties" : {
        "EnableDnsSupport" : "true",
        "EnableDnsHostnames" : "true",
        "CidrBlock" : { "Fn::FindInMap" : [ "SubnetConfig", "VPC", "CIDR" ]},
        "Tags" : [
          { "Key" : "Application", "Value" : "Deis" }
        ]
      }
    },
    "Subnet1" : {
      "Type" : "AWS::EC2::Subnet",
      "Properties" : {
        "VpcId" : { "Ref" : "VPC" },
        "AvailabilityZone": { "Fn::Select" : [ 0, { "Fn::GetAZs" : "" } ] },
        "CidrBlock" : { "Fn::FindInMap" : [ "SubnetConfig", "Subnet1", "CIDR" ]},
        "Tags" : [
          { "Key" : "Application", "Value" : "Deis" },
          { "Key" : "Network", "Value" : "Private" }
        ]
      }
    },
    "Subnet2" : {
      "Type" : "AWS::EC2::Subnet",
      "Properties" : {
        "VpcId" : { "Ref" : "VPC" },
        "AvailabilityZone": { "Fn::Select" : [ 1, { "Fn::GetAZs" : "" } ] },
        "CidrBlock" : { "Fn::FindInMap" : [ "SubnetConfig", "Subnet2", "CIDR" ]},
        "Tags" : [
          { "Key" : "Application", "Value" : "Deis" },
          { "Key" : "Network", "Value" : "Private" }
        ]
      }
    },
    "InternetGateway" : {
      "Type" : "AWS::EC2::InternetGateway",
      "Properties" : {
        "Tags" : [
          { "Key" : "Application", "Value" : "Deis" },
          { "Key" : "Network", "Value" : "Public" }
        ]
      }
    },
    "GatewayToInternet" : {
       "Type" : "AWS::EC2::VPCGatewayAttachment",
       "Properties" : {
         "VpcId" : { "Ref" : "VPC" },
         "InternetGatewayId" : { "Ref" : "InternetGateway" }
       }
    },
    "PublicRouteTable" : {
      "Type" : "AWS::EC2::RouteTable",
      "DependsOn" : "GatewayToInternet",
      "Properties" : {
        "VpcId" : { "Ref" : "VPC" },
        "Tags" : [
          { "Key" : "Application", "Value" : "Deis" },
          { "Key" : "Network", "Value" : "Public" }
        ]
      }
    },
    "PublicRoute" : {
      "Type" : "AWS::EC2::Route",
      "DependsOn" : "GatewayToInternet",
      "Properties" : {
        "RouteTableId" : { "Ref" : "PublicRouteTable" },
        "DestinationCidrBlock" : "0.0.0.0/0",
        "GatewayId" : { "Ref" : "InternetGateway" }
      }
    },
    "Subnet1RouteTableAssociation" : {
      "Type" : "AWS::EC2::SubnetRouteTableAssociation",
      "Properties" : {
        "SubnetId" : { "Ref" : "Subnet1" },
        "RouteTableId" : { "Ref" : "PublicRouteTable" }
      }
    },
    "Subnet2RouteTableAssociation" : {
      "Type" : "AWS::EC2::SubnetRouteTableAssociation",
      "Properties" : {
        "SubnetId" : { "Ref" : "Subnet2" },
        "RouteTableId" : { "Ref" : "PublicRouteTable" }
      }
    },
    "CoreOSServerAutoScale": {
      "Type": "AWS::AutoScaling::AutoScalingGroup",
      "Properties": {
        "AvailabilityZones": [
          { "Fn::GetAtt" : [ "Subnet1", "AvailabilityZone" ] },
          { "Fn::GetAtt" : [ "Subnet2", "AvailabilityZone" ] }
        ],
        "VPCZoneIdentifier": [
          { "Ref" : "Subnet1" },
          { "Ref" : "Subnet2" }
        ],
        "LaunchConfigurationName": {"Ref": "CoreOSServerLaunchConfig"},
        "MinSize": "3",
        "MaxSize": "12",
        "DesiredCapacity": {"Ref": "ClusterSize"},
        "Tags": [
            {"Key": "Name", "Value": "Deis", "PropagateAtLaunch": true}
        ],
        "LoadBalancerNames": [
          { "Ref": "DeisWebELB" }
        ]
      }
    },
    "CoreOSServerLaunchConfig": {
      "Type": "AWS::AutoScaling::LaunchConfiguration",
      "DependsOn" : "GatewayToInternet",
      "Properties": {
        "ImageId" : { "Fn::FindInMap" : [ "CoreOSAMIs", { "Ref" : "AWS::Region" }, { "Ref" : "EC2VirtualizationType" }]},
        "InstanceType": {"Ref": "InstanceType"},
        "IamInstanceProfile" : {
          "Fn::If" : [
            "UseIamInstanceProfile",
            { "Ref" : "IamInstanceProfile" },
            { "Ref" : "AWS::NoValue" }
          ]
        },
        "KeyName": {"Ref": "KeyPair"},
        "UserData" : { "Fn::Base64": { "Fn::Join": [ "", [ ] ] } },
        "AssociatePublicIpAddress": {"Ref": "AssociatePublicIP"},
        "SecurityGroups": [ { "Fn::GetAtt": ["VPCSecurityGroup", "GroupId"] } ],
        "BlockDeviceMappings" : [
          {
            "DeviceName" : { "Fn::FindInMap": [ "RootDevices", { "Ref": "EC2VirtualizationType" }, "Name" ] },
            "Ebs" : { "VolumeSize" : "50", "VolumeType": { "Ref": "EC2EBSVolumeType" } }
          },
          {
            "DeviceName" : "/dev/xvdf",
            "Ebs" : { "VolumeSize" : "100", "VolumeType": { "Ref": "EC2EBSVolumeType" } }
          }
        ]
      }
    },
    "DeisWebELB": {
      "Type": "AWS::ElasticLoadBalancing::LoadBalancer",
      "DependsOn" : "GatewayToInternet",
      "Properties": {
        "HealthCheck": {
          "HealthyThreshold": "4",
          "Interval": "15",
          "Target": "HTTP:80/health-check",
          "Timeout": "5",
          "UnhealthyThreshold": "2"
        },
        "Subnets": [
          { "Ref" : "Subnet1" },
          { "Ref" : "Subnet2" }
        ],
        "Listeners": [
          {
            "InstancePort": "80",
            "InstanceProtocol": "HTTP",
            "LoadBalancerPort": "80",
            "Protocol": "HTTP"
          },
          {
            "InstancePort": "2222",
            "InstanceProtocol": "TCP",
            "LoadBalancerPort": "2222",
            "Protocol": "TCP"
          }
        ],
        "SecurityGroups": [
          {
            "Fn::GetAtt": ["DeisWebELBSecurityGroup", "GroupId"]
          }
        ],
        "ConnectionSettings": {
          "IdleTimeout": 1200
        }
      }
    },
    "DeisWebELBSecurityGroup": {
      "Type": "AWS::EC2::SecurityGroup",
      "Properties": {
        "GroupDescription": "Deis Web ELB SecurityGroup",
        "SecurityGroupIngress": [
          {"IpProtocol": "tcp", "FromPort": "80", "ToPort": "80", "CidrIp": "0.0.0.0/0"},
          {"IpProtocol": "tcp", "FromPort": "2222", "ToPort": "2222", "CidrIp": "0.0.0.0/0"}
        ],
        "VpcId": { "Ref" : "VPC" }
      }
    },
    "VPCSecurityGroup" : {
      "Type" : "AWS::EC2::SecurityGroup",
      "Properties" : {
        "GroupDescription" : "Enable public SSH and intra-VPC communication",
        "SecurityGroupIngress" : [
          {"IpProtocol": "tcp", "FromPort" : "22",  "ToPort" : "22",  "CidrIp" : { "Ref" : "SSHFrom" }},
          {"IpProtocol": "tcp", "FromPort": "80", "ToPort": "80", "SourceSecurityGroupId": { "Ref": "DeisWebELBSecurityGroup" } },
          {"IpProtocol": "tcp", "FromPort": "2222", "ToPort": "2222", "SourceSecurityGroupId": { "Ref": "DeisWebELBSecurityGroup" } }
        ],
        "VpcId" : { "Ref" : "VPC" }
      }
    },
    "VPCSecurityGroupIngress": {
      "Type": "AWS::EC2::SecurityGroupIngress",
      "Properties": {
        "GroupId": { "Ref": "VPCSecurityGroup" },
        "IpProtocol": "-1",
        "FromPort": "0",
        "ToPort": "65535",
        "SourceSecurityGroupId": { "Ref": "VPCSecurityGroup" }
      }
    }
  },
  "Outputs" : {
    "DNSName" : {
      "Description" : "DNS Name of the ELB",
      "Value" :  { "Fn::GetAtt" : ["DeisWebELB", "DNSName"] }
    }
  }
}
<commit_msg>fix(contrib/ec2): restrict EBS type to standard or gp2<commit_after>{
  "AWSTemplateFormatVersion" : "2010-09-09",
  "Description": "Deis on EC2: http://deis.io/",
  "Parameters" : {
    "KeyPair" : {
      "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the Deis hosts",
      "Type" : "String",
      "MinLength": "1",
      "MaxLength": "64",
      "AllowedPattern" : "[-_ a-zA-Z0-9]*",
      "ConstraintDescription" : "can contain only alphanumeric characters, spaces, dashes and underscores."
    },
    "ClusterSize": {
      "Default": "3",
      "MinValue": "3",
      "MaxValue": "12",
      "Description": "Number of nodes in cluster (3-12).",
      "Type": "Number"
    },
    "IamInstanceProfile" : {
      "Description" : "(Optional) Set IAM instance profile for Deis hosts (default: none)",
      "Type" : "String",
      "Default": ""
    },
    "SSHFrom" : {
      "Description" : "Lockdown SSH access to the Deis hosts (default: can be accessed from anywhere)",
      "Type" : "String",
      "MinLength": "9",
      "MaxLength": "18",
      "Default" : "0.0.0.0/0",
      "AllowedPattern" : "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
      "ConstraintDescription" : "must be a valid CIDR range of the form x.x.x.x/x."
    },
    "InstanceType" : {
      "Description" : "EC2 instance type (see http://aws.amazon.com/ec2/instance-types/)",
      "Type" : "String",
      "Default" : "m3.large",
      "AllowedValues" : [
        "m3.medium",
        "m3.large",
        "m3.xlarge",
        "m3.2xlarge",
        "m1.medium",
        "m1.large",
        "m1.xlarge",
        "c3.large",
        "c3.xlarge",
        "c3.2xlarge",
        "c3.4xlarge",
        "c3.8xlarge",
        "c1.medium",
        "c1.xlarge",
        "cc2.8xlarge",
        "g2.2xlarge",
        "cg1.4xlarge",
        "m2.xlarge",
        "m2.4xlarge",
        "cr1.8xlarge",
        "hi1.4xlarge",
        "hs1.8xlarge",
        "i2.xlarge",
        "i2.2xlarge",
        "i2.4xlarge",
        "i2.8xlarge",
        "r3.large",
        "r3.xlarge",
        "r3.2xlarge",
        "r3.4xlarge",
        "r3.8xlarge",
        "t2.medium"
      ],
      "ConstraintDescription" : "must be a valid EC2 instance type."
    },
    "EC2VirtualizationType" : {
      "Description" : "EC2 AMI virtualization type (see http://aws.amazon.com/amazon-linux-ami/instance-type-matrix/)",
      "Type": "String",
      "Default": "PV",
      "AllowedValues" : [ "PV", "HVM" ],
      "ConstraintDescription" : "must be either PV or HVM"
    },
    "EC2EBSVolumeType" : {
      "Description" : "EC2 EBS VolumeType",
      "Type": "String",
      "Default": "gp2",
      "AllowedValues" : [ "gp2", "standard" ],
      "ConstraintDescription" : "must be either 'gp2' for SSD or 'standard' for magnetic (provisioned iOPS requires further manual changes)"
    },
    "AssociatePublicIP": {
      "Description": "Whether to associate a public IP address to the instances",
      "Type": "String",
      "Default": "true",
      "AllowedValues" : [ "true", "false" ],
      "ConstraintDescription" : "must be either true or false"
    }
  },

  "Mappings" : {
    "CoreOSAMIs" : {
      "eu-central-1"   : { "PV" : "ami-448dbd59", "HVM" : "ami-468dbd5b" },
      "ap-northeast-1" : { "PV" : "ami-0a05160b", "HVM" : "ami-0c05160d" },
      "sa-east-1"      : { "PV" : "ami-27b00d3a", "HVM" : "ami-23b00d3e" },
      "ap-southeast-2" : { "PV" : "ami-b5295c8f", "HVM" : "ami-b7295c8d" },
      "ap-southeast-1" : { "PV" : "ami-ba0f27e8", "HVM" : "ami-b40f27e6" },
      "us-east-1"      : { "PV" : "ami-3e750856", "HVM" : "ami-3c750854" },
      "us-west-2"      : { "PV" : "ami-bf2d728f", "HVM" : "ami-bd2d728d" },
      "us-west-1"      : { "PV" : "ami-8f534dca", "HVM" : "ami-8d534dc8" },
      "eu-west-1"      : { "PV" : "ami-e76dec90", "HVM" : "ami-f96dec8e" }

    },
    "RootDevices" : {
      "HVM" : { "Name": "/dev/xvda" },
      "PV"  : { "Name": "/dev/sda" }
    },
    "SubnetConfig" : {
      "VPC"     : { "CIDR" : "10.21.0.0/16" },
      "Subnet1" : { "CIDR" : "10.21.1.0/24" },
      "Subnet2" : { "CIDR" : "10.21.2.0/24" }
    }
  },

  "Conditions" : {
    "UseIamInstanceProfile" : {
      "Fn::Not" : [{
        "Fn::Equals" : [
          { "Ref" : "IamInstanceProfile" },
           ""
        ]
      }]
    }
  },

  "Resources" : {
    "VPC" : {
      "Type" : "AWS::EC2::VPC",
      "Properties" : {
        "EnableDnsSupport" : "true",
        "EnableDnsHostnames" : "true",
        "CidrBlock" : { "Fn::FindInMap" : [ "SubnetConfig", "VPC", "CIDR" ]},
        "Tags" : [
          { "Key" : "Application", "Value" : "Deis" }
        ]
      }
    },
    "Subnet1" : {
      "Type" : "AWS::EC2::Subnet",
      "Properties" : {
        "VpcId" : { "Ref" : "VPC" },
        "AvailabilityZone": { "Fn::Select" : [ 0, { "Fn::GetAZs" : "" } ] },
        "CidrBlock" : { "Fn::FindInMap" : [ "SubnetConfig", "Subnet1", "CIDR" ]},
        "Tags" : [
          { "Key" : "Application", "Value" : "Deis" },
          { "Key" : "Network", "Value" : "Private" }
        ]
      }
    },
    "Subnet2" : {
      "Type" : "AWS::EC2::Subnet",
      "Properties" : {
        "VpcId" : { "Ref" : "VPC" },
        "AvailabilityZone": { "Fn::Select" : [ 1, { "Fn::GetAZs" : "" } ] },
        "CidrBlock" : { "Fn::FindInMap" : [ "SubnetConfig", "Subnet2", "CIDR" ]},
        "Tags" : [
          { "Key" : "Application", "Value" : "Deis" },
          { "Key" : "Network", "Value" : "Private" }
        ]
      }
    },
    "InternetGateway" : {
      "Type" : "AWS::EC2::InternetGateway",
      "Properties" : {
        "Tags" : [
          { "Key" : "Application", "Value" : "Deis" },
          { "Key" : "Network", "Value" : "Public" }
        ]
      }
    },
    "GatewayToInternet" : {
       "Type" : "AWS::EC2::VPCGatewayAttachment",
       "Properties" : {
         "VpcId" : { "Ref" : "VPC" },
         "InternetGatewayId" : { "Ref" : "InternetGateway" }
       }
    },
    "PublicRouteTable" : {
      "Type" : "AWS::EC2::RouteTable",
      "DependsOn" : "GatewayToInternet",
      "Properties" : {
        "VpcId" : { "Ref" : "VPC" },
        "Tags" : [
          { "Key" : "Application", "Value" : "Deis" },
          { "Key" : "Network", "Value" : "Public" }
        ]
      }
    },
    "PublicRoute" : {
      "Type" : "AWS::EC2::Route",
      "DependsOn" : "GatewayToInternet",
      "Properties" : {
        "RouteTableId" : { "Ref" : "PublicRouteTable" },
        "DestinationCidrBlock" : "0.0.0.0/0",
        "GatewayId" : { "Ref" : "InternetGateway" }
      }
    },
    "Subnet1RouteTableAssociation" : {
      "Type" : "AWS::EC2::SubnetRouteTableAssociation",
      "Properties" : {
        "SubnetId" : { "Ref" : "Subnet1" },
        "RouteTableId" : { "Ref" : "PublicRouteTable" }
      }
    },
    "Subnet2RouteTableAssociation" : {
      "Type" : "AWS::EC2::SubnetRouteTableAssociation",
      "Properties" : {
        "SubnetId" : { "Ref" : "Subnet2" },
        "RouteTableId" : { "Ref" : "PublicRouteTable" }
      }
    },
    "CoreOSServerAutoScale": {
      "Type": "AWS::AutoScaling::AutoScalingGroup",
      "Properties": {
        "AvailabilityZones": [
          { "Fn::GetAtt" : [ "Subnet1", "AvailabilityZone" ] },
          { "Fn::GetAtt" : [ "Subnet2", "AvailabilityZone" ] }
        ],
        "VPCZoneIdentifier": [
          { "Ref" : "Subnet1" },
          { "Ref" : "Subnet2" }
        ],
        "LaunchConfigurationName": {"Ref": "CoreOSServerLaunchConfig"},
        "MinSize": "3",
        "MaxSize": "12",
        "DesiredCapacity": {"Ref": "ClusterSize"},
        "Tags": [
            {"Key": "Name", "Value": "Deis", "PropagateAtLaunch": true}
        ],
        "LoadBalancerNames": [
          { "Ref": "DeisWebELB" }
        ]
      }
    },
    "CoreOSServerLaunchConfig": {
      "Type": "AWS::AutoScaling::LaunchConfiguration",
      "DependsOn" : "GatewayToInternet",
      "Properties": {
        "ImageId" : { "Fn::FindInMap" : [ "CoreOSAMIs", { "Ref" : "AWS::Region" }, { "Ref" : "EC2VirtualizationType" }]},
        "InstanceType": {"Ref": "InstanceType"},
        "IamInstanceProfile" : {
          "Fn::If" : [
            "UseIamInstanceProfile",
            { "Ref" : "IamInstanceProfile" },
            { "Ref" : "AWS::NoValue" }
          ]
        },
        "KeyName": {"Ref": "KeyPair"},
        "UserData" : { "Fn::Base64": { "Fn::Join": [ "", [ ] ] } },
        "AssociatePublicIpAddress": {"Ref": "AssociatePublicIP"},
        "SecurityGroups": [ { "Fn::GetAtt": ["VPCSecurityGroup", "GroupId"] } ],
        "BlockDeviceMappings" : [
          {
            "DeviceName" : { "Fn::FindInMap": [ "RootDevices", { "Ref": "EC2VirtualizationType" }, "Name" ] },
            "Ebs" : { "VolumeSize" : "50", "VolumeType": { "Ref": "EC2EBSVolumeType" } }
          },
          {
            "DeviceName" : "/dev/xvdf",
            "Ebs" : { "VolumeSize" : "100", "VolumeType": { "Ref": "EC2EBSVolumeType" } }
          }
        ]
      }
    },
    "DeisWebELB": {
      "Type": "AWS::ElasticLoadBalancing::LoadBalancer",
      "DependsOn" : "GatewayToInternet",
      "Properties": {
        "HealthCheck": {
          "HealthyThreshold": "4",
          "Interval": "15",
          "Target": "HTTP:80/health-check",
          "Timeout": "5",
          "UnhealthyThreshold": "2"
        },
        "Subnets": [
          { "Ref" : "Subnet1" },
          { "Ref" : "Subnet2" }
        ],
        "Listeners": [
          {
            "InstancePort": "80",
            "InstanceProtocol": "HTTP",
            "LoadBalancerPort": "80",
            "Protocol": "HTTP"
          },
          {
            "InstancePort": "2222",
            "InstanceProtocol": "TCP",
            "LoadBalancerPort": "2222",
            "Protocol": "TCP"
          }
        ],
        "SecurityGroups": [
          {
            "Fn::GetAtt": ["DeisWebELBSecurityGroup", "GroupId"]
          }
        ],
        "ConnectionSettings": {
          "IdleTimeout": 1200
        }
      }
    },
    "DeisWebELBSecurityGroup": {
      "Type": "AWS::EC2::SecurityGroup",
      "Properties": {
        "GroupDescription": "Deis Web ELB SecurityGroup",
        "SecurityGroupIngress": [
          {"IpProtocol": "tcp", "FromPort": "80", "ToPort": "80", "CidrIp": "0.0.0.0/0"},
          {"IpProtocol": "tcp", "FromPort": "2222", "ToPort": "2222", "CidrIp": "0.0.0.0/0"}
        ],
        "VpcId": { "Ref" : "VPC" }
      }
    },
    "VPCSecurityGroup" : {
      "Type" : "AWS::EC2::SecurityGroup",
      "Properties" : {
        "GroupDescription" : "Enable public SSH and intra-VPC communication",
        "SecurityGroupIngress" : [
          {"IpProtocol": "tcp", "FromPort" : "22",  "ToPort" : "22",  "CidrIp" : { "Ref" : "SSHFrom" }},
          {"IpProtocol": "tcp", "FromPort": "80", "ToPort": "80", "SourceSecurityGroupId": { "Ref": "DeisWebELBSecurityGroup" } },
          {"IpProtocol": "tcp", "FromPort": "2222", "ToPort": "2222", "SourceSecurityGroupId": { "Ref": "DeisWebELBSecurityGroup" } }
        ],
        "VpcId" : { "Ref" : "VPC" }
      }
    },
    "VPCSecurityGroupIngress": {
      "Type": "AWS::EC2::SecurityGroupIngress",
      "Properties": {
        "GroupId": { "Ref": "VPCSecurityGroup" },
        "IpProtocol": "-1",
        "FromPort": "0",
        "ToPort": "65535",
        "SourceSecurityGroupId": { "Ref": "VPCSecurityGroup" }
      }
    }
  },
  "Outputs" : {
    "DNSName" : {
      "Description" : "DNS Name of the ELB",
      "Value" :  { "Fn::GetAtt" : ["DeisWebELB", "DNSName"] }
    }
  }
}

{'fraction_non_alphanumeric': 0.2069665931976317, 'fraction_numerical': 0.02938761398504689, 'mean_word_length': 2.0319706498951784, 'pattern_counts': {'":': 236, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 14, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6176208', 'n_tokens_mistral': 8769, 'n_tokens_neox': 8495, 'n_words': 1388}