<commit_before>{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "Demo Mediawiki deployment for the nubis project.",
  "Parameters": {
    "ServiceName": {
      "Description": "Name of the service",
      "Type": "String"
    },
    "Environment": {
      "Description": "Environment we are deploying into",
      "Default": "sandbox",
      "Type": "String",
      "AllowedValues": [
        "prod",
        "dev",
        "sandbox"
      ],
      "ConstraintDescription": "Must specify prod, dev, or sandbox."
    },
    "BaseZone": {
      "Description": "Base zone to create route53 zone in",
      "Default": "nubis.allizom.org",
      "Type": "String"
    },
    "KeyName": {
      "Description": "Existing ssh key to deploy to instances",
      "Type": "String"
    },
    "wgReCaptchaPublicKey": {
      "Description": "A ReCaptcha public key",
      "Type": "String"
    },
    "wgReCaptchaPrivateKey": {
      "Description": "A ReCaptcha private key",
      "Type": "String"
    },
    "wgGoogleAnalyticsAccount": {
      "Description": "A Google analytics key",
      "Type": "String"
    },
    "TechnicalOwner": {
      "Description": "A valid LDAP email",
      "Type": "String"
    },
    "AmiId": {
      "Description": "The id of the ami for this region",
      "Type": "String"
    },
    "StorageVolumeSize": {
      "Description": "The storage size (in GB) of each member of the storage cluster",
      "Type": "String",
      "Default": "30"
    }
  },
  "Mappings": {
    "InstanceTypeMap": {
      "prod": {
        "InstanceType": "m3.large"
      },
      "dev": {
        "InstanceType": "m3.medium"
      },
      "sandbox": {
        "InstanceType": "m3.large"
      }
    }
  },
  "Resources": {
    "EC2Stack": {
      "Type": "AWS::CloudFormation::Stack",
      "Properties": {
        "TemplateURL": "https://s3.amazonaws.com/nubisproject-stacks/master/ec2.template",
        "TimeoutInMinutes": "60",
        "Parameters": {
          "ServiceName": {
            "Ref": "ServiceName"
          },
          "TechnicalOwner": {
            "Ref": "TechnicalOwner"
          },
          "Environment": {
            "Ref": "Environment"
          },
          "AmiId": {
            "Ref": "AmiId"
          },
          "KeyName": {
            "Ref": "KeyName"
          },
          "InstanceType": {
            "Fn::FindInMap": [
              "InstanceTypeMap",
              {
                "Ref": "Environment"
              },
              "InstanceType"
            ]
          },
          "ELB": {
            "Fn::GetAtt": [
              "ELBStack",
              "Outputs.ELB"
            ]
          }
        }
      }
    },
    "ELBStack": {
      "Type": "AWS::CloudFormation::Stack",
      "Properties": {
        "TemplateURL": "https://s3.amazonaws.com/nubisproject-stacks/master/elb.template",
        "TimeoutInMinutes": "60",
        "Parameters": {
          "ServiceName": {
            "Ref": "ServiceName"
          },
          "TechnicalOwner": {
            "Ref": "TechnicalOwner"
          },
          "Environment": {
            "Ref": "Environment"
          },
          "ElbHealthTarget": "HTTP:80/Special%3AVersion"
        }
      }
    },
    "RDSStack": {
      "Type": "AWS::CloudFormation::Stack",
      "Properties": {
        "TemplateURL": "https://s3.amazonaws.com/nubisproject-stacks/master/rds-mysql.template",
        "TimeoutInMinutes": "60",
        "Parameters": {
          "ServiceName": {
            "Ref": "ServiceName"
          },
          "TechnicalOwner": {
            "Ref": "TechnicalOwner"
          },
          "Environment": {
            "Ref": "Environment"
          },
          "AllocatedStorage": "15",
          "DBInstanceClass": "db.m3.large",
          "DBName": "mediawiki",
          "EC2SecurityGroup": {
            "Fn::GetAtt": [
              "EC2Stack",
              "Outputs.EC2SecurityGroup"
            ]
          }
        }
      }
    },
    "MemcacheStack": {
      "Type": "AWS::CloudFormation::Stack",
      "Properties": {
        "TemplateURL": "https://s3.amazonaws.com/nubisproject-stacks/master/memcache.template",
        "TimeoutInMinutes": "60",
        "Parameters": {
          "ServiceName": {
            "Ref": "ServiceName"
          },
          "TechnicalOwner": {
            "Ref": "TechnicalOwner"
          },
          "Environment": {
            "Ref": "Environment"
          },
          "EC2SecurityGroup": {
            "Fn::GetAtt": [
              "EC2Stack",
              "Outputs.GroupId"
            ]
          }
        }
      }
    },
    "Route53Stack": {
      "Type": "AWS::CloudFormation::Stack",
      "Properties": {
        "TemplateURL": "https://s3.amazonaws.com/nubisproject-stacks/master/route53.template",
        "TimeoutInMinutes": "60",
        "Parameters": {
          "ServiceName": {
            "Ref": "ServiceName"
          },
          "Environment": {
            "Ref": "Environment"
          },
          "BaseZone": {
            "Ref": "BaseZone"
          },
          "ELBStack": {
            "Fn::GetAtt": [
              "ELBStack",
              "Outputs.DNSName"
            ]
          }
        }
      }
    },
    "StorageStack": {
      "Type": "AWS::CloudFormation::Stack",
      "Properties": {
        "TemplateURL": "https://s3.amazonaws.com/nubisproject-stacks/master/storage.template",
        "TimeoutInMinutes": "60",
        "Parameters": {
          "ServiceName": {
            "Ref": "ServiceName"
          },
          "TechnicalOwner": {
            "Ref": "TechnicalOwner"
          },
          "Environment": {
            "Ref": "Environment"
          },
          "KeyName": {
            "Ref": "KeyName"
          },
          "VolumeSize": {
            "Ref": "StorageVolumeSize"
          },
          "EC2SecurityGroup": {
            "Fn::GetAtt": [
              "EC2Stack",
              "Outputs.GroupId"
            ]
          }
        }
      }
    }
  },
  "Outputs": {
    "ELBDNSName": {
      "Description": "Consul: / ELB CNAME",
      "Value": {
        "Fn::GetAtt": [
          "ELBStack",
          "Outputs.DNSName"
        ]
      }
    },
    "Environment": {
      "Description": "Consul: config/ Environment we are deployed into",
      "Value": {
        "Ref": "Environment"
      }
    },
    "wgServer": {
      "Description": "Consul: config/ Server name",
      "Value": {
        "Fn::Join": [
          ".",
          [
            "//www",
            {
              "Ref": "ServiceName"
            },
            {
              "Ref": "Environment"
            },
            "nubis.allizom.org"
          ]
        ]
      }
    },
    "wgDBserver": {
      "Description": "Consul: config/ Database endpoint",
      "Value": {
        "Fn::GetAtt": [
          "RDSStack",
          "Outputs.RDSEndpoint"
        ]
      }
    },
    "wgDBname": {
      "Description": "Consul: config/ Database name",
      "Value": {
        "Fn::GetAtt": [
          "RDSStack",
          "Outputs.RDSName"
        ]
      }
    },
    "wgDBuser": {
      "Description": "Consul: config/ Database user",
      "Value": {
        "Fn::GetAtt": [
          "RDSStack",
          "Outputs.RDSUser"
        ]
      }
    },
    "MemCachedEndpoint": {
      "Description": "Consul: config/ Database user",
      "Value": {
        "Fn::GetAtt": [
          "MemcacheStack",
          "Outputs.Endpoint"
        ]
      }
    },
    "MemCachedPort": {
      "Description": "Consul: config/ Database user",
      "Value": {
        "Fn::GetAtt": [
          "MemcacheStack",
          "Outputs.Port"
        ]
      }
    },
    "wgReCaptchaPublicKey": {
      "Description": "Consul: config/ wgReCaptchaPublicKey",
      "Value": {
        "Ref": "wgReCaptchaPublicKey"
      }
    },
    "wgReCaptchaPrivateKey": {
      "Description": "Consul: config/ wgReCaptchaPrivateKey",
      "Value": {
        "Ref": "wgReCaptchaPrivateKey"
      }
    },
    "wgGoogleAnalyticsAccount": {
      "Description": "Consul: config/ wgGoogleAnalyticsAccount",
      "Value": {
        "Ref": "wgGoogleAnalyticsAccount"
      }
    }
  }
}<commit_msg>Adding autoscaling nested stack<commit_after>{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "Demo Mediawiki deployment for the nubis project.",
  "Parameters": {
    "ServiceName": {
      "Description": "Name of the service",
      "Type": "String"
    },
    "Environment": {
      "Description": "Environment we are deploying into",
      "Default": "sandbox",
      "Type": "String",
      "AllowedValues": [
        "prod",
        "dev",
        "sandbox"
      ],
      "ConstraintDescription": "Must specify prod, dev, or sandbox."
    },
    "BaseZone": {
      "Description": "Base zone to create route53 zone in",
      "Default": "nubis.allizom.org",
      "Type": "String"
    },
    "KeyName": {
      "Description": "Existing ssh key to deploy to instances",
      "Type": "String"
    },
    "wgReCaptchaPublicKey": {
      "Description": "A ReCaptcha public key",
      "Type": "String"
    },
    "wgReCaptchaPrivateKey": {
      "Description": "A ReCaptcha private key",
      "Type": "String"
    },
    "wgGoogleAnalyticsAccount": {
      "Description": "A Google analytics key",
      "Type": "String"
    },
    "TechnicalOwner": {
      "Description": "A valid LDAP email",
      "Type": "String"
    },
    "AmiId": {
      "Description": "The id of the ami for this region",
      "Type": "String"
    },
    "StorageVolumeSize": {
      "Description": "The storage size (in GB) of each member of the storage cluster",
      "Type": "String",
      "Default": "30"
    }
  },
  "Mappings": {
    "InstanceTypeMap": {
      "prod": {
        "InstanceType": "m3.large"
      },
      "dev": {
        "InstanceType": "m3.medium"
      },
      "sandbox": {
        "InstanceType": "m3.large"
      }
    }
  },
  "Resources": {
    "EC2Stack": {
      "Type": "AWS::CloudFormation::Stack",
      "Properties": {
        "TemplateURL": "https://s3.amazonaws.com/nubisproject-stacks/master/ec2.template",
        "TimeoutInMinutes": "60",
        "Parameters": {
          "ServiceName": {
            "Ref": "ServiceName"
          },
          "TechnicalOwner": {
            "Ref": "TechnicalOwner"
          },
          "Environment": {
            "Ref": "Environment"
          },
          "AmiId": {
            "Ref": "AmiId"
          },
          "KeyName": {
            "Ref": "KeyName"
          },
          "InstanceType": {
            "Fn::FindInMap": [
              "InstanceTypeMap",
              {
                "Ref": "Environment"
              },
              "InstanceType"
            ]
          },
          "ELB": {
            "Fn::GetAtt": [
              "ELBStack",
              "Outputs.ELB"
            ]
          }
        }
      }
    },
    "AutoScalingStack": {
      "Type": "AWS::CloudFormation::Stack",
      "Properties": {
        "TemplateURL": "https://s3.amazonaws.com/nubisproject-stacks/master/autoscaling-cpu.template",
        "TimeoutInMinutes": "60",
        "Parameters": {
          "AutoScalingGroup": {
            "Fn::GetAtt": [
              "EC2Stack",
              "Outputs.AutoScalingGroup"
            ]
          }
        }
      }
    },
    "ELBStack": {
      "Type": "AWS::CloudFormation::Stack",
      "Properties": {
        "TemplateURL": "https://s3.amazonaws.com/nubisproject-stacks/master/elb.template",
        "TimeoutInMinutes": "60",
        "Parameters": {
          "ServiceName": {
            "Ref": "ServiceName"
          },
          "TechnicalOwner": {
            "Ref": "TechnicalOwner"
          },
          "Environment": {
            "Ref": "Environment"
          },
          "ElbHealthTarget": "HTTP:80/Special%3AVersion"
        }
      }
    },
    "RDSStack": {
      "Type": "AWS::CloudFormation::Stack",
      "Properties": {
        "TemplateURL": "https://s3.amazonaws.com/nubisproject-stacks/master/rds-mysql.template",
        "TimeoutInMinutes": "60",
        "Parameters": {
          "ServiceName": {
            "Ref": "ServiceName"
          },
          "TechnicalOwner": {
            "Ref": "TechnicalOwner"
          },
          "Environment": {
            "Ref": "Environment"
          },
          "AllocatedStorage": "15",
          "DBInstanceClass": "db.m3.large",
          "DBName": "mediawiki",
          "EC2SecurityGroup": {
            "Fn::GetAtt": [
              "EC2Stack",
              "Outputs.EC2SecurityGroup"
            ]
          }
        }
      }
    },
    "MemcacheStack": {
      "Type": "AWS::CloudFormation::Stack",
      "Properties": {
        "TemplateURL": "https://s3.amazonaws.com/nubisproject-stacks/master/memcache.template",
        "TimeoutInMinutes": "60",
        "Parameters": {
          "ServiceName": {
            "Ref": "ServiceName"
          },
          "TechnicalOwner": {
            "Ref": "TechnicalOwner"
          },
          "Environment": {
            "Ref": "Environment"
          },
          "EC2SecurityGroup": {
            "Fn::GetAtt": [
              "EC2Stack",
              "Outputs.GroupId"
            ]
          }
        }
      }
    },
    "Route53Stack": {
      "Type": "AWS::CloudFormation::Stack",
      "Properties": {
        "TemplateURL": "https://s3.amazonaws.com/nubisproject-stacks/master/route53.template",
        "TimeoutInMinutes": "60",
        "Parameters": {
          "ServiceName": {
            "Ref": "ServiceName"
          },
          "Environment": {
            "Ref": "Environment"
          },
          "BaseZone": {
            "Ref": "BaseZone"
          },
          "ELBStack": {
            "Fn::GetAtt": [
              "ELBStack",
              "Outputs.DNSName"
            ]
          }
        }
      }
    },
    "StorageStack": {
      "Type": "AWS::CloudFormation::Stack",
      "Properties": {
        "TemplateURL": "https://s3.amazonaws.com/nubisproject-stacks/master/storage.template",
        "TimeoutInMinutes": "60",
        "Parameters": {
          "ServiceName": {
            "Ref": "ServiceName"
          },
          "TechnicalOwner": {
            "Ref": "TechnicalOwner"
          },
          "Environment": {
            "Ref": "Environment"
          },
          "KeyName": {
            "Ref": "KeyName"
          },
          "VolumeSize": {
            "Ref": "StorageVolumeSize"
          },
          "EC2SecurityGroup": {
            "Fn::GetAtt": [
              "EC2Stack",
              "Outputs.GroupId"
            ]
          }
        }
      }
    }
  },
  "Outputs": {
    "ELBDNSName": {
      "Description": "Consul: / ELB CNAME",
      "Value": {
        "Fn::GetAtt": [
          "ELBStack",
          "Outputs.DNSName"
        ]
      }
    },
    "Environment": {
      "Description": "Consul: config/ Environment we are deployed into",
      "Value": {
        "Ref": "Environment"
      }
    },
    "wgServer": {
      "Description": "Consul: config/ Server name",
      "Value": {
        "Fn::Join": [
          ".",
          [
            "//www",
            {
              "Ref": "ServiceName"
            },
            {
              "Ref": "Environment"
            },
            "nubis.allizom.org"
          ]
        ]
      }
    },
    "wgDBserver": {
      "Description": "Consul: config/ Database endpoint",
      "Value": {
        "Fn::GetAtt": [
          "RDSStack",
          "Outputs.RDSEndpoint"
        ]
      }
    },
    "wgDBname": {
      "Description": "Consul: config/ Database name",
      "Value": {
        "Fn::GetAtt": [
          "RDSStack",
          "Outputs.RDSName"
        ]
      }
    },
    "wgDBuser": {
      "Description": "Consul: config/ Database user",
      "Value": {
        "Fn::GetAtt": [
          "RDSStack",
          "Outputs.RDSUser"
        ]
      }
    },
    "MemCachedEndpoint": {
      "Description": "Consul: config/ Database user",
      "Value": {
        "Fn::GetAtt": [
          "MemcacheStack",
          "Outputs.Endpoint"
        ]
      }
    },
    "MemCachedPort": {
      "Description": "Consul: config/ Database user",
      "Value": {
        "Fn::GetAtt": [
          "MemcacheStack",
          "Outputs.Port"
        ]
      }
    },
    "wgReCaptchaPublicKey": {
      "Description": "Consul: config/ wgReCaptchaPublicKey",
      "Value": {
        "Ref": "wgReCaptchaPublicKey"
      }
    },
    "wgReCaptchaPrivateKey": {
      "Description": "Consul: config/ wgReCaptchaPrivateKey",
      "Value": {
        "Ref": "wgReCaptchaPrivateKey"
      }
    },
    "wgGoogleAnalyticsAccount": {
      "Description": "Consul: config/ wgGoogleAnalyticsAccount",
      "Value": {
        "Ref": "wgGoogleAnalyticsAccount"
      }
    }
  }
}
{'fraction_non_alphanumeric': 0.15984116636045753, 'fraction_numerical': 0.006400758608427665, 'mean_word_length': 1.4902597402597402, 'pattern_counts': {'":': 390, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 13, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, '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': '4097721', 'n_tokens_mistral': 5216, 'n_tokens_neox': 5131, 'n_words': 824}