[
  {
    "path": ".gitignore",
    "content": "**/.terraform\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright [2018] Carlos Ribeiro\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "# terraform_ecs_fargate_example\n"
  },
  {
    "path": "modules/code_pipeline/buildspec.yml",
    "content": "version: 0.2\n\nphases:\n  pre_build:\n    commands:\n      - pip install awscli --upgrade --user\n      - echo `aws --version`\n      - echo Logging in to Amazon ECR...\n      - $(aws ecr get-login --region ${region} --no-include-email)\n      - REPOSITORY_URI=${repository_url}\n      - IMAGE_TAG=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)\n      - echo Entered the pre_build phase...\n  build:\n    commands:\n      - echo Build started on `date`\n      - echo Building the Docker image...\n      - docker build --build-arg build_without=\"development test\" --build-arg rails_env=\"production\" -t $REPOSITORY_URI:latest .\n      - docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG\n  post_build:\n    commands:\n      - echo Build completed on `date`\n      - echo Pushing the Docker images...\n      - docker push $REPOSITORY_URI:latest\n      - docker push $REPOSITORY_URI:$IMAGE_TAG\n      - echo Writing image definitions file...\n      - printf '[{\"name\":\"web\",\"imageUri\":\"%s\"}]' $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json\n      - echo upgrading db-migrate task definitions\n      - aws ecs run-task --launch-type FARGATE --cluster ${cluster_name} --task-definition production_db_migrate --network-configuration \"awsvpcConfiguration={subnets=[${subnet_id}],securityGroups=[${security_group_ids}]}\"\nartifacts:\n  files: imagedefinitions.json\n"
  },
  {
    "path": "modules/code_pipeline/main.tf",
    "content": "resource \"aws_s3_bucket\" \"source\" {\n  bucket        = \"openjobs-experiment-source\"\n  acl           = \"private\"\n  force_destroy = true\n}\n\nresource \"aws_iam_role\" \"codepipeline_role\" {\n  name               = \"codepipeline-role\"\n\n  assume_role_policy = \"${file(\"${path.module}/policies/codepipeline_role.json\")}\"\n}\n\n/* policies */\ndata \"template_file\" \"codepipeline_policy\" {\n  template = \"${file(\"${path.module}/policies/codepipeline.json\")}\"\n\n  vars {\n    aws_s3_bucket_arn = \"${aws_s3_bucket.source.arn}\"\n  }\n}\n\nresource \"aws_iam_role_policy\" \"codepipeline_policy\" {\n  name   = \"codepipeline_policy\"\n  role   = \"${aws_iam_role.codepipeline_role.id}\"\n  policy = \"${data.template_file.codepipeline_policy.rendered}\"\n}\n\n/*\n/* CodeBuild\n*/\nresource \"aws_iam_role\" \"codebuild_role\" {\n  name               = \"codebuild-role\"\n  assume_role_policy = \"${file(\"${path.module}/policies/codebuild_role.json\")}\"\n}\n\ndata \"template_file\" \"codebuild_policy\" {\n  template = \"${file(\"${path.module}/policies/codebuild_policy.json\")}\"\n\n  vars {\n    aws_s3_bucket_arn = \"${aws_s3_bucket.source.arn}\"\n  }\n}\n\nresource \"aws_iam_role_policy\" \"codebuild_policy\" {\n  name        = \"codebuild-policy\"\n  role        = \"${aws_iam_role.codebuild_role.id}\"\n  policy      = \"${data.template_file.codebuild_policy.rendered}\"\n}\n\ndata \"template_file\" \"buildspec\" {\n  template = \"${file(\"${path.module}/buildspec.yml\")}\"\n\n  vars {\n    repository_url     = \"${var.repository_url}\"\n    region             = \"${var.region}\"\n    cluster_name       = \"${var.ecs_cluster_name}\"\n    subnet_id          = \"${var.run_task_subnet_id}\"\n    security_group_ids = \"${join(\",\", var.run_task_security_group_ids)}\"\n  }\n}\n\n\nresource \"aws_codebuild_project\" \"openjobs_build\" {\n  name          = \"openjobs-codebuild\"\n  build_timeout = \"10\"\n  service_role  = \"${aws_iam_role.codebuild_role.arn}\"\n\n  artifacts {\n    type = \"CODEPIPELINE\"\n  }\n\n  environment {\n    compute_type    = \"BUILD_GENERAL1_SMALL\"\n    // https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html\n    image           = \"aws/codebuild/docker:1.12.1\"\n    type            = \"LINUX_CONTAINER\"\n    privileged_mode = true\n  }\n\n  source {\n    type      = \"CODEPIPELINE\"\n    buildspec = \"${data.template_file.buildspec.rendered}\"\n  }\n}\n\n/* CodePipeline */\n\nresource \"aws_codepipeline\" \"pipeline\" {\n  name     = \"openjobs-pipeline\"\n  role_arn = \"${aws_iam_role.codepipeline_role.arn}\"\n\n  artifact_store {\n    location = \"${aws_s3_bucket.source.bucket}\"\n    type     = \"S3\"\n  }\n\n  stage {\n    name = \"Source\"\n\n    action {\n      name             = \"Source\"\n      category         = \"Source\"\n      owner            = \"ThirdParty\"\n      provider         = \"GitHub\"\n      version          = \"1\"\n      output_artifacts = [\"source\"]\n\n      configuration {\n        Owner      = \"duduribeiro\"\n        Repo       = \"openjobs_experiment\"\n        Branch     = \"master\"\n      }\n    }\n  }\n\n  stage {\n    name = \"Build\"\n\n    action {\n      name             = \"Build\"\n      category         = \"Build\"\n      owner            = \"AWS\"\n      provider         = \"CodeBuild\"\n      version          = \"1\"\n      input_artifacts  = [\"source\"]\n      output_artifacts = [\"imagedefinitions\"]\n\n      configuration {\n        ProjectName = \"openjobs-codebuild\"\n      }\n    }\n  }\n\n  stage {\n    name = \"Production\"\n\n    action {\n      name            = \"Deploy\"\n      category        = \"Deploy\"\n      owner           = \"AWS\"\n      provider        = \"ECS\"\n      input_artifacts = [\"imagedefinitions\"]\n      version         = \"1\"\n\n      configuration {\n        ClusterName = \"${var.ecs_cluster_name}\"\n        ServiceName = \"${var.ecs_service_name}\"\n        FileName    = \"imagedefinitions.json\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "modules/code_pipeline/policies/codebuild_policy.json",
    "content": "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Resource\": [\n        \"*\"\n      ],\n      \"Action\": [\n        \"logs:CreateLogGroup\",\n        \"logs:CreateLogStream\",\n        \"logs:PutLogEvents\",\n        \"ecr:GetAuthorizationToken\",\n        \"ecr:InitiateLayerUpload\",\n        \"ecr:UploadLayerPart\",\n        \"ecr:CompleteLayerUpload\",\n        \"ecr:BatchCheckLayerAvailability\",\n        \"ecr:PutImage\",\n        \"ecs:RunTask\",\n        \"iam:PassRole\"\n      ]\n    },\n    {\n      \"Effect\":\"Allow\",\n      \"Action\": [\n        \"s3:GetObject\",\n        \"s3:GetObjectVersion\",\n        \"s3:GetBucketVersioning\",\n        \"s3:List*\",\n        \"s3:PutObject\"\n      ],\n      \"Resource\": [\n        \"${aws_s3_bucket_arn}\",\n        \"${aws_s3_bucket_arn}/*\"\n      ]\n    }\n  ]\n}\n"
  },
  {
    "path": "modules/code_pipeline/policies/codebuild_role.json",
    "content": "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Principal\": {\n        \"Service\": \"codebuild.amazonaws.com\"\n      },\n      \"Action\": \"sts:AssumeRole\"\n    }\n  ]\n}\n"
  },
  {
    "path": "modules/code_pipeline/policies/codepipeline.json",
    "content": "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\":\"Allow\",\n      \"Action\": [\n        \"s3:GetObject\",\n        \"s3:GetObjectVersion\",\n        \"s3:GetBucketVersioning\",\n        \"s3:List*\",\n        \"s3:PutObject\"\n      ],\n      \"Resource\": [\n        \"${aws_s3_bucket_arn}\",\n        \"${aws_s3_bucket_arn}/*\"\n      ]\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"codebuild:BatchGetBuilds\",\n        \"codebuild:StartBuild\"\n      ],\n      \"Resource\": \"*\"\n    },\n    {\n      \"Action\": [\n        \"ecs:*\",\n        \"events:DescribeRule\",\n        \"events:DeleteRule\",\n        \"events:ListRuleNamesByTarget\",\n        \"events:ListTargetsByRule\",\n        \"events:PutRule\",\n        \"events:PutTargets\",\n        \"events:RemoveTargets\",\n        \"iam:ListAttachedRolePolicies\",\n        \"iam:ListInstanceProfiles\",\n        \"iam:ListRoles\",\n        \"logs:CreateLogGroup\",\n        \"logs:DescribeLogGroups\",\n        \"logs:FilterLogEvents\"\n      ],\n      \"Resource\": \"*\",\n      \"Effect\": \"Allow\"\n    },\n    {\n      \"Action\": \"iam:PassRole\",\n      \"Effect\": \"Allow\",\n      \"Resource\": [\n        \"*\"\n      ],\n      \"Condition\": {\n        \"StringLike\": {\n          \"iam:PassedToService\": \"ecs-tasks.amazonaws.com\"\n        }\n      }\n    },\n    {\n      \"Action\": \"iam:PassRole\",\n      \"Effect\": \"Allow\",\n      \"Resource\": [\n        \"arn:aws:iam::*:role/ecsInstanceRole*\"\n      ],\n      \"Condition\": {\n        \"StringLike\": {\n          \"iam:PassedToService\": [\n            \"ec2.amazonaws.com\",\n            \"ec2.amazonaws.com.cn\"\n          ]\n        }\n      }\n    },\n    {\n      \"Action\": \"iam:PassRole\",\n      \"Effect\": \"Allow\",\n      \"Resource\": [\n        \"arn:aws:iam::*:role/ecsAutoscaleRole*\"\n      ],\n      \"Condition\": {\n        \"StringLike\": {\n          \"iam:PassedToService\": [\n            \"application-autoscaling.amazonaws.com\",\n            \"application-autoscaling.amazonaws.com.cn\"\n          ]\n        }\n      }\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": \"iam:CreateServiceLinkedRole\",\n      \"Resource\": \"*\",\n      \"Condition\": {\n        \"StringLike\": {\n          \"iam:AWSServiceName\": [\n            \"ecs.amazonaws.com\",\n            \"spot.amazonaws.com\",\n            \"spotfleet.amazonaws.com\"\n          ]\n        }\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "modules/code_pipeline/policies/codepipeline_role.json",
    "content": "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Principal\": {\n        \"Service\": \"codepipeline.amazonaws.com\"\n      },\n      \"Action\": \"sts:AssumeRole\"\n    }\n  ]\n}\n"
  },
  {
    "path": "modules/code_pipeline/variables.tf",
    "content": "variable \"repository_url\" {\n  description = \"The url of the ECR repository\"\n}\n\nvariable \"region\" {\n  description = \"The region to use\"\n}\n\nvariable \"ecs_cluster_name\" {\n  description = \"The cluster that we will deploy\"\n}\n\nvariable \"ecs_service_name\" {\n  description = \"The ECS service that will be deployed\"\n}\n\nvariable \"run_task_subnet_id\" {\n  description = \"The subnet Id where single run task will be executed\"\n}\n\nvariable \"run_task_security_group_ids\" {\n  type        = \"list\"\n  description = \"The security group Ids attached where the single run task will be executed\"\n}\n"
  },
  {
    "path": "modules/ecs/code_pipeline/buildspec.yml",
    "content": "version: 0.2\n\nphases:\n  pre_build:\n    commands:\n      - echo Logging in to Amazon ECR...\n      - $(aws ecr get-login --region ${region} --no-include-email)\n      - REPOSITORY_URI=${repository_url}\n      - IMAGE_TAG=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)\n      - echo Entered the pre_build phase...\n  build:\n    commands:\n      - echo Build started on `date`\n      - echo Building the Docker image...\n      - docker build --build-arg build_without=\"development test\" --build-arg rails_env=\"production\" -t $REPOSITORY_URI:latest .\n      - docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG\n  post_build:\n    commands:\n      - echo Build completed on `date`\n      - echo Pushing the Docker images...\n      - docker push $REPOSITORY_URI:latest\n      - docker push $REPOSITORY_URI:$IMAGE_TAG\n      - echo Writing image definitions file...\n      - printf '[{\"name\":\"web\",\"imageUri\":\"%s\"}]' $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json\nartifacts:\n  files: imagedefinitions.json\n"
  },
  {
    "path": "modules/ecs/code_pipeline/main.tf",
    "content": "resource \"aws_s3_bucket\" \"source\" {\n  bucket        = \"openjobs-experiment-source\"\n  acl           = \"private\"\n  force_destroy = true\n}\n\nresource \"aws_iam_role\" \"codepipeline_role\" {\n  name               = \"codepipeline-role\"\n\n  assume_role_policy = \"${file(\"${path.module}/policies/codepipeline_role.json\")}\"\n}\n\n/* policies */\ndata \"template_file\" \"codepipeline_policy\" {\n  template = \"${file(\"${path.module}/policies/codepipeline.json\")}\"\n\n  vars {\n    aws_s3_bucket_arn = \"${aws_s3_bucket.source.arn}\"\n  }\n}\n\nresource \"aws_iam_role_policy\" \"codepipeline_policy\" {\n  name   = \"codepipeline_policy\"\n  role   = \"${aws_iam_role.codepipeline_role.id}\"\n  policy = \"${data.template_file.codepipeline_policy.rendered}\"\n}\n\n/*\n/* CodeBuild\n*/\nresource \"aws_iam_role\" \"codebuild_role\" {\n  name               = \"codebuild-role\"\n  assume_role_policy = \"${file(\"${path.module}/policies/codebuild_role.json\")}\"\n}\n\ndata \"template_file\" \"codebuild_policy\" {\n  template = \"${file(\"${path.module}/policies/codebuild_policy.json\")}\"\n\n  vars {\n    aws_s3_bucket_arn = \"${aws_s3_bucket.source.arn}\"\n  }\n}\n\nresource \"aws_iam_role_policy\" \"codebuild_policy\" {\n  name        = \"codebuild-policy\"\n  role        = \"${aws_iam_role.codebuild_role.id}\"\n  policy      = \"${data.template_file.codebuild_policy.rendered}\"\n}\n\ndata \"template_file\" \"buildspec\" {\n  template = \"${file(\"${path.module}/buildspec.yml\")}\"\n\n  vars {\n    repository_url = \"${var.repository_url}\"\n    region         = \"${var.region}\"\n  }\n}\n\n\nresource \"aws_codebuild_project\" \"openjobs_build\" {\n  name          = \"openjobs-codebuild\"\n  build_timeout = \"10\"\n  service_role  = \"${aws_iam_role.codebuild_role.arn}\"\n\n  artifacts {\n    type = \"CODEPIPELINE\"\n  }\n\n  environment {\n    compute_type    = \"BUILD_GENERAL1_SMALL\"\n    // https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html\n    image           = \"aws/codebuild/docker:1.12.1\"\n    type            = \"LINUX_CONTAINER\"\n    privileged_mode = true\n  }\n\n  source {\n    type      = \"CODEPIPELINE\"\n    buildspec = \"${data.template_file.buildspec.rendered}\"\n  }\n}\n\n/* CodePipeline */\n\nresource \"aws_codepipeline\" \"pipeline\" {\n  name     = \"openjobs-pipeline\"\n  role_arn = \"${aws_iam_role.codepipeline_role.arn}\"\n\n  artifact_store {\n    location = \"${aws_s3_bucket.source.bucket}\"\n    type     = \"S3\"\n  }\n\n  stage {\n    name = \"Source\"\n\n    action {\n      name             = \"Source\"\n      category         = \"Source\"\n      owner            = \"ThirdParty\"\n      provider         = \"GitHub\"\n      version          = \"1\"\n      output_artifacts = [\"source\"]\n\n      configuration {\n        Owner      = \"duduribeiro\"\n        Repo       = \"openjobs_experiment\"\n        Branch     = \"master\"\n      }\n    }\n  }\n\n  stage {\n    name = \"Build\"\n\n    action {\n      name             = \"Build\"\n      category         = \"Build\"\n      owner            = \"AWS\"\n      provider         = \"CodeBuild\"\n      version          = \"1\"\n      input_artifacts  = [\"source\"]\n      output_artifacts = [\"imagedefinitions\"]\n\n      configuration {\n        ProjectName = \"openjobs-codebuild\"\n      }\n    }\n  }\n\n  stage {\n    name = \"Production\"\n\n    action {\n      name            = \"Deploy\"\n      category        = \"Deploy\"\n      owner           = \"AWS\"\n      provider        = \"ECS\"\n      input_artifacts = [\"imagedefinitions\"]\n      version         = \"1\"\n\n      configuration {\n        ClusterName = \"${var.ecs_cluster_name}\"\n        ServiceName = \"${var.ecs_service_name}\"\n        FileName    = \"imagedefinitions.json\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "modules/ecs/code_pipeline/policies/codebuild_policy.json",
    "content": "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Resource\": [\n        \"*\"\n      ],\n      \"Action\": [\n        \"logs:CreateLogGroup\",\n        \"logs:CreateLogStream\",\n        \"logs:PutLogEvents\",\n        \"ecr:GetAuthorizationToken\",\n        \"ecr:InitiateLayerUpload\",\n        \"ecr:UploadLayerPart\",\n        \"ecr:CompleteLayerUpload\",\n        \"ecr:BatchCheckLayerAvailability\",\n        \"ecr:PutImage\"\n      ]\n    },\n    {\n      \"Effect\":\"Allow\",\n      \"Action\": [\n        \"s3:GetObject\",\n        \"s3:GetObjectVersion\",\n        \"s3:GetBucketVersioning\",\n        \"s3:List*\",\n        \"s3:PutObject\"\n      ],\n      \"Resource\": [\n        \"${aws_s3_bucket_arn}\",\n        \"${aws_s3_bucket_arn}/*\"\n      ]\n    }\n  ]\n}\n"
  },
  {
    "path": "modules/ecs/code_pipeline/policies/codebuild_role.json",
    "content": "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Principal\": {\n        \"Service\": \"codebuild.amazonaws.com\"\n      },\n      \"Action\": \"sts:AssumeRole\"\n    }\n  ]\n}\n"
  },
  {
    "path": "modules/ecs/code_pipeline/policies/codepipeline.json",
    "content": "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\":\"Allow\",\n      \"Action\": [\n        \"s3:GetObject\",\n        \"s3:GetObjectVersion\",\n        \"s3:GetBucketVersioning\",\n        \"s3:List*\",\n        \"s3:PutObject\"\n      ],\n      \"Resource\": [\n        \"${aws_s3_bucket_arn}\",\n        \"${aws_s3_bucket_arn}/*\"\n      ]\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"codebuild:BatchGetBuilds\",\n        \"codebuild:StartBuild\"\n      ],\n      \"Resource\": \"*\"\n    },\n    {\n      \"Action\": [\n        \"ecs:*\",\n        \"events:DescribeRule\",\n        \"events:DeleteRule\",\n        \"events:ListRuleNamesByTarget\",\n        \"events:ListTargetsByRule\",\n        \"events:PutRule\",\n        \"events:PutTargets\",\n        \"events:RemoveTargets\",\n        \"iam:ListAttachedRolePolicies\",\n        \"iam:ListInstanceProfiles\",\n        \"iam:ListRoles\",\n        \"logs:CreateLogGroup\",\n        \"logs:DescribeLogGroups\",\n        \"logs:FilterLogEvents\"\n      ],\n      \"Resource\": \"*\",\n      \"Effect\": \"Allow\"\n    },\n    {\n      \"Action\": \"iam:PassRole\",\n      \"Effect\": \"Allow\",\n      \"Resource\": [\n        \"*\"\n      ],\n      \"Condition\": {\n        \"StringLike\": {\n          \"iam:PassedToService\": \"ecs-tasks.amazonaws.com\"\n        }\n      }\n    },\n    {\n      \"Action\": \"iam:PassRole\",\n      \"Effect\": \"Allow\",\n      \"Resource\": [\n        \"arn:aws:iam::*:role/ecsInstanceRole*\"\n      ],\n      \"Condition\": {\n        \"StringLike\": {\n          \"iam:PassedToService\": [\n            \"ec2.amazonaws.com\",\n            \"ec2.amazonaws.com.cn\"\n          ]\n        }\n      }\n    },\n    {\n      \"Action\": \"iam:PassRole\",\n      \"Effect\": \"Allow\",\n      \"Resource\": [\n        \"arn:aws:iam::*:role/ecsAutoscaleRole*\"\n      ],\n      \"Condition\": {\n        \"StringLike\": {\n          \"iam:PassedToService\": [\n            \"application-autoscaling.amazonaws.com\",\n            \"application-autoscaling.amazonaws.com.cn\"\n          ]\n        }\n      }\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": \"iam:CreateServiceLinkedRole\",\n      \"Resource\": \"*\",\n      \"Condition\": {\n        \"StringLike\": {\n          \"iam:AWSServiceName\": [\n            \"ecs.amazonaws.com\",\n            \"spot.amazonaws.com\",\n            \"spotfleet.amazonaws.com\"\n          ]\n        }\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "modules/ecs/code_pipeline/policies/codepipeline_role.json",
    "content": "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Principal\": {\n        \"Service\": \"codepipeline.amazonaws.com\"\n      },\n      \"Action\": \"sts:AssumeRole\"\n    }\n  ]\n}\n"
  },
  {
    "path": "modules/ecs/code_pipeline/variables.tf",
    "content": "variable \"repository_url\" {\n  description = \"The url of the ECR repository\"\n}\n\nvariable \"region\" {\n  description = \"The region to use\"\n}\n\nvariable \"ecs_cluster_name\" {\n  description = \"The cluster that we will deploy\"\n}\n\nvariable \"ecs_service_name\" {\n  description = \"The ECS service that will be deployed\"\n}\n"
  },
  {
    "path": "modules/ecs/main.tf",
    "content": "/*====\nCloudwatch Log Group\n======*/\nresource \"aws_cloudwatch_log_group\" \"openjobs\" {\n  name = \"openjobs\"\n\n  tags {\n    Environment = \"${var.environment}\"\n    Application = \"OpenJobs\"\n  }\n}\n\n/*====\nECR repository to store our Docker images\n======*/\nresource \"aws_ecr_repository\" \"openjobs_app\" {\n  name = \"${var.repository_name}\"\n}\n\n/*====\nECS cluster\n======*/\nresource \"aws_ecs_cluster\" \"cluster\" {\n  name = \"${var.environment}-ecs-cluster\"\n}\n\n/*====\nECS task definitions\n======*/\n\n/* the task definition for the web service */\ndata \"template_file\" \"web_task\" {\n  template = \"${file(\"${path.module}/tasks/web_task_definition.json\")}\"\n\n  vars {\n    image           = \"${aws_ecr_repository.openjobs_app.repository_url}\"\n    secret_key_base = \"${var.secret_key_base}\"\n    database_url    = \"postgresql://${var.database_username}:${var.database_password}@${var.database_endpoint}:5432/${var.database_name}?encoding=utf8&pool=40\"\n    log_group       = \"${aws_cloudwatch_log_group.openjobs.name}\"\n  }\n}\n\nresource \"aws_ecs_task_definition\" \"web\" {\n  family                   = \"${var.environment}_web\"\n  container_definitions    = \"${data.template_file.web_task.rendered}\"\n  requires_compatibilities = [\"FARGATE\"]\n  network_mode             = \"awsvpc\"\n  cpu                      = \"256\"\n  memory                   = \"512\"\n  execution_role_arn       = \"${aws_iam_role.ecs_execution_role.arn}\"\n  task_role_arn            = \"${aws_iam_role.ecs_execution_role.arn}\"\n}\n\n/* the task definition for the db migration */\ndata \"template_file\" \"db_migrate_task\" {\n  template = \"${file(\"${path.module}/tasks/db_migrate_task_definition.json\")}\"\n\n  vars {\n    image           = \"${aws_ecr_repository.openjobs_app.repository_url}\"\n    secret_key_base = \"${var.secret_key_base}\"\n    database_url    = \"postgresql://${var.database_username}:${var.database_password}@${var.database_endpoint}:5432/${var.database_name}?encoding=utf8&pool=40\"\n    log_group       = \"openjobs\"\n  }\n}\n\nresource \"aws_ecs_task_definition\" \"db_migrate\" {\n  family                   = \"${var.environment}_db_migrate\"\n  container_definitions    = \"${data.template_file.db_migrate_task.rendered}\"\n  requires_compatibilities = [\"FARGATE\"]\n  network_mode             = \"awsvpc\"\n  cpu                      = \"256\"\n  memory                   = \"512\"\n  execution_role_arn       = \"${aws_iam_role.ecs_execution_role.arn}\"\n  task_role_arn            = \"${aws_iam_role.ecs_execution_role.arn}\"\n}\n\n/*====\nApp Load Balancer\n======*/\nresource \"random_id\" \"target_group_sufix\" {\n  byte_length = 2\n}\n\nresource \"aws_alb_target_group\" \"alb_target_group\" {\n  name     = \"${var.environment}-alb-target-group-${random_id.target_group_sufix.hex}\"\n  port     = 80\n  protocol = \"HTTP\"\n  vpc_id   = \"${var.vpc_id}\"\n  target_type = \"ip\"\n\n  lifecycle {\n    create_before_destroy = true\n  }\n}\n\n/* security group for ALB */\nresource \"aws_security_group\" \"web_inbound_sg\" {\n  name        = \"${var.environment}-web-inbound-sg\"\n  description = \"Allow HTTP from Anywhere into ALB\"\n  vpc_id      = \"${var.vpc_id}\"\n\n  ingress {\n    from_port   = 80\n    to_port     = 80\n    protocol    = \"tcp\"\n    cidr_blocks = [\"0.0.0.0/0\"]\n  }\n\n  ingress {\n    from_port   = 8\n    to_port     = 0\n    protocol    = \"icmp\"\n    cidr_blocks = [\"0.0.0.0/0\"]\n  }\n\n  egress {\n    from_port   = 0\n    to_port     = 0\n    protocol    = \"-1\"\n    cidr_blocks = [\"0.0.0.0/0\"]\n  }\n\n  tags {\n    Name = \"${var.environment}-web-inbound-sg\"\n  }\n}\n\nresource \"aws_alb\" \"alb_openjobs\" {\n  name            = \"${var.environment}-alb-openjobs\"\n  subnets         = [\"${var.public_subnet_ids}\"]\n  security_groups = [\"${var.security_groups_ids}\", \"${aws_security_group.web_inbound_sg.id}\"]\n\n  tags {\n    Name        = \"${var.environment}-alb-openjobs\"\n    Environment = \"${var.environment}\"\n  }\n}\n\nresource \"aws_alb_listener\" \"openjobs\" {\n  load_balancer_arn = \"${aws_alb.alb_openjobs.arn}\"\n  port              = \"80\"\n  protocol          = \"HTTP\"\n  depends_on        = [\"aws_alb_target_group.alb_target_group\"]\n\n  default_action {\n    target_group_arn = \"${aws_alb_target_group.alb_target_group.arn}\"\n    type             = \"forward\"\n  }\n}\n\n/*\n* IAM service role\n*/\ndata \"aws_iam_policy_document\" \"ecs_service_role\" {\n  statement {\n    effect = \"Allow\"\n    actions = [\"sts:AssumeRole\"]\n    principals {\n      type = \"Service\"\n      identifiers = [\"ecs.amazonaws.com\"]\n    }\n  }\n}\n\nresource \"aws_iam_role\" \"ecs_role\" {\n  name               = \"ecs_role\"\n  assume_role_policy = \"${data.aws_iam_policy_document.ecs_service_role.json}\"\n}\n\ndata \"aws_iam_policy_document\" \"ecs_service_policy\" {\n  statement {\n    effect = \"Allow\"\n    resources = [\"*\"]\n    actions = [\n      \"elasticloadbalancing:Describe*\",\n      \"elasticloadbalancing:DeregisterInstancesFromLoadBalancer\",\n      \"elasticloadbalancing:RegisterInstancesWithLoadBalancer\",\n      \"ec2:Describe*\",\n      \"ec2:AuthorizeSecurityGroupIngress\"\n    ]\n  }\n}\n\n/* ecs service scheduler role */\nresource \"aws_iam_role_policy\" \"ecs_service_role_policy\" {\n  name   = \"ecs_service_role_policy\"\n  #policy = \"${file(\"${path.module}/policies/ecs-service-role.json\")}\"\n  policy = \"${data.aws_iam_policy_document.ecs_service_policy.json}\"\n  role   = \"${aws_iam_role.ecs_role.id}\"\n}\n\n/* role that the Amazon ECS container agent and the Docker daemon can assume */\nresource \"aws_iam_role\" \"ecs_execution_role\" {\n  name               = \"ecs_task_execution_role\"\n  assume_role_policy = \"${file(\"${path.module}/policies/ecs-task-execution-role.json\")}\"\n}\nresource \"aws_iam_role_policy\" \"ecs_execution_role_policy\" {\n  name   = \"ecs_execution_role_policy\"\n  policy = \"${file(\"${path.module}/policies/ecs-execution-role-policy.json\")}\"\n  role   = \"${aws_iam_role.ecs_execution_role.id}\"\n}\n\n/*====\nECS service\n======*/\n\n/* Security Group for ECS */\nresource \"aws_security_group\" \"ecs_service\" {\n  vpc_id      = \"${var.vpc_id}\"\n  name        = \"${var.environment}-ecs-service-sg\"\n  description = \"Allow egress from container\"\n\n  egress {\n    from_port   = 0\n    to_port     = 0\n    protocol    = \"-1\"\n    cidr_blocks = [\"0.0.0.0/0\"]\n  }\n\n  ingress {\n    from_port   = 8\n    to_port     = 0\n    protocol    = \"icmp\"\n    cidr_blocks = [\"0.0.0.0/0\"]\n  }\n\n  tags {\n    Name        = \"${var.environment}-ecs-service-sg\"\n    Environment = \"${var.environment}\"\n  }\n}\n\n/* Simply specify the family to find the latest ACTIVE revision in that family */\ndata \"aws_ecs_task_definition\" \"web\" {\n  task_definition = \"${aws_ecs_task_definition.web.family}\"\n  depends_on = [ \"aws_ecs_task_definition.web\" ]\n}\n\nresource \"aws_ecs_service\" \"web\" {\n  name            = \"${var.environment}-web\"\n  task_definition = \"${aws_ecs_task_definition.web.family}:${max(\"${aws_ecs_task_definition.web.revision}\", \"${data.aws_ecs_task_definition.web.revision}\")}\"\n  desired_count   = 2\n  launch_type     = \"FARGATE\"\n  cluster =       \"${aws_ecs_cluster.cluster.id}\"\n  depends_on      = [\"aws_iam_role_policy.ecs_service_role_policy\"]\n\n  network_configuration {\n    security_groups = [\"${var.security_groups_ids}\", \"${aws_security_group.ecs_service.id}\"]\n    subnets         = [\"${var.subnets_ids}\"]\n  }\n\n  load_balancer {\n    target_group_arn = \"${aws_alb_target_group.alb_target_group.arn}\"\n    container_name   = \"web\"\n    container_port   = \"80\"\n  }\n\n  depends_on = [\"aws_alb_target_group.alb_target_group\"]\n}\n\n\n/*====\nAuto Scaling for ECS\n======*/\n\nresource \"aws_iam_role\" \"ecs_autoscale_role\" {\n  name               = \"${var.environment}_ecs_autoscale_role\"\n  assume_role_policy = \"${file(\"${path.module}/policies/ecs-autoscale-role.json\")}\"\n}\nresource \"aws_iam_role_policy\" \"ecs_autoscale_role_policy\" {\n  name   = \"ecs_autoscale_role_policy\"\n  policy = \"${file(\"${path.module}/policies/ecs-autoscale-role-policy.json\")}\"\n  role   = \"${aws_iam_role.ecs_autoscale_role.id}\"\n}\n\nresource \"aws_appautoscaling_target\" \"target\" {\n  service_namespace  = \"ecs\"\n  resource_id        = \"service/${aws_ecs_cluster.cluster.name}/${aws_ecs_service.web.name}\"\n  scalable_dimension = \"ecs:service:DesiredCount\"\n  role_arn           = \"${aws_iam_role.ecs_autoscale_role.arn}\"\n  min_capacity       = 2\n  max_capacity       = 4\n}\n\nresource \"aws_appautoscaling_policy\" \"up\" {\n  name                    = \"${var.environment}_scale_up\"\n  service_namespace       = \"ecs\"\n  resource_id             = \"service/${aws_ecs_cluster.cluster.name}/${aws_ecs_service.web.name}\"\n  scalable_dimension      = \"ecs:service:DesiredCount\"\n\n\n  step_scaling_policy_configuration {\n    adjustment_type         = \"ChangeInCapacity\"\n    cooldown                = 60\n    metric_aggregation_type = \"Maximum\"\n\n    step_adjustment {\n      metric_interval_lower_bound = 0\n      scaling_adjustment = 1\n    }\n  }\n\n  depends_on = [\"aws_appautoscaling_target.target\"]\n}\n\nresource \"aws_appautoscaling_policy\" \"down\" {\n  name                    = \"${var.environment}_scale_down\"\n  service_namespace       = \"ecs\"\n  resource_id             = \"service/${aws_ecs_cluster.cluster.name}/${aws_ecs_service.web.name}\"\n  scalable_dimension      = \"ecs:service:DesiredCount\"\n\n  step_scaling_policy_configuration {\n    adjustment_type         = \"ChangeInCapacity\"\n    cooldown                = 60\n    metric_aggregation_type = \"Maximum\"\n\n    step_adjustment {\n      metric_interval_lower_bound = 0\n      scaling_adjustment = -1\n    }\n  }\n\n  depends_on = [\"aws_appautoscaling_target.target\"]\n}\n\n/* metric used for auto scale */\nresource \"aws_cloudwatch_metric_alarm\" \"service_cpu_high\" {\n  alarm_name          = \"${var.environment}_openjobs_web_cpu_utilization_high\"\n  comparison_operator = \"GreaterThanOrEqualToThreshold\"\n  evaluation_periods  = \"2\"\n  metric_name         = \"CPUUtilization\"\n  namespace           = \"AWS/ECS\"\n  period              = \"60\"\n  statistic           = \"Maximum\"\n  threshold           = \"85\"\n\n  dimensions {\n    ClusterName = \"${aws_ecs_cluster.cluster.name}\"\n    ServiceName = \"${aws_ecs_service.web.name}\"\n  }\n\n  alarm_actions = [\"${aws_appautoscaling_policy.up.arn}\"]\n  ok_actions    = [\"${aws_appautoscaling_policy.down.arn}\"]\n}\n"
  },
  {
    "path": "modules/ecs/outputs.tf",
    "content": "output \"repository_url\" {\n  value = \"${aws_ecr_repository.openjobs_app.repository_url}\"\n}\n\noutput \"cluster_name\" {\n  value = \"${aws_ecs_cluster.cluster.name}\"\n}\n\noutput \"service_name\" {\n  value = \"${aws_ecs_service.web.name}\"\n}\n\noutput \"alb_dns_name\" {\n  value = \"${aws_alb.alb_openjobs.dns_name}\"\n}\n\noutput \"alb_zone_id\" {\n  value = \"${aws_alb.alb_openjobs.zone_id}\"\n}\n\noutput \"security_group_id\" {\n  value = \"${aws_security_group.ecs_service.id}\"\n}\n"
  },
  {
    "path": "modules/ecs/policies/ecs-autoscale-role-policy.json",
    "content": "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"ecs:DescribeServices\",\n        \"ecs:UpdateService\"\n      ],\n      \"Resource\": [\n        \"*\"\n      ]\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"cloudwatch:DescribeAlarms\"\n      ],\n      \"Resource\": [\n        \"*\"\n      ]\n    }\n  ]\n}\n"
  },
  {
    "path": "modules/ecs/policies/ecs-autoscale-role.json",
    "content": "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Principal\": {\n        \"Service\": \"application-autoscaling.amazonaws.com\"\n      },\n      \"Action\": \"sts:AssumeRole\"\n    }\n  ]\n}\n"
  },
  {
    "path": "modules/ecs/policies/ecs-execution-role-policy.json",
    "content": "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"ecr:GetAuthorizationToken\",\n        \"ecr:BatchCheckLayerAvailability\",\n        \"ecr:GetDownloadUrlForLayer\",\n        \"ecr:BatchGetImage\",\n        \"logs:CreateLogStream\",\n        \"logs:PutLogEvents\"\n      ],\n      \"Resource\": \"*\"\n    }\n  ]\n}\n"
  },
  {
    "path": "modules/ecs/policies/ecs-role.json",
    "content": "{\n  \"Version\": \"2008-10-17\",\n  \"Statement\": [\n    {\n      \"Action\": \"sts:AssumeRole\",\n      \"Principal\": {\n        \"Service\": [\"ecs.amazonaws.com\", \"ec2.amazonaws.com\"]\n      },\n      \"Effect\": \"Allow\"\n    }\n  ]\n}\n"
  },
  {
    "path": "modules/ecs/policies/ecs-service-role.json",
    "content": "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"elasticloadbalancing:Describe*\",\n        \"elasticloadbalancing:DeregisterInstancesFromLoadBalancer\",\n        \"elasticloadbalancing:RegisterInstancesWithLoadBalancer\",\n        \"ec2:Describe*\",\n        \"ec2:AuthorizeSecurityGroupIngress\"\n      ],\n      \"Resource\": [\n        \"*\"\n      ]\n    }\n  ]\n}\n"
  },
  {
    "path": "modules/ecs/policies/ecs-task-execution-role.json",
    "content": "{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"\",\n      \"Effect\": \"Allow\",\n      \"Principal\": {\n        \"Service\": \"ecs-tasks.amazonaws.com\"\n      },\n      \"Action\": \"sts:AssumeRole\"\n    }\n  ]\n}\n"
  },
  {
    "path": "modules/ecs/tasks/db_migrate_task_definition.json",
    "content": "[\n  {\n    \"name\": \"db-migrate\",\n    \"image\": \"${image}\",\n    \"command\": [\"bundle\", \"exec\", \"rake\", \"db:migrate\"],\n    \"memory\": 300,\n    \"logConfiguration\": {\n      \"logDriver\": \"awslogs\",\n      \"options\": {\n        \"awslogs-group\": \"${log_group}\",\n        \"awslogs-region\": \"us-east-1\",\n        \"awslogs-stream-prefix\": \"db_migrate\"\n      }\n    },\n    \"environment\": [\n      {\n        \"name\": \"RAILS_ENV\",\n        \"value\": \"production\"\n      },\n      {\n        \"name\": \"DATABASE_URL\",\n        \"value\": \"${database_url}\"\n      },\n      {\n        \"name\": \"SECRET_KEY_BASE\",\n        \"value\": \"${secret_key_base}\"\n      },\n      {\n        \"name\": \"RAILS_LOG_TO_STDOUT\",\n        \"value\": \"true\"\n      }\n    ]\n  }\n]\n"
  },
  {
    "path": "modules/ecs/tasks/web_task_definition.json",
    "content": "[\n  {\n    \"name\": \"web\",\n    \"image\": \"${image}\",\n    \"portMappings\": [\n      {\n        \"containerPort\": 80,\n        \"hostPort\": 80\n      }\n    ],\n    \"memory\": 300,\n    \"networkMode\": \"awsvpc\",\n    \"logConfiguration\": {\n      \"logDriver\": \"awslogs\",\n      \"options\": {\n        \"awslogs-group\": \"${log_group}\",\n        \"awslogs-region\": \"us-east-1\",\n        \"awslogs-stream-prefix\": \"web\"\n      }\n    },\n    \"environment\": [\n      {\n        \"name\": \"RAILS_ENV\",\n        \"value\": \"production\"\n      },\n      {\n        \"name\": \"DATABASE_URL\",\n        \"value\": \"${database_url}\"\n      },\n      {\n        \"name\": \"SECRET_KEY_BASE\",\n        \"value\": \"${secret_key_base}\"\n      },\n      {\n        \"name\": \"PORT\",\n        \"value\": \"80\"\n      },\n      {\n        \"name\": \"RAILS_LOG_TO_STDOUT\",\n        \"value\": \"true\"\n      },\n      {\n        \"name\": \"RAILS_SERVE_STATIC_FILES\",\n        \"value\": \"true\"\n      }\n    ]\n  }\n]\n\n"
  },
  {
    "path": "modules/ecs/variables.tf",
    "content": "variable \"environment\" {\n  description = \"The environment\"\n}\n\nvariable \"vpc_id\" {\n  description = \"The VPC id\"\n}\n\nvariable \"availability_zones\" {\n  type        = \"list\"\n  description = \"The azs to use\"\n}\n\nvariable \"security_groups_ids\" {\n  type        = \"list\"\n  description = \"The SGs to use\"\n}\n\nvariable \"subnets_ids\" {\n  type        = \"list\"\n  description = \"The private subnets to use\"\n}\n\nvariable \"public_subnet_ids\" {\n  type        = \"list\"\n  description = \"The private subnets to use\"\n}\n\nvariable \"database_endpoint\" {\n  description = \"The database endpoint\"\n}\n\nvariable \"database_username\" {\n  description = \"The database username\"\n}\n\nvariable \"database_password\" {\n  description = \"The database password\"\n}\n\nvariable \"database_name\" {\n  description = \"The database that the app will use\"\n}\n\nvariable \"repository_name\" {\n  description = \"The name of the repisitory\"\n}\n\nvariable \"secret_key_base\" {\n  description = \"The secret key base to use in the app\"\n}\n"
  },
  {
    "path": "modules/networking/main.tf",
    "content": "/*====\nThe VPC\n======*/\n\nresource \"aws_vpc\" \"vpc\" {\n  cidr_block           = \"${var.vpc_cidr}\"\n  enable_dns_hostnames = true\n  enable_dns_support   = true\n\n  tags {\n    Name        = \"${var.environment}-vpc\"\n    Environment = \"${var.environment}\"\n  }\n}\n\n/*====\nSubnets\n======*/\n/* Internet gateway for the public subnet */\nresource \"aws_internet_gateway\" \"ig\" {\n  vpc_id = \"${aws_vpc.vpc.id}\"\n\n  tags {\n    Name        = \"${var.environment}-igw\"\n    Environment = \"${var.environment}\"\n  }\n}\n\n\n/* Elastic IP for NAT */\nresource \"aws_eip\" \"nat_eip\" {\n  vpc        = true\n  depends_on = [\"aws_internet_gateway.ig\"]\n}\n\n/* NAT */\nresource \"aws_nat_gateway\" \"nat\" {\n  allocation_id = \"${aws_eip.nat_eip.id}\"\n  subnet_id     = \"${element(aws_subnet.public_subnet.*.id, 0)}\"\n  depends_on    = [\"aws_internet_gateway.ig\"]\n\n  tags {\n    Name        = \"${var.environment}-${element(var.availability_zones, count.index)}-nat\"\n    Environment = \"${var.environment}\"\n  }\n}\n\n/* Public subnet */\nresource \"aws_subnet\" \"public_subnet\" {\n  vpc_id                  = \"${aws_vpc.vpc.id}\"\n  count                   = \"${length(var.public_subnets_cidr)}\"\n  cidr_block              = \"${element(var.public_subnets_cidr, count.index)}\"\n  availability_zone       = \"${element(var.availability_zones, count.index)}\"\n  map_public_ip_on_launch = true\n\n  tags {\n    Name        = \"${var.environment}-${element(var.availability_zones, count.index)}-public-subnet\"\n    Environment = \"${var.environment}\"\n  }\n}\n\n/* Private subnet */\nresource \"aws_subnet\" \"private_subnet\" {\n  vpc_id                  = \"${aws_vpc.vpc.id}\"\n  count                   = \"${length(var.private_subnets_cidr)}\"\n  cidr_block              = \"${element(var.private_subnets_cidr, count.index)}\"\n  availability_zone       = \"${element(var.availability_zones, count.index)}\"\n  map_public_ip_on_launch = false\n\n  tags {\n    Name        = \"${var.environment}-${element(var.availability_zones, count.index)}-private-subnet\"\n    Environment = \"${var.environment}\"\n  }\n}\n\n/* Routing table for private subnet */\nresource \"aws_route_table\" \"private\" {\n  vpc_id = \"${aws_vpc.vpc.id}\"\n\n  tags {\n    Name        = \"${var.environment}-private-route-table\"\n    Environment = \"${var.environment}\"\n  }\n}\n\n/* Routing table for public subnet */\nresource \"aws_route_table\" \"public\" {\n  vpc_id = \"${aws_vpc.vpc.id}\"\n\n  tags {\n    Name        = \"${var.environment}-public-route-table\"\n    Environment = \"${var.environment}\"\n  }\n}\n\nresource \"aws_route\" \"public_internet_gateway\" {\n  route_table_id         = \"${aws_route_table.public.id}\"\n  destination_cidr_block = \"0.0.0.0/0\"\n  gateway_id             = \"${aws_internet_gateway.ig.id}\"\n}\n\nresource \"aws_route\" \"private_nat_gateway\" {\n  route_table_id         = \"${aws_route_table.private.id}\"\n  destination_cidr_block = \"0.0.0.0/0\"\n  nat_gateway_id         = \"${aws_nat_gateway.nat.id}\"\n}\n\n/* Route table associations */\nresource \"aws_route_table_association\" \"public\" {\n  count          = \"${length(var.public_subnets_cidr)}\"\n  subnet_id      = \"${element(aws_subnet.public_subnet.*.id, count.index)}\"\n  route_table_id = \"${aws_route_table.public.id}\"\n}\n\nresource \"aws_route_table_association\" \"private\" {\n  count           = \"${length(var.private_subnets_cidr)}\"\n  subnet_id       = \"${element(aws_subnet.private_subnet.*.id, count.index)}\"\n  route_table_id  = \"${aws_route_table.private.id}\"\n}\n\n/*====\nVPC's Default Security Group\n======*/\nresource \"aws_security_group\" \"default\" {\n  name        = \"${var.environment}-default-sg\"\n  description = \"Default security group to allow inbound/outbound from the VPC\"\n  vpc_id      = \"${aws_vpc.vpc.id}\"\n  depends_on  = [\"aws_vpc.vpc\"]\n\n  ingress {\n    from_port = \"0\"\n    to_port   = \"0\"\n    protocol  = \"-1\"\n    self      = true\n  }\n\n  egress {\n    from_port = \"0\"\n    to_port   = \"0\"\n    protocol  = \"-1\"\n    self      = \"true\"\n  }\n\n  tags {\n    Environment = \"${var.environment}\"\n  }\n}\n"
  },
  {
    "path": "modules/networking/output.tf",
    "content": "output \"vpc_id\" {\n  value = \"${aws_vpc.vpc.id}\"\n}\n\noutput \"public_subnets_id\" {\n  value = [\"${aws_subnet.public_subnet.*.id}\"]\n}\n\noutput \"private_subnets_id\" {\n  value = [\"${aws_subnet.private_subnet.*.id}\"]\n}\n\noutput \"default_sg_id\" {\n  value = \"${aws_security_group.default.id}\"\n}\n\noutput \"security_groups_ids\" {\n  value = [\"${aws_security_group.default.id}\"]\n}\n\n"
  },
  {
    "path": "modules/networking/variables.tf",
    "content": "variable \"vpc_cidr\" {\n  description = \"The CIDR block of the vpc\"\n}\n\nvariable \"public_subnets_cidr\" {\n  type        = \"list\"\n  description = \"The CIDR block for the public subnet\"\n}\n\nvariable \"private_subnets_cidr\" {\n  type        = \"list\"\n  description = \"The CIDR block for the private subnet\"\n}\n\nvariable \"environment\" {\n  description = \"The environment\"\n}\n\nvariable \"region\" {\n  description = \"The region to launch the bastion host\"\n}\n\nvariable \"availability_zones\" {\n  type        = \"list\"\n  description = \"The az that the resources will be launched\"\n}\n\nvariable \"key_name\" {\n  description = \"The public key for the bastion host\"\n}\n"
  },
  {
    "path": "modules/rds/main.tf",
    "content": "/*====\nRDS\n======*/\n\n/* subnet used by rds */\nresource \"aws_db_subnet_group\" \"rds_subnet_group\" {\n  name        = \"${var.environment}-rds-subnet-group\"\n  description = \"RDS subnet group\"\n  subnet_ids  = [\"${var.subnet_ids}\"]\n  tags {\n    Environment = \"${var.environment}\"\n  }\n}\n\n/* Security Group for resources that want to access the Database */\nresource \"aws_security_group\" \"db_access_sg\" {\n  vpc_id      = \"${var.vpc_id}\"\n  name        = \"${var.environment}-db-access-sg\"\n  description = \"Allow access to RDS\"\n\n  tags {\n    Name        = \"${var.environment}-db-access-sg\"\n    Environment = \"${var.environment}\"\n  }\n}\n\nresource \"aws_security_group\" \"rds_sg\" {\n  name = \"${var.environment}-rds-sg\"\n  description = \"${var.environment} Security Group\"\n  vpc_id = \"${var.vpc_id}\"\n  tags {\n    Name = \"${var.environment}-rds-sg\"\n    Environment =  \"${var.environment}\"\n  }\n\n  // allows traffic from the SG itself\n  ingress {\n      from_port = 0\n      to_port = 0\n      protocol = \"-1\"\n      self = true\n  }\n\n  //allow traffic for TCP 5432\n  ingress {\n      from_port = 5432\n      to_port   = 5432\n      protocol  = \"tcp\"\n      security_groups = [\"${aws_security_group.db_access_sg.id}\"]\n  }\n\n  // outbound internet access\n  egress {\n    from_port = 0\n    to_port = 0\n    protocol = \"-1\"\n    cidr_blocks = [\"0.0.0.0/0\"]\n  }\n}\n\nresource \"aws_db_instance\" \"rds\" {\n  identifier             = \"${var.environment}-database\"\n  allocated_storage      = \"${var.allocated_storage}\"\n  engine                 = \"postgres\"\n  engine_version         = \"9.6.6\"\n  instance_class         = \"${var.instance_class}\"\n  multi_az               = \"${var.multi_az}\"\n  name                   = \"${var.database_name}\"\n  username               = \"${var.database_username}\"\n  password               = \"${var.database_password}\"\n  db_subnet_group_name   = \"${aws_db_subnet_group.rds_subnet_group.id}\"\n  vpc_security_group_ids = [\"${aws_security_group.rds_sg.id}\"]\n  skip_final_snapshot    = true\n  #snapshot_identifier    = \"rds-${var.environment}-snapshot\"\n  tags {\n    Environment = \"${var.environment}\"\n  }\n}\n"
  },
  {
    "path": "modules/rds/output.tf",
    "content": "output \"rds_address\" {\n  value = \"${aws_db_instance.rds.address}\"\n}\n\noutput \"db_access_sg_id\" {\n  value = \"${aws_security_group.db_access_sg.id}\"\n}\n"
  },
  {
    "path": "modules/rds/variables.tf",
    "content": "variable \"environment\" {\n  description = \"The environment\"\n}\n\nvariable \"subnet_ids\" {\n  type        = \"list\"\n  description = \"Subnet ids\"\n}\n\nvariable \"vpc_id\" {\n  description = \"The VPC id\"\n}\n\n//variable \"allowed_security_group_id\" {\n//  description = \"The allowed security group id to connect on RDS\"\n//}\n\nvariable \"allocated_storage\" {\n  default     = \"20\"\n  description = \"The storage size in GB\"\n}\n\nvariable \"instance_class\" {\n  description = \"The instance type\"\n}\n\nvariable \"multi_az\" {\n  default     = false\n  description = \"Muti-az allowed?\"\n}\n\nvariable \"database_name\" {\n  description = \"The database name\"\n}\n\nvariable \"database_username\" {\n  description = \"The username of the database\"\n}\n\nvariable \"database_password\" {\n  description = \"The password of the database\"\n}\n"
  },
  {
    "path": "outputs.tf",
    "content": "output \"alb_dns_name\" {\n  value = \"${module.ecs.alb_dns_name}\"\n}\n"
  },
  {
    "path": "pipeline.tf",
    "content": "\nmodule \"code_pipeline\" {\n  source                      = \"./modules/code_pipeline\"\n  repository_url              = \"${module.ecs.repository_url}\"\n  region                      = \"${var.region}\"\n  ecs_service_name            = \"${module.ecs.service_name}\"\n  ecs_cluster_name            = \"${module.ecs.cluster_name}\"\n  run_task_subnet_id          = \"${module.networking.private_subnets_id[0]}\"\n  run_task_security_group_ids = [\"${module.rds.db_access_sg_id}\", \"${module.networking.security_groups_ids}\", \"${module.ecs.security_group_id}\"]\n}\n"
  },
  {
    "path": "production.tf",
    "content": "/*====\nVariables used across all modules\n======*/\nlocals {\n  production_availability_zones = [\"us-east-1a\", \"us-east-1b\"]\n}\n\nprovider \"aws\" {\n  region  = \"${var.region}\"\n  #profile = \"duduribeiro\"\n}\n\nresource \"aws_key_pair\" \"key\" {\n  key_name   = \"production_key\"\n  public_key = \"${file(\"production_key.pub\")}\"\n}\n\nmodule \"networking\" {\n  source               = \"./modules/networking\"\n  environment          = \"production\"\n  vpc_cidr             = \"10.0.0.0/16\"\n  public_subnets_cidr  = [\"10.0.1.0/24\", \"10.0.2.0/24\"]\n  private_subnets_cidr = [\"10.0.10.0/24\", \"10.0.20.0/24\"]\n  region               = \"${var.region}\"\n  availability_zones   = \"${local.production_availability_zones}\"\n  key_name             = \"production_key\"\n}\n\nmodule \"rds\" {\n  source            = \"./modules/rds\"\n  environment       = \"production\"\n  allocated_storage = \"20\"\n  database_name     = \"${var.production_database_name}\"\n  database_username = \"${var.production_database_username}\"\n  database_password = \"${var.production_database_password}\"\n  subnet_ids        = [\"${module.networking.private_subnets_id}\"]\n  vpc_id            = \"${module.networking.vpc_id}\"\n  instance_class    = \"db.t2.micro\"\n}\n\nmodule \"ecs\" {\n  source              = \"./modules/ecs\"\n  environment         = \"production\"\n  vpc_id              = \"${module.networking.vpc_id}\"\n  availability_zones  = \"${local.production_availability_zones}\"\n  repository_name     = \"openjobs/production\"\n  subnets_ids         = [\"${module.networking.private_subnets_id}\"]\n  public_subnet_ids   = [\"${module.networking.public_subnets_id}\"]\n  security_groups_ids = [\n    \"${module.networking.security_groups_ids}\",\n    \"${module.rds.db_access_sg_id}\"\n  ]\n  database_endpoint   = \"${module.rds.rds_address}\"\n  database_name       = \"${var.production_database_name}\"\n  database_username   = \"${var.production_database_username}\"\n  database_password   = \"${var.production_database_password}\"\n  secret_key_base     = \"${var.production_secret_key_base}\"\n}\n"
  },
  {
    "path": "production_key.pub",
    "content": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDySaHA85axXRL25SMnHV8+DXnsGZMcy+zuQoJURDKZRkpsbo90iZgbugGtIal/6pw8voF/z/7FBJrNaZeo05kTCbqmftnDaKnqj24OlE8p5eIiiht02rXYSKQugDP7eyVK6s8iYOE9z8FhxjsfafgXBOJedhXwZj78WaRZ17P6/vp0+BgRupCWmM9otH4maN6jTHS8A4eYgketfYVk9WDo3Yvq3i+/6KYbFp6nx0kgjpwuR2zz7kRLV/IBSxFEf5TKnrhbj+DV4WFuMQjG2VjGjtnpEw6Lfz4aQ8FsAaHac2k0sbZwuG5NYEL7p+Sgx8uKp/K2CQRoGV7pgkVfj5af production_key\n"
  },
  {
    "path": "route53.tf",
    "content": "resource \"aws_route53_delegation_set\" \"main\" {\n  reference_name = \"DynDNS\"\n}\n\nresource \"aws_route53_zone\" \"primary_route\" {\n  name              = \"${var.domain}\"\n  delegation_set_id = \"${aws_route53_delegation_set.main.id}\"\n}\n\nresource \"aws_route53_record\" \"www-prod\" {\n  zone_id = \"${aws_route53_zone.primary_route.id}\"\n  name    = \"www.${var.domain}\"\n  type    = \"A\"\n\n  alias {\n    name                    = \"${module.ecs.alb_dns_name}\"\n    zone_id                 = \"${module.ecs.alb_zone_id}\"\n    evaluate_target_health  = true\n  }\n}\n"
  },
  {
    "path": "terraform.tfstate",
    "content": "{\n    \"version\": 3,\n    \"terraform_version\": \"0.11.2\",\n    \"serial\": 21,\n    \"lineage\": \"5c7c0514-ccd7-4ff8-acfa-da519b567c34\",\n    \"modules\": [\n        {\n            \"path\": [\n                \"root\"\n            ],\n            \"outputs\": {},\n            \"resources\": {\n                \"aws_key_pair.key\": {\n                    \"type\": \"aws_key_pair\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"production_key\",\n                        \"attributes\": {\n                            \"fingerprint\": \"1c:e1:6e:32:51:dc:48:e0:14:5f:b3:fe:73:c6:ff:ef\",\n                            \"id\": \"production_key\",\n                            \"key_name\": \"production_key\",\n                            \"public_key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDySaHA85axXRL25SMnHV8+DXnsGZMcy+zuQoJURDKZRkpsbo90iZgbugGtIal/6pw8voF/z/7FBJrNaZeo05kTCbqmftnDaKnqj24OlE8p5eIiiht02rXYSKQugDP7eyVK6s8iYOE9z8FhxjsfafgXBOJedhXwZj78WaRZ17P6/vp0+BgRupCWmM9otH4maN6jTHS8A4eYgketfYVk9WDo3Yvq3i+/6KYbFp6nx0kgjpwuR2zz7kRLV/IBSxFEf5TKnrhbj+DV4WFuMQjG2VjGjtnpEw6Lfz4aQ8FsAaHac2k0sbZwuG5NYEL7p+Sgx8uKp/K2CQRoGV7pgkVfj5af production_key\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route53_delegation_set.main\": {\n                    \"type\": \"aws_route53_delegation_set\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"N1RI8P0VVZSY5D\",\n                        \"attributes\": {\n                            \"id\": \"N1RI8P0VVZSY5D\",\n                            \"name_servers.#\": \"4\",\n                            \"name_servers.0\": \"ns-1524.awsdns-62.org\",\n                            \"name_servers.1\": \"ns-2002.awsdns-58.co.uk\",\n                            \"name_servers.2\": \"ns-500.awsdns-62.com\",\n                            \"name_servers.3\": \"ns-563.awsdns-06.net\",\n                            \"reference_name\": \"DynDNS\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route53_record.www-prod\": {\n                    \"type\": \"aws_route53_record\",\n                    \"depends_on\": [\n                        \"aws_route53_zone.primary_route\",\n                        \"module.ecs\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"Z2DB0BHE7U5H9Y_www.ecsfargateexample.tk_A\",\n                        \"attributes\": {\n                            \"alias.#\": \"1\",\n                            \"alias.2656789336.evaluate_target_health\": \"true\",\n                            \"alias.2656789336.name\": \"production-alb-openjobs-651485480.us-east-1.elb.amazonaws.com\",\n                            \"alias.2656789336.zone_id\": \"Z35SXDOTRQ7X7K\",\n                            \"fqdn\": \"www.ecsfargateexample.tk\",\n                            \"health_check_id\": \"\",\n                            \"id\": \"Z2DB0BHE7U5H9Y_www.ecsfargateexample.tk_A\",\n                            \"name\": \"www.ecsfargateexample.tk\",\n                            \"records.#\": \"0\",\n                            \"set_identifier\": \"\",\n                            \"ttl\": \"0\",\n                            \"type\": \"A\",\n                            \"zone_id\": \"Z2DB0BHE7U5H9Y\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"2\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route53_zone.primary_route\": {\n                    \"type\": \"aws_route53_zone\",\n                    \"depends_on\": [\n                        \"aws_route53_delegation_set.main\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"Z2DB0BHE7U5H9Y\",\n                        \"attributes\": {\n                            \"comment\": \"Managed by Terraform\",\n                            \"delegation_set_id\": \"N1RI8P0VVZSY5D\",\n                            \"force_destroy\": \"false\",\n                            \"id\": \"Z2DB0BHE7U5H9Y\",\n                            \"name\": \"ecsfargateexample.tk\",\n                            \"name_servers.#\": \"4\",\n                            \"name_servers.0\": \"ns-1524.awsdns-62.org\",\n                            \"name_servers.1\": \"ns-2002.awsdns-58.co.uk\",\n                            \"name_servers.2\": \"ns-500.awsdns-62.com\",\n                            \"name_servers.3\": \"ns-563.awsdns-06.net\",\n                            \"tags.%\": \"0\",\n                            \"zone_id\": \"Z2DB0BHE7U5H9Y\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                }\n            },\n            \"depends_on\": []\n        },\n        {\n            \"path\": [\n                \"root\",\n                \"code_pipeline\"\n            ],\n            \"outputs\": {},\n            \"resources\": {\n                \"aws_codebuild_project.openjobs_build\": {\n                    \"type\": \"aws_codebuild_project\",\n                    \"depends_on\": [\n                        \"aws_iam_role.codebuild_role\",\n                        \"data.template_file.buildspec\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"arn:aws:codebuild:us-east-1:757895497645:project/openjobs-codebuild\",\n                        \"attributes\": {\n                            \"artifacts.#\": \"1\",\n                            \"artifacts.2731293239.location\": \"\",\n                            \"artifacts.2731293239.name\": \"openjobs-codebuild\",\n                            \"artifacts.2731293239.namespace_type\": \"\",\n                            \"artifacts.2731293239.packaging\": \"NONE\",\n                            \"artifacts.2731293239.path\": \"\",\n                            \"artifacts.2731293239.type\": \"CODEPIPELINE\",\n                            \"build_timeout\": \"10\",\n                            \"description\": \"\",\n                            \"encryption_key\": \"arn:aws:kms:us-east-1:757895497645:alias/aws/s3\",\n                            \"environment.#\": \"1\",\n                            \"environment.2882962266.compute_type\": \"BUILD_GENERAL1_SMALL\",\n                            \"environment.2882962266.environment_variable.#\": \"0\",\n                            \"environment.2882962266.image\": \"aws/codebuild/docker:1.12.1\",\n                            \"environment.2882962266.privileged_mode\": \"true\",\n                            \"environment.2882962266.type\": \"LINUX_CONTAINER\",\n                            \"id\": \"arn:aws:codebuild:us-east-1:757895497645:project/openjobs-codebuild\",\n                            \"name\": \"openjobs-codebuild\",\n                            \"service_role\": \"arn:aws:iam::757895497645:role/codebuild-role\",\n                            \"source.#\": \"1\",\n                            \"source.3557349668.auth.#\": \"0\",\n                            \"source.3557349668.buildspec\": \"version: 0.2\\n\\nphases:\\n  pre_build:\\n    commands:\\n      - pip install awscli --upgrade --user\\n      - echo `aws --version`\\n      - echo Logging in to Amazon ECR...\\n      - $(aws ecr get-login --region us-east-1 --no-include-email)\\n      - REPOSITORY_URI=757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\\n      - IMAGE_TAG=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)\\n      - echo Entered the pre_build phase...\\n  build:\\n    commands:\\n      - echo Build started on `date`\\n      - echo Building the Docker image...\\n      - docker build --build-arg build_without=\\\"development test\\\" --build-arg rails_env=\\\"production\\\" -t $REPOSITORY_URI:latest .\\n      - docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG\\n  post_build:\\n    commands:\\n      - echo Build completed on `date`\\n      - echo Pushing the Docker images...\\n      - docker push $REPOSITORY_URI:latest\\n      - docker push $REPOSITORY_URI:$IMAGE_TAG\\n      - echo Writing image definitions file...\\n      - printf '[{\\\"name\\\":\\\"web\\\",\\\"imageUri\\\":\\\"%s\\\"}]' $REPOSITORY_URI:$IMAGE_TAG \\u003e imagedefinitions.json\\n      - echo upgrading db-migrate task definitions\\n      - aws ecs run-task --launch-type FARGATE --cluster production-ecs-cluster --task-definition production_db_migrate --network-configuration \\\"awsvpcConfiguration={subnets=[subnet-de3444f1],securityGroups=[sg-2b37fd5c,sg-34438943,sg-ab4983dc]}\\\"\\nartifacts:\\n  files: imagedefinitions.json\\n\",\n                            \"source.3557349668.location\": \"\",\n                            \"source.3557349668.type\": \"CODEPIPELINE\",\n                            \"tags.%\": \"0\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_codepipeline.pipeline\": {\n                    \"type\": \"aws_codepipeline\",\n                    \"depends_on\": [\n                        \"aws_iam_role.codepipeline_role\",\n                        \"aws_s3_bucket.source\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"openjobs-pipeline\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:codepipeline:us-east-1:757895497645:openjobs-pipeline\",\n                            \"artifact_store.#\": \"1\",\n                            \"artifact_store.0.encryption_key.#\": \"0\",\n                            \"artifact_store.0.location\": \"openjobs-experiment-source\",\n                            \"artifact_store.0.type\": \"S3\",\n                            \"id\": \"openjobs-pipeline\",\n                            \"name\": \"openjobs-pipeline\",\n                            \"role_arn\": \"arn:aws:iam::757895497645:role/codepipeline-role\",\n                            \"stage.#\": \"3\",\n                            \"stage.0.action.#\": \"1\",\n                            \"stage.0.action.0.category\": \"Source\",\n                            \"stage.0.action.0.configuration.%\": \"3\",\n                            \"stage.0.action.0.configuration.Branch\": \"master\",\n                            \"stage.0.action.0.configuration.Owner\": \"duduribeiro\",\n                            \"stage.0.action.0.configuration.Repo\": \"openjobs_experiment\",\n                            \"stage.0.action.0.input_artifacts.#\": \"0\",\n                            \"stage.0.action.0.name\": \"Source\",\n                            \"stage.0.action.0.output_artifacts.#\": \"1\",\n                            \"stage.0.action.0.output_artifacts.0\": \"source\",\n                            \"stage.0.action.0.owner\": \"ThirdParty\",\n                            \"stage.0.action.0.provider\": \"GitHub\",\n                            \"stage.0.action.0.role_arn\": \"\",\n                            \"stage.0.action.0.run_order\": \"1\",\n                            \"stage.0.action.0.version\": \"1\",\n                            \"stage.0.name\": \"Source\",\n                            \"stage.1.action.#\": \"1\",\n                            \"stage.1.action.0.category\": \"Build\",\n                            \"stage.1.action.0.configuration.%\": \"1\",\n                            \"stage.1.action.0.configuration.ProjectName\": \"openjobs-codebuild\",\n                            \"stage.1.action.0.input_artifacts.#\": \"1\",\n                            \"stage.1.action.0.input_artifacts.0\": \"source\",\n                            \"stage.1.action.0.name\": \"Build\",\n                            \"stage.1.action.0.output_artifacts.#\": \"1\",\n                            \"stage.1.action.0.output_artifacts.0\": \"imagedefinitions\",\n                            \"stage.1.action.0.owner\": \"AWS\",\n                            \"stage.1.action.0.provider\": \"CodeBuild\",\n                            \"stage.1.action.0.role_arn\": \"\",\n                            \"stage.1.action.0.run_order\": \"1\",\n                            \"stage.1.action.0.version\": \"1\",\n                            \"stage.1.name\": \"Build\",\n                            \"stage.2.action.#\": \"1\",\n                            \"stage.2.action.0.category\": \"Deploy\",\n                            \"stage.2.action.0.configuration.%\": \"3\",\n                            \"stage.2.action.0.configuration.ClusterName\": \"production-ecs-cluster\",\n                            \"stage.2.action.0.configuration.FileName\": \"imagedefinitions.json\",\n                            \"stage.2.action.0.configuration.ServiceName\": \"production-web\",\n                            \"stage.2.action.0.input_artifacts.#\": \"1\",\n                            \"stage.2.action.0.input_artifacts.0\": \"imagedefinitions\",\n                            \"stage.2.action.0.name\": \"Deploy\",\n                            \"stage.2.action.0.output_artifacts.#\": \"0\",\n                            \"stage.2.action.0.owner\": \"AWS\",\n                            \"stage.2.action.0.provider\": \"ECS\",\n                            \"stage.2.action.0.role_arn\": \"\",\n                            \"stage.2.action.0.run_order\": \"1\",\n                            \"stage.2.action.0.version\": \"1\",\n                            \"stage.2.name\": \"Production\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role.codebuild_role\": {\n                    \"type\": \"aws_iam_role\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"codebuild-role\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:iam::757895497645:role/codebuild-role\",\n                            \"assume_role_policy\": \"{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\":[{\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":{\\\"Service\\\":\\\"codebuild.amazonaws.com\\\"},\\\"Action\\\":\\\"sts:AssumeRole\\\"}]}\",\n                            \"create_date\": \"2018-01-29T23:28:37Z\",\n                            \"force_detach_policies\": \"false\",\n                            \"id\": \"codebuild-role\",\n                            \"name\": \"codebuild-role\",\n                            \"path\": \"/\",\n                            \"unique_id\": \"AROAICHAQ5FCSUYX4VXQK\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role.codepipeline_role\": {\n                    \"type\": \"aws_iam_role\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"codepipeline-role\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:iam::757895497645:role/codepipeline-role\",\n                            \"assume_role_policy\": \"{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\":[{\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":{\\\"Service\\\":\\\"codepipeline.amazonaws.com\\\"},\\\"Action\\\":\\\"sts:AssumeRole\\\"}]}\",\n                            \"create_date\": \"2018-01-29T23:28:37Z\",\n                            \"force_detach_policies\": \"false\",\n                            \"id\": \"codepipeline-role\",\n                            \"name\": \"codepipeline-role\",\n                            \"path\": \"/\",\n                            \"unique_id\": \"AROAJHWRJMZIPIHK55V3Y\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role_policy.codebuild_policy\": {\n                    \"type\": \"aws_iam_role_policy\",\n                    \"depends_on\": [\n                        \"aws_iam_role.codebuild_role\",\n                        \"data.template_file.codebuild_policy\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"codebuild-role:codebuild-policy\",\n                        \"attributes\": {\n                            \"id\": \"codebuild-role:codebuild-policy\",\n                            \"name\": \"codebuild-policy\",\n                            \"policy\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ],\\n      \\\"Action\\\": [\\n        \\\"logs:CreateLogGroup\\\",\\n        \\\"logs:CreateLogStream\\\",\\n        \\\"logs:PutLogEvents\\\",\\n        \\\"ecr:GetAuthorizationToken\\\",\\n        \\\"ecr:InitiateLayerUpload\\\",\\n        \\\"ecr:UploadLayerPart\\\",\\n        \\\"ecr:CompleteLayerUpload\\\",\\n        \\\"ecr:BatchCheckLayerAvailability\\\",\\n        \\\"ecr:PutImage\\\",\\n        \\\"ecs:RunTask\\\",\\n        \\\"iam:PassRole\\\"\\n      ]\\n    },\\n    {\\n      \\\"Effect\\\":\\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"s3:GetObject\\\",\\n        \\\"s3:GetObjectVersion\\\",\\n        \\\"s3:GetBucketVersioning\\\",\\n        \\\"s3:List*\\\",\\n        \\\"s3:PutObject\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:s3:::openjobs-experiment-source\\\",\\n        \\\"arn:aws:s3:::openjobs-experiment-source/*\\\"\\n      ]\\n    }\\n  ]\\n}\\n\",\n                            \"role\": \"codebuild-role\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role_policy.codepipeline_policy\": {\n                    \"type\": \"aws_iam_role_policy\",\n                    \"depends_on\": [\n                        \"aws_iam_role.codepipeline_role\",\n                        \"data.template_file.codepipeline_policy\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"codepipeline-role:codepipeline_policy\",\n                        \"attributes\": {\n                            \"id\": \"codepipeline-role:codepipeline_policy\",\n                            \"name\": \"codepipeline_policy\",\n                            \"policy\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\":\\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"s3:GetObject\\\",\\n        \\\"s3:GetObjectVersion\\\",\\n        \\\"s3:GetBucketVersioning\\\",\\n        \\\"s3:List*\\\",\\n        \\\"s3:PutObject\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:s3:::openjobs-experiment-source\\\",\\n        \\\"arn:aws:s3:::openjobs-experiment-source/*\\\"\\n      ]\\n    },\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"codebuild:BatchGetBuilds\\\",\\n        \\\"codebuild:StartBuild\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\"\\n    },\\n    {\\n      \\\"Action\\\": [\\n        \\\"ecs:*\\\",\\n        \\\"events:DescribeRule\\\",\\n        \\\"events:DeleteRule\\\",\\n        \\\"events:ListRuleNamesByTarget\\\",\\n        \\\"events:ListTargetsByRule\\\",\\n        \\\"events:PutRule\\\",\\n        \\\"events:PutTargets\\\",\\n        \\\"events:RemoveTargets\\\",\\n        \\\"iam:ListAttachedRolePolicies\\\",\\n        \\\"iam:ListInstanceProfiles\\\",\\n        \\\"iam:ListRoles\\\",\\n        \\\"logs:CreateLogGroup\\\",\\n        \\\"logs:DescribeLogGroups\\\",\\n        \\\"logs:FilterLogEvents\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\",\\n      \\\"Effect\\\": \\\"Allow\\\"\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": \\\"ecs-tasks.amazonaws.com\\\"\\n        }\\n      }\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:iam::*:role/ecsInstanceRole*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": [\\n            \\\"ec2.amazonaws.com\\\",\\n            \\\"ec2.amazonaws.com.cn\\\"\\n          ]\\n        }\\n      }\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:iam::*:role/ecsAutoscaleRole*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": [\\n            \\\"application-autoscaling.amazonaws.com\\\",\\n            \\\"application-autoscaling.amazonaws.com.cn\\\"\\n          ]\\n        }\\n      }\\n    },\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": \\\"iam:CreateServiceLinkedRole\\\",\\n      \\\"Resource\\\": \\\"*\\\",\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:AWSServiceName\\\": [\\n            \\\"ecs.amazonaws.com\\\",\\n            \\\"spot.amazonaws.com\\\",\\n            \\\"spotfleet.amazonaws.com\\\"\\n          ]\\n        }\\n      }\\n    }\\n  ]\\n}\\n\",\n                            \"role\": \"codepipeline-role\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_s3_bucket.source\": {\n                    \"type\": \"aws_s3_bucket\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"openjobs-experiment-source\",\n                        \"attributes\": {\n                            \"acceleration_status\": \"\",\n                            \"acl\": \"private\",\n                            \"arn\": \"arn:aws:s3:::openjobs-experiment-source\",\n                            \"bucket\": \"openjobs-experiment-source\",\n                            \"bucket_domain_name\": \"openjobs-experiment-source.s3.amazonaws.com\",\n                            \"force_destroy\": \"true\",\n                            \"hosted_zone_id\": \"Z3AQBSTGFYJSTF\",\n                            \"id\": \"openjobs-experiment-source\",\n                            \"logging.#\": \"0\",\n                            \"region\": \"us-east-1\",\n                            \"request_payer\": \"BucketOwner\",\n                            \"server_side_encryption_configuration.#\": \"0\",\n                            \"tags.%\": \"0\",\n                            \"versioning.#\": \"1\",\n                            \"versioning.0.enabled\": \"false\",\n                            \"versioning.0.mfa_delete\": \"false\",\n                            \"website.#\": \"0\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"data.template_file.buildspec\": {\n                    \"type\": \"template_file\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"d42f4c5493b812443f2200de49114c35d2cd547ba38c7d33c885e7b0debfa518\",\n                        \"attributes\": {\n                            \"id\": \"d42f4c5493b812443f2200de49114c35d2cd547ba38c7d33c885e7b0debfa518\",\n                            \"rendered\": \"version: 0.2\\n\\nphases:\\n  pre_build:\\n    commands:\\n      - pip install awscli --upgrade --user\\n      - echo `aws --version`\\n      - echo Logging in to Amazon ECR...\\n      - $(aws ecr get-login --region us-east-1 --no-include-email)\\n      - REPOSITORY_URI=757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\\n      - IMAGE_TAG=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)\\n      - echo Entered the pre_build phase...\\n  build:\\n    commands:\\n      - echo Build started on `date`\\n      - echo Building the Docker image...\\n      - docker build --build-arg build_without=\\\"development test\\\" --build-arg rails_env=\\\"production\\\" -t $REPOSITORY_URI:latest .\\n      - docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG\\n  post_build:\\n    commands:\\n      - echo Build completed on `date`\\n      - echo Pushing the Docker images...\\n      - docker push $REPOSITORY_URI:latest\\n      - docker push $REPOSITORY_URI:$IMAGE_TAG\\n      - echo Writing image definitions file...\\n      - printf '[{\\\"name\\\":\\\"web\\\",\\\"imageUri\\\":\\\"%s\\\"}]' $REPOSITORY_URI:$IMAGE_TAG \\u003e imagedefinitions.json\\n      - echo upgrading db-migrate task definitions\\n      - aws ecs run-task --launch-type FARGATE --cluster production-ecs-cluster --task-definition production_db_migrate --network-configuration \\\"awsvpcConfiguration={subnets=[subnet-de3444f1],securityGroups=[sg-2b37fd5c,sg-34438943,sg-ab4983dc]}\\\"\\nartifacts:\\n  files: imagedefinitions.json\\n\",\n                            \"template\": \"version: 0.2\\n\\nphases:\\n  pre_build:\\n    commands:\\n      - pip install awscli --upgrade --user\\n      - echo `aws --version`\\n      - echo Logging in to Amazon ECR...\\n      - $(aws ecr get-login --region ${region} --no-include-email)\\n      - REPOSITORY_URI=${repository_url}\\n      - IMAGE_TAG=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)\\n      - echo Entered the pre_build phase...\\n  build:\\n    commands:\\n      - echo Build started on `date`\\n      - echo Building the Docker image...\\n      - docker build --build-arg build_without=\\\"development test\\\" --build-arg rails_env=\\\"production\\\" -t $REPOSITORY_URI:latest .\\n      - docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG\\n  post_build:\\n    commands:\\n      - echo Build completed on `date`\\n      - echo Pushing the Docker images...\\n      - docker push $REPOSITORY_URI:latest\\n      - docker push $REPOSITORY_URI:$IMAGE_TAG\\n      - echo Writing image definitions file...\\n      - printf '[{\\\"name\\\":\\\"web\\\",\\\"imageUri\\\":\\\"%s\\\"}]' $REPOSITORY_URI:$IMAGE_TAG \\u003e imagedefinitions.json\\n      - echo upgrading db-migrate task definitions\\n      - aws ecs run-task --launch-type FARGATE --cluster ${cluster_name} --task-definition production_db_migrate --network-configuration \\\"awsvpcConfiguration={subnets=[${subnet_id}],securityGroups=[${security_group_ids}]}\\\"\\nartifacts:\\n  files: imagedefinitions.json\\n\",\n                            \"vars.%\": \"5\",\n                            \"vars.cluster_name\": \"production-ecs-cluster\",\n                            \"vars.region\": \"us-east-1\",\n                            \"vars.repository_url\": \"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\",\n                            \"vars.security_group_ids\": \"sg-2b37fd5c,sg-34438943,sg-ab4983dc\",\n                            \"vars.subnet_id\": \"subnet-de3444f1\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.template\"\n                },\n                \"data.template_file.codebuild_policy\": {\n                    \"type\": \"template_file\",\n                    \"depends_on\": [\n                        \"aws_s3_bucket.source\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"4c055009a1c510d22095df9aa79e4ae22ef6052f6fd5a4b27335c19c815dfc63\",\n                        \"attributes\": {\n                            \"id\": \"4c055009a1c510d22095df9aa79e4ae22ef6052f6fd5a4b27335c19c815dfc63\",\n                            \"rendered\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ],\\n      \\\"Action\\\": [\\n        \\\"logs:CreateLogGroup\\\",\\n        \\\"logs:CreateLogStream\\\",\\n        \\\"logs:PutLogEvents\\\",\\n        \\\"ecr:GetAuthorizationToken\\\",\\n        \\\"ecr:InitiateLayerUpload\\\",\\n        \\\"ecr:UploadLayerPart\\\",\\n        \\\"ecr:CompleteLayerUpload\\\",\\n        \\\"ecr:BatchCheckLayerAvailability\\\",\\n        \\\"ecr:PutImage\\\",\\n        \\\"ecs:RunTask\\\",\\n        \\\"iam:PassRole\\\"\\n      ]\\n    },\\n    {\\n      \\\"Effect\\\":\\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"s3:GetObject\\\",\\n        \\\"s3:GetObjectVersion\\\",\\n        \\\"s3:GetBucketVersioning\\\",\\n        \\\"s3:List*\\\",\\n        \\\"s3:PutObject\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:s3:::openjobs-experiment-source\\\",\\n        \\\"arn:aws:s3:::openjobs-experiment-source/*\\\"\\n      ]\\n    }\\n  ]\\n}\\n\",\n                            \"template\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ],\\n      \\\"Action\\\": [\\n        \\\"logs:CreateLogGroup\\\",\\n        \\\"logs:CreateLogStream\\\",\\n        \\\"logs:PutLogEvents\\\",\\n        \\\"ecr:GetAuthorizationToken\\\",\\n        \\\"ecr:InitiateLayerUpload\\\",\\n        \\\"ecr:UploadLayerPart\\\",\\n        \\\"ecr:CompleteLayerUpload\\\",\\n        \\\"ecr:BatchCheckLayerAvailability\\\",\\n        \\\"ecr:PutImage\\\",\\n        \\\"ecs:RunTask\\\",\\n        \\\"iam:PassRole\\\"\\n      ]\\n    },\\n    {\\n      \\\"Effect\\\":\\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"s3:GetObject\\\",\\n        \\\"s3:GetObjectVersion\\\",\\n        \\\"s3:GetBucketVersioning\\\",\\n        \\\"s3:List*\\\",\\n        \\\"s3:PutObject\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"${aws_s3_bucket_arn}\\\",\\n        \\\"${aws_s3_bucket_arn}/*\\\"\\n      ]\\n    }\\n  ]\\n}\\n\",\n                            \"vars.%\": \"1\",\n                            \"vars.aws_s3_bucket_arn\": \"arn:aws:s3:::openjobs-experiment-source\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.template\"\n                },\n                \"data.template_file.codepipeline_policy\": {\n                    \"type\": \"template_file\",\n                    \"depends_on\": [\n                        \"aws_s3_bucket.source\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"ab9ecdafdd89d3679ee56bbe11c6c8dbd04026580dc57ff1987a66c5b4e69fa6\",\n                        \"attributes\": {\n                            \"id\": \"ab9ecdafdd89d3679ee56bbe11c6c8dbd04026580dc57ff1987a66c5b4e69fa6\",\n                            \"rendered\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\":\\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"s3:GetObject\\\",\\n        \\\"s3:GetObjectVersion\\\",\\n        \\\"s3:GetBucketVersioning\\\",\\n        \\\"s3:List*\\\",\\n        \\\"s3:PutObject\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:s3:::openjobs-experiment-source\\\",\\n        \\\"arn:aws:s3:::openjobs-experiment-source/*\\\"\\n      ]\\n    },\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"codebuild:BatchGetBuilds\\\",\\n        \\\"codebuild:StartBuild\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\"\\n    },\\n    {\\n      \\\"Action\\\": [\\n        \\\"ecs:*\\\",\\n        \\\"events:DescribeRule\\\",\\n        \\\"events:DeleteRule\\\",\\n        \\\"events:ListRuleNamesByTarget\\\",\\n        \\\"events:ListTargetsByRule\\\",\\n        \\\"events:PutRule\\\",\\n        \\\"events:PutTargets\\\",\\n        \\\"events:RemoveTargets\\\",\\n        \\\"iam:ListAttachedRolePolicies\\\",\\n        \\\"iam:ListInstanceProfiles\\\",\\n        \\\"iam:ListRoles\\\",\\n        \\\"logs:CreateLogGroup\\\",\\n        \\\"logs:DescribeLogGroups\\\",\\n        \\\"logs:FilterLogEvents\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\",\\n      \\\"Effect\\\": \\\"Allow\\\"\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": \\\"ecs-tasks.amazonaws.com\\\"\\n        }\\n      }\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:iam::*:role/ecsInstanceRole*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": [\\n            \\\"ec2.amazonaws.com\\\",\\n            \\\"ec2.amazonaws.com.cn\\\"\\n          ]\\n        }\\n      }\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:iam::*:role/ecsAutoscaleRole*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": [\\n            \\\"application-autoscaling.amazonaws.com\\\",\\n            \\\"application-autoscaling.amazonaws.com.cn\\\"\\n          ]\\n        }\\n      }\\n    },\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": \\\"iam:CreateServiceLinkedRole\\\",\\n      \\\"Resource\\\": \\\"*\\\",\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:AWSServiceName\\\": [\\n            \\\"ecs.amazonaws.com\\\",\\n            \\\"spot.amazonaws.com\\\",\\n            \\\"spotfleet.amazonaws.com\\\"\\n          ]\\n        }\\n      }\\n    }\\n  ]\\n}\\n\",\n                            \"template\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\":\\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"s3:GetObject\\\",\\n        \\\"s3:GetObjectVersion\\\",\\n        \\\"s3:GetBucketVersioning\\\",\\n        \\\"s3:List*\\\",\\n        \\\"s3:PutObject\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"${aws_s3_bucket_arn}\\\",\\n        \\\"${aws_s3_bucket_arn}/*\\\"\\n      ]\\n    },\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"codebuild:BatchGetBuilds\\\",\\n        \\\"codebuild:StartBuild\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\"\\n    },\\n    {\\n      \\\"Action\\\": [\\n        \\\"ecs:*\\\",\\n        \\\"events:DescribeRule\\\",\\n        \\\"events:DeleteRule\\\",\\n        \\\"events:ListRuleNamesByTarget\\\",\\n        \\\"events:ListTargetsByRule\\\",\\n        \\\"events:PutRule\\\",\\n        \\\"events:PutTargets\\\",\\n        \\\"events:RemoveTargets\\\",\\n        \\\"iam:ListAttachedRolePolicies\\\",\\n        \\\"iam:ListInstanceProfiles\\\",\\n        \\\"iam:ListRoles\\\",\\n        \\\"logs:CreateLogGroup\\\",\\n        \\\"logs:DescribeLogGroups\\\",\\n        \\\"logs:FilterLogEvents\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\",\\n      \\\"Effect\\\": \\\"Allow\\\"\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": \\\"ecs-tasks.amazonaws.com\\\"\\n        }\\n      }\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:iam::*:role/ecsInstanceRole*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": [\\n            \\\"ec2.amazonaws.com\\\",\\n            \\\"ec2.amazonaws.com.cn\\\"\\n          ]\\n        }\\n      }\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:iam::*:role/ecsAutoscaleRole*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": [\\n            \\\"application-autoscaling.amazonaws.com\\\",\\n            \\\"application-autoscaling.amazonaws.com.cn\\\"\\n          ]\\n        }\\n      }\\n    },\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": \\\"iam:CreateServiceLinkedRole\\\",\\n      \\\"Resource\\\": \\\"*\\\",\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:AWSServiceName\\\": [\\n            \\\"ecs.amazonaws.com\\\",\\n            \\\"spot.amazonaws.com\\\",\\n            \\\"spotfleet.amazonaws.com\\\"\\n          ]\\n        }\\n      }\\n    }\\n  ]\\n}\\n\",\n                            \"vars.%\": \"1\",\n                            \"vars.aws_s3_bucket_arn\": \"arn:aws:s3:::openjobs-experiment-source\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.template\"\n                }\n            },\n            \"depends_on\": []\n        },\n        {\n            \"path\": [\n                \"root\",\n                \"ecs\"\n            ],\n            \"outputs\": {\n                \"alb_dns_name\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"production-alb-openjobs-651485480.us-east-1.elb.amazonaws.com\"\n                },\n                \"alb_zone_id\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"Z35SXDOTRQ7X7K\"\n                },\n                \"cluster_name\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"production-ecs-cluster\"\n                },\n                \"repository_url\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\"\n                },\n                \"security_group_id\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"sg-ab4983dc\"\n                },\n                \"service_name\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"production-web\"\n                }\n            },\n            \"resources\": {\n                \"aws_alb.alb_openjobs\": {\n                    \"type\": \"aws_alb\",\n                    \"depends_on\": [\n                        \"aws_security_group.web_inbound_sg\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:loadbalancer/app/production-alb-openjobs/e05233787da23cb4\",\n                        \"attributes\": {\n                            \"access_logs.#\": \"0\",\n                            \"arn\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:loadbalancer/app/production-alb-openjobs/e05233787da23cb4\",\n                            \"arn_suffix\": \"app/production-alb-openjobs/e05233787da23cb4\",\n                            \"dns_name\": \"production-alb-openjobs-651485480.us-east-1.elb.amazonaws.com\",\n                            \"enable_deletion_protection\": \"false\",\n                            \"id\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:loadbalancer/app/production-alb-openjobs/e05233787da23cb4\",\n                            \"idle_timeout\": \"60\",\n                            \"internal\": \"false\",\n                            \"ip_address_type\": \"ipv4\",\n                            \"load_balancer_type\": \"application\",\n                            \"name\": \"production-alb-openjobs\",\n                            \"security_groups.#\": \"3\",\n                            \"security_groups.2014916961\": \"sg-34438943\",\n                            \"security_groups.569761485\": \"sg-2b37fd5c\",\n                            \"security_groups.796629976\": \"sg-9c36fceb\",\n                            \"subnets.#\": \"2\",\n                            \"subnets.1535720245\": \"subnet-6537474a\",\n                            \"subnets.2382224226\": \"subnet-08774e43\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-alb-openjobs\",\n                            \"vpc_id\": \"vpc-32041f4a\",\n                            \"zone_id\": \"Z35SXDOTRQ7X7K\"\n                        },\n                        \"meta\": {\n                            \"e2bfb730-ecaa-11e6-8f88-34363bc7c4c0\": {\n                                \"create\": 600000000000,\n                                \"delete\": 600000000000,\n                                \"update\": 600000000000\n                            }\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_alb_listener.openjobs\": {\n                    \"type\": \"aws_alb_listener\",\n                    \"depends_on\": [\n                        \"aws_alb.alb_openjobs\",\n                        \"aws_alb_target_group.alb_target_group\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:listener/app/production-alb-openjobs/e05233787da23cb4/f40e25cfcd5b6579\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:listener/app/production-alb-openjobs/e05233787da23cb4/f40e25cfcd5b6579\",\n                            \"default_action.#\": \"1\",\n                            \"default_action.0.target_group_arn\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:targetgroup/production-alb-target-group-f14c/64f397ce227b864f\",\n                            \"default_action.0.type\": \"forward\",\n                            \"id\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:listener/app/production-alb-openjobs/e05233787da23cb4/f40e25cfcd5b6579\",\n                            \"load_balancer_arn\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:loadbalancer/app/production-alb-openjobs/e05233787da23cb4\",\n                            \"port\": \"80\",\n                            \"protocol\": \"HTTP\",\n                            \"ssl_policy\": \"\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_alb_target_group.alb_target_group\": {\n                    \"type\": \"aws_alb_target_group\",\n                    \"depends_on\": [\n                        \"random_id.target_group_sufix\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:targetgroup/production-alb-target-group-f14c/64f397ce227b864f\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:targetgroup/production-alb-target-group-f14c/64f397ce227b864f\",\n                            \"arn_suffix\": \"targetgroup/production-alb-target-group-f14c/64f397ce227b864f\",\n                            \"deregistration_delay\": \"300\",\n                            \"health_check.#\": \"1\",\n                            \"health_check.0.healthy_threshold\": \"5\",\n                            \"health_check.0.interval\": \"30\",\n                            \"health_check.0.matcher\": \"200\",\n                            \"health_check.0.path\": \"/\",\n                            \"health_check.0.port\": \"traffic-port\",\n                            \"health_check.0.protocol\": \"HTTP\",\n                            \"health_check.0.timeout\": \"5\",\n                            \"health_check.0.unhealthy_threshold\": \"2\",\n                            \"id\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:targetgroup/production-alb-target-group-f14c/64f397ce227b864f\",\n                            \"name\": \"production-alb-target-group-f14c\",\n                            \"port\": \"80\",\n                            \"protocol\": \"HTTP\",\n                            \"stickiness.#\": \"1\",\n                            \"stickiness.0.cookie_duration\": \"86400\",\n                            \"stickiness.0.enabled\": \"false\",\n                            \"stickiness.0.type\": \"lb_cookie\",\n                            \"tags.%\": \"0\",\n                            \"target_type\": \"ip\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_appautoscaling_policy.down\": {\n                    \"type\": \"aws_appautoscaling_policy\",\n                    \"depends_on\": [\n                        \"aws_appautoscaling_target.target\",\n                        \"aws_ecs_cluster.cluster\",\n                        \"aws_ecs_service.web\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"production_scale_down\",\n                        \"attributes\": {\n                            \"alarms.#\": \"0\",\n                            \"arn\": \"arn:aws:autoscaling:us-east-1:757895497645:scalingPolicy:4b2eb401-228f-42bb-a58c-97f439ab6844:resource/ecs/service/production-ecs-cluster/production-web:policyName/production_scale_down\",\n                            \"id\": \"production_scale_down\",\n                            \"name\": \"production_scale_down\",\n                            \"policy_type\": \"StepScaling\",\n                            \"resource_id\": \"service/production-ecs-cluster/production-web\",\n                            \"scalable_dimension\": \"ecs:service:DesiredCount\",\n                            \"service_namespace\": \"ecs\",\n                            \"step_scaling_policy_configuration.#\": \"1\",\n                            \"step_scaling_policy_configuration.0.adjustment_type\": \"ChangeInCapacity\",\n                            \"step_scaling_policy_configuration.0.cooldown\": \"60\",\n                            \"step_scaling_policy_configuration.0.metric_aggregation_type\": \"Maximum\",\n                            \"step_scaling_policy_configuration.0.min_adjustment_magnitude\": \"0\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.#\": \"1\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.1330763481.metric_interval_lower_bound\": \"0\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.1330763481.metric_interval_upper_bound\": \"-1\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.1330763481.scaling_adjustment\": \"-1\",\n                            \"target_tracking_scaling_policy_configuration.#\": \"0\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_appautoscaling_policy.up\": {\n                    \"type\": \"aws_appautoscaling_policy\",\n                    \"depends_on\": [\n                        \"aws_appautoscaling_target.target\",\n                        \"aws_ecs_cluster.cluster\",\n                        \"aws_ecs_service.web\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"production_scale_up\",\n                        \"attributes\": {\n                            \"alarms.#\": \"0\",\n                            \"arn\": \"arn:aws:autoscaling:us-east-1:757895497645:scalingPolicy:4b2eb401-228f-42bb-a58c-97f439ab6844:resource/ecs/service/production-ecs-cluster/production-web:policyName/production_scale_up\",\n                            \"id\": \"production_scale_up\",\n                            \"name\": \"production_scale_up\",\n                            \"policy_type\": \"StepScaling\",\n                            \"resource_id\": \"service/production-ecs-cluster/production-web\",\n                            \"scalable_dimension\": \"ecs:service:DesiredCount\",\n                            \"service_namespace\": \"ecs\",\n                            \"step_scaling_policy_configuration.#\": \"1\",\n                            \"step_scaling_policy_configuration.0.adjustment_type\": \"ChangeInCapacity\",\n                            \"step_scaling_policy_configuration.0.cooldown\": \"60\",\n                            \"step_scaling_policy_configuration.0.metric_aggregation_type\": \"Maximum\",\n                            \"step_scaling_policy_configuration.0.min_adjustment_magnitude\": \"0\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.#\": \"1\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.2280411133.metric_interval_lower_bound\": \"0\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.2280411133.metric_interval_upper_bound\": \"-1\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.2280411133.scaling_adjustment\": \"1\",\n                            \"target_tracking_scaling_policy_configuration.#\": \"0\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_appautoscaling_target.target\": {\n                    \"type\": \"aws_appautoscaling_target\",\n                    \"depends_on\": [\n                        \"aws_ecs_cluster.cluster\",\n                        \"aws_ecs_service.web\",\n                        \"aws_iam_role.ecs_autoscale_role\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"service/production-ecs-cluster/production-web\",\n                        \"attributes\": {\n                            \"id\": \"service/production-ecs-cluster/production-web\",\n                            \"max_capacity\": \"4\",\n                            \"min_capacity\": \"2\",\n                            \"resource_id\": \"service/production-ecs-cluster/production-web\",\n                            \"role_arn\": \"arn:aws:iam::757895497645:role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService\",\n                            \"scalable_dimension\": \"ecs:service:DesiredCount\",\n                            \"service_namespace\": \"ecs\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_cloudwatch_log_group.openjobs\": {\n                    \"type\": \"aws_cloudwatch_log_group\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"openjobs\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:logs:us-east-1:757895497645:log-group:openjobs:*\",\n                            \"id\": \"openjobs\",\n                            \"kms_key_id\": \"\",\n                            \"name\": \"openjobs\",\n                            \"retention_in_days\": \"0\",\n                            \"tags.%\": \"2\",\n                            \"tags.Application\": \"OpenJobs\",\n                            \"tags.Environment\": \"production\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_cloudwatch_metric_alarm.service_cpu_high\": {\n                    \"type\": \"aws_cloudwatch_metric_alarm\",\n                    \"depends_on\": [\n                        \"aws_appautoscaling_policy.down\",\n                        \"aws_appautoscaling_policy.up\",\n                        \"aws_ecs_cluster.cluster\",\n                        \"aws_ecs_service.web\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"production_openjobs_web_cpu_utilization_high\",\n                        \"attributes\": {\n                            \"actions_enabled\": \"true\",\n                            \"alarm_actions.#\": \"1\",\n                            \"alarm_actions.2876257399\": \"arn:aws:autoscaling:us-east-1:757895497645:scalingPolicy:4b2eb401-228f-42bb-a58c-97f439ab6844:resource/ecs/service/production-ecs-cluster/production-web:policyName/production_scale_up\",\n                            \"alarm_description\": \"\",\n                            \"alarm_name\": \"production_openjobs_web_cpu_utilization_high\",\n                            \"comparison_operator\": \"GreaterThanOrEqualToThreshold\",\n                            \"datapoints_to_alarm\": \"0\",\n                            \"dimensions.%\": \"2\",\n                            \"dimensions.ClusterName\": \"production-ecs-cluster\",\n                            \"dimensions.ServiceName\": \"production-web\",\n                            \"evaluate_low_sample_count_percentiles\": \"\",\n                            \"evaluation_periods\": \"2\",\n                            \"extended_statistic\": \"\",\n                            \"id\": \"production_openjobs_web_cpu_utilization_high\",\n                            \"insufficient_data_actions.#\": \"0\",\n                            \"metric_name\": \"CPUUtilization\",\n                            \"namespace\": \"AWS/ECS\",\n                            \"ok_actions.#\": \"1\",\n                            \"ok_actions.901305810\": \"arn:aws:autoscaling:us-east-1:757895497645:scalingPolicy:4b2eb401-228f-42bb-a58c-97f439ab6844:resource/ecs/service/production-ecs-cluster/production-web:policyName/production_scale_down\",\n                            \"period\": \"60\",\n                            \"statistic\": \"Maximum\",\n                            \"threshold\": \"85\",\n                            \"treat_missing_data\": \"missing\",\n                            \"unit\": \"\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_ecr_repository.openjobs_app\": {\n                    \"type\": \"aws_ecr_repository\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"openjobs/production\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:ecr:us-east-1:757895497645:repository/openjobs/production\",\n                            \"id\": \"openjobs/production\",\n                            \"name\": \"openjobs/production\",\n                            \"registry_id\": \"757895497645\",\n                            \"repository_url\": \"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_ecs_cluster.cluster\": {\n                    \"type\": \"aws_ecs_cluster\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"arn:aws:ecs:us-east-1:757895497645:cluster/production-ecs-cluster\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:ecs:us-east-1:757895497645:cluster/production-ecs-cluster\",\n                            \"id\": \"arn:aws:ecs:us-east-1:757895497645:cluster/production-ecs-cluster\",\n                            \"name\": \"production-ecs-cluster\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_ecs_service.web\": {\n                    \"type\": \"aws_ecs_service\",\n                    \"depends_on\": [\n                        \"aws_alb_target_group.alb_target_group\",\n                        \"aws_ecs_cluster.cluster\",\n                        \"aws_ecs_task_definition.web\",\n                        \"aws_iam_role_policy.ecs_service_role_policy\",\n                        \"aws_security_group.ecs_service\",\n                        \"data.aws_ecs_task_definition.web\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"arn:aws:ecs:us-east-1:757895497645:service/production-web\",\n                        \"attributes\": {\n                            \"cluster\": \"arn:aws:ecs:us-east-1:757895497645:cluster/production-ecs-cluster\",\n                            \"deployment_maximum_percent\": \"200\",\n                            \"deployment_minimum_healthy_percent\": \"100\",\n                            \"desired_count\": \"2\",\n                            \"health_check_grace_period_seconds\": \"0\",\n                            \"iam_role\": \"aws-service-role\",\n                            \"id\": \"arn:aws:ecs:us-east-1:757895497645:service/production-web\",\n                            \"launch_type\": \"FARGATE\",\n                            \"load_balancer.#\": \"1\",\n                            \"load_balancer.3261201814.container_name\": \"web\",\n                            \"load_balancer.3261201814.container_port\": \"80\",\n                            \"load_balancer.3261201814.elb_name\": \"\",\n                            \"load_balancer.3261201814.target_group_arn\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:targetgroup/production-alb-target-group-f14c/64f397ce227b864f\",\n                            \"name\": \"production-web\",\n                            \"network_configuration.#\": \"1\",\n                            \"network_configuration.0.security_groups.#\": \"3\",\n                            \"network_configuration.0.security_groups.2014916961\": \"sg-34438943\",\n                            \"network_configuration.0.security_groups.3119024256\": \"sg-ab4983dc\",\n                            \"network_configuration.0.security_groups.569761485\": \"sg-2b37fd5c\",\n                            \"network_configuration.0.subnets.#\": \"2\",\n                            \"network_configuration.0.subnets.3113454962\": \"subnet-30625b7b\",\n                            \"network_configuration.0.subnets.3378482322\": \"subnet-de3444f1\",\n                            \"placement_constraints.#\": \"0\",\n                            \"placement_strategy.#\": \"0\",\n                            \"task_definition\": \"production_web:18\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_ecs_task_definition.db_migrate\": {\n                    \"type\": \"aws_ecs_task_definition\",\n                    \"depends_on\": [\n                        \"aws_iam_role.ecs_execution_role\",\n                        \"data.template_file.db_migrate_task\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"production_db_migrate\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:ecs:us-east-1:757895497645:task-definition/production_db_migrate:3\",\n                            \"container_definitions\": \"[{\\\"command\\\":[\\\"bundle\\\",\\\"exec\\\",\\\"rake\\\",\\\"db:migrate\\\"],\\\"cpu\\\":0,\\\"environment\\\":[{\\\"name\\\":\\\"RAILS_LOG_TO_STDOUT\\\",\\\"value\\\":\\\"true\\\"},{\\\"name\\\":\\\"RAILS_ENV\\\",\\\"value\\\":\\\"production\\\"},{\\\"name\\\":\\\"DATABASE_URL\\\",\\\"value\\\":\\\"postgresql://openjobs:myawesomepasswordproduction@production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com:5432/openjobs_production?encoding=utf8\\u0026pool=40\\\"},{\\\"name\\\":\\\"SECRET_KEY_BASE\\\",\\\"value\\\":\\\"8d412aee3ceaa494fe1c276f5f7e524b9e33f649c03690e689e5b36a0cf4ce2a6f50024bc31f276c22b668e619d61a42b79f5e595759f377a8fa373e2907f41e\\\"}],\\\"essential\\\":true,\\\"image\\\":\\\"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\\\",\\\"logConfiguration\\\":{\\\"logDriver\\\":\\\"awslogs\\\",\\\"options\\\":{\\\"awslogs-group\\\":\\\"openjobs\\\",\\\"awslogs-region\\\":\\\"us-east-1\\\",\\\"awslogs-stream-prefix\\\":\\\"db_migrate\\\"}},\\\"memory\\\":300,\\\"mountPoints\\\":[],\\\"name\\\":\\\"db-migrate\\\",\\\"portMappings\\\":[],\\\"volumesFrom\\\":[]}]\",\n                            \"cpu\": \"256\",\n                            \"execution_role_arn\": \"arn:aws:iam::757895497645:role/ecs_task_execution_role\",\n                            \"family\": \"production_db_migrate\",\n                            \"id\": \"production_db_migrate\",\n                            \"memory\": \"512\",\n                            \"network_mode\": \"awsvpc\",\n                            \"placement_constraints.#\": \"0\",\n                            \"requires_compatibilities.#\": \"1\",\n                            \"requires_compatibilities.3072437307\": \"FARGATE\",\n                            \"revision\": \"3\",\n                            \"task_role_arn\": \"arn:aws:iam::757895497645:role/ecs_task_execution_role\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_ecs_task_definition.web\": {\n                    \"type\": \"aws_ecs_task_definition\",\n                    \"depends_on\": [\n                        \"aws_ecs_task_definition.web\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"production_web\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:ecs:us-east-1:757895497645:task-definition/production_web:15\",\n                            \"container_definitions\": \"[{\\\"cpu\\\":0,\\\"environment\\\":[{\\\"name\\\":\\\"RAILS_LOG_TO_STDOUT\\\",\\\"value\\\":\\\"true\\\"},{\\\"name\\\":\\\"RAILS_ENV\\\",\\\"value\\\":\\\"production\\\"},{\\\"name\\\":\\\"RAILS_SERVE_STATIC_FILES\\\",\\\"value\\\":\\\"true\\\"},{\\\"name\\\":\\\"DATABASE_URL\\\",\\\"value\\\":\\\"postgresql://openjobs:myawesomepasswordproduction@production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com:5432/openjobs_production?encoding=utf8\\u0026pool=40\\\"},{\\\"name\\\":\\\"PORT\\\",\\\"value\\\":\\\"80\\\"},{\\\"name\\\":\\\"SECRET_KEY_BASE\\\",\\\"value\\\":\\\"8d412aee3ceaa494fe1c276f5f7e524b9e33f649c03690e689e5b36a0cf4ce2a6f50024bc31f276c22b668e619d61a42b79f5e595759f377a8fa373e2907f41e\\\"}],\\\"essential\\\":true,\\\"image\\\":\\\"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\\\",\\\"logConfiguration\\\":{\\\"logDriver\\\":\\\"awslogs\\\",\\\"options\\\":{\\\"awslogs-group\\\":\\\"openjobs\\\",\\\"awslogs-region\\\":\\\"us-east-1\\\",\\\"awslogs-stream-prefix\\\":\\\"web\\\"}},\\\"memory\\\":300,\\\"mountPoints\\\":[],\\\"name\\\":\\\"web\\\",\\\"portMappings\\\":[{\\\"containerPort\\\":80,\\\"hostPort\\\":80,\\\"protocol\\\":\\\"tcp\\\"}],\\\"volumesFrom\\\":[]}]\",\n                            \"cpu\": \"256\",\n                            \"execution_role_arn\": \"arn:aws:iam::757895497645:role/ecs_task_execution_role\",\n                            \"family\": \"production_web\",\n                            \"id\": \"production_web\",\n                            \"memory\": \"512\",\n                            \"network_mode\": \"awsvpc\",\n                            \"placement_constraints.#\": \"0\",\n                            \"requires_compatibilities.#\": \"1\",\n                            \"requires_compatibilities.3072437307\": \"FARGATE\",\n                            \"revision\": \"15\",\n                            \"task_role_arn\": \"arn:aws:iam::757895497645:role/ecs_task_execution_role\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role.ecs_autoscale_role\": {\n                    \"type\": \"aws_iam_role\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"production_ecs_autoscale_role\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:iam::757895497645:role/production_ecs_autoscale_role\",\n                            \"assume_role_policy\": \"{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\":[{\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":{\\\"Service\\\":\\\"application-autoscaling.amazonaws.com\\\"},\\\"Action\\\":\\\"sts:AssumeRole\\\"}]}\",\n                            \"create_date\": \"2018-01-29T23:28:37Z\",\n                            \"force_detach_policies\": \"false\",\n                            \"id\": \"production_ecs_autoscale_role\",\n                            \"name\": \"production_ecs_autoscale_role\",\n                            \"path\": \"/\",\n                            \"unique_id\": \"AROAJVPUE3QI2CNQV4IDS\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role.ecs_execution_role\": {\n                    \"type\": \"aws_iam_role\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"ecs_task_execution_role\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:iam::757895497645:role/ecs_task_execution_role\",\n                            \"assume_role_policy\": \"{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\":[{\\\"Sid\\\":\\\"\\\",\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":{\\\"Service\\\":\\\"ecs-tasks.amazonaws.com\\\"},\\\"Action\\\":\\\"sts:AssumeRole\\\"}]}\",\n                            \"create_date\": \"2018-01-29T23:28:37Z\",\n                            \"force_detach_policies\": \"false\",\n                            \"id\": \"ecs_task_execution_role\",\n                            \"name\": \"ecs_task_execution_role\",\n                            \"path\": \"/\",\n                            \"unique_id\": \"AROAICQO62AXRIGA7AA4K\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role.ecs_role\": {\n                    \"type\": \"aws_iam_role\",\n                    \"depends_on\": [\n                        \"data.aws_iam_policy_document.ecs_service_role\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"ecs_role\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:iam::757895497645:role/ecs_role\",\n                            \"assume_role_policy\": \"{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\":[{\\\"Sid\\\":\\\"\\\",\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":{\\\"Service\\\":\\\"ecs.amazonaws.com\\\"},\\\"Action\\\":\\\"sts:AssumeRole\\\"}]}\",\n                            \"create_date\": \"2018-01-29T23:28:37Z\",\n                            \"force_detach_policies\": \"false\",\n                            \"id\": \"ecs_role\",\n                            \"name\": \"ecs_role\",\n                            \"path\": \"/\",\n                            \"unique_id\": \"AROAIVPNQJFMXVLEUPUAE\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role_policy.ecs_autoscale_role_policy\": {\n                    \"type\": \"aws_iam_role_policy\",\n                    \"depends_on\": [\n                        \"aws_iam_role.ecs_autoscale_role\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"production_ecs_autoscale_role:ecs_autoscale_role_policy\",\n                        \"attributes\": {\n                            \"id\": \"production_ecs_autoscale_role:ecs_autoscale_role_policy\",\n                            \"name\": \"ecs_autoscale_role_policy\",\n                            \"policy\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"ecs:DescribeServices\\\",\\n        \\\"ecs:UpdateService\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ]\\n    },\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"cloudwatch:DescribeAlarms\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ]\\n    }\\n  ]\\n}\\n\",\n                            \"role\": \"production_ecs_autoscale_role\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role_policy.ecs_execution_role_policy\": {\n                    \"type\": \"aws_iam_role_policy\",\n                    \"depends_on\": [\n                        \"aws_iam_role.ecs_execution_role\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"ecs_task_execution_role:ecs_execution_role_policy\",\n                        \"attributes\": {\n                            \"id\": \"ecs_task_execution_role:ecs_execution_role_policy\",\n                            \"name\": \"ecs_execution_role_policy\",\n                            \"policy\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"ecr:GetAuthorizationToken\\\",\\n        \\\"ecr:BatchCheckLayerAvailability\\\",\\n        \\\"ecr:GetDownloadUrlForLayer\\\",\\n        \\\"ecr:BatchGetImage\\\",\\n        \\\"logs:CreateLogStream\\\",\\n        \\\"logs:PutLogEvents\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\"\\n    }\\n  ]\\n}\\n\",\n                            \"role\": \"ecs_task_execution_role\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role_policy.ecs_service_role_policy\": {\n                    \"type\": \"aws_iam_role_policy\",\n                    \"depends_on\": [\n                        \"aws_iam_role.ecs_role\",\n                        \"data.aws_iam_policy_document.ecs_service_policy\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"ecs_role:ecs_service_role_policy\",\n                        \"attributes\": {\n                            \"id\": \"ecs_role:ecs_service_role_policy\",\n                            \"name\": \"ecs_service_role_policy\",\n                            \"policy\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Sid\\\": \\\"\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"elasticloadbalancing:RegisterInstancesWithLoadBalancer\\\",\\n        \\\"elasticloadbalancing:Describe*\\\",\\n        \\\"elasticloadbalancing:DeregisterInstancesFromLoadBalancer\\\",\\n        \\\"ec2:Describe*\\\",\\n        \\\"ec2:AuthorizeSecurityGroupIngress\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\"\\n    }\\n  ]\\n}\",\n                            \"role\": \"ecs_role\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_security_group.ecs_service\": {\n                    \"type\": \"aws_security_group\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"sg-ab4983dc\",\n                        \"attributes\": {\n                            \"description\": \"Allow egress from container\",\n                            \"egress.#\": \"1\",\n                            \"egress.482069346.cidr_blocks.#\": \"1\",\n                            \"egress.482069346.cidr_blocks.0\": \"0.0.0.0/0\",\n                            \"egress.482069346.description\": \"\",\n                            \"egress.482069346.from_port\": \"0\",\n                            \"egress.482069346.ipv6_cidr_blocks.#\": \"0\",\n                            \"egress.482069346.prefix_list_ids.#\": \"0\",\n                            \"egress.482069346.protocol\": \"-1\",\n                            \"egress.482069346.security_groups.#\": \"0\",\n                            \"egress.482069346.self\": \"false\",\n                            \"egress.482069346.to_port\": \"0\",\n                            \"id\": \"sg-ab4983dc\",\n                            \"ingress.#\": \"1\",\n                            \"ingress.3068409405.cidr_blocks.#\": \"1\",\n                            \"ingress.3068409405.cidr_blocks.0\": \"0.0.0.0/0\",\n                            \"ingress.3068409405.description\": \"\",\n                            \"ingress.3068409405.from_port\": \"8\",\n                            \"ingress.3068409405.ipv6_cidr_blocks.#\": \"0\",\n                            \"ingress.3068409405.protocol\": \"icmp\",\n                            \"ingress.3068409405.security_groups.#\": \"0\",\n                            \"ingress.3068409405.self\": \"false\",\n                            \"ingress.3068409405.to_port\": \"0\",\n                            \"name\": \"production-ecs-service-sg\",\n                            \"owner_id\": \"757895497645\",\n                            \"revoke_rules_on_delete\": \"false\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-ecs-service-sg\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_security_group.web_inbound_sg\": {\n                    \"type\": \"aws_security_group\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"sg-9c36fceb\",\n                        \"attributes\": {\n                            \"description\": \"Allow HTTP from Anywhere into ALB\",\n                            \"egress.#\": \"1\",\n                            \"egress.482069346.cidr_blocks.#\": \"1\",\n                            \"egress.482069346.cidr_blocks.0\": \"0.0.0.0/0\",\n                            \"egress.482069346.description\": \"\",\n                            \"egress.482069346.from_port\": \"0\",\n                            \"egress.482069346.ipv6_cidr_blocks.#\": \"0\",\n                            \"egress.482069346.prefix_list_ids.#\": \"0\",\n                            \"egress.482069346.protocol\": \"-1\",\n                            \"egress.482069346.security_groups.#\": \"0\",\n                            \"egress.482069346.self\": \"false\",\n                            \"egress.482069346.to_port\": \"0\",\n                            \"id\": \"sg-9c36fceb\",\n                            \"ingress.#\": \"2\",\n                            \"ingress.2214680975.cidr_blocks.#\": \"1\",\n                            \"ingress.2214680975.cidr_blocks.0\": \"0.0.0.0/0\",\n                            \"ingress.2214680975.description\": \"\",\n                            \"ingress.2214680975.from_port\": \"80\",\n                            \"ingress.2214680975.ipv6_cidr_blocks.#\": \"0\",\n                            \"ingress.2214680975.protocol\": \"tcp\",\n                            \"ingress.2214680975.security_groups.#\": \"0\",\n                            \"ingress.2214680975.self\": \"false\",\n                            \"ingress.2214680975.to_port\": \"80\",\n                            \"ingress.3068409405.cidr_blocks.#\": \"1\",\n                            \"ingress.3068409405.cidr_blocks.0\": \"0.0.0.0/0\",\n                            \"ingress.3068409405.description\": \"\",\n                            \"ingress.3068409405.from_port\": \"8\",\n                            \"ingress.3068409405.ipv6_cidr_blocks.#\": \"0\",\n                            \"ingress.3068409405.protocol\": \"icmp\",\n                            \"ingress.3068409405.security_groups.#\": \"0\",\n                            \"ingress.3068409405.self\": \"false\",\n                            \"ingress.3068409405.to_port\": \"0\",\n                            \"name\": \"production-web-inbound-sg\",\n                            \"owner_id\": \"757895497645\",\n                            \"revoke_rules_on_delete\": \"false\",\n                            \"tags.%\": \"1\",\n                            \"tags.Name\": \"production-web-inbound-sg\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"data.aws_ecs_task_definition.web\": {\n                    \"type\": \"aws_ecs_task_definition\",\n                    \"depends_on\": [\n                        \"aws_ecs_task_definition.web\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"arn:aws:ecs:us-east-1:757895497645:task-definition/production_web:18\",\n                        \"attributes\": {\n                            \"family\": \"production_web\",\n                            \"id\": \"arn:aws:ecs:us-east-1:757895497645:task-definition/production_web:18\",\n                            \"network_mode\": \"awsvpc\",\n                            \"revision\": \"18\",\n                            \"status\": \"ACTIVE\",\n                            \"task_definition\": \"production_web\",\n                            \"task_role_arn\": \"arn:aws:iam::757895497645:role/ecs_task_execution_role\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"data.aws_iam_policy_document.ecs_service_policy\": {\n                    \"type\": \"aws_iam_policy_document\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"3615693260\",\n                        \"attributes\": {\n                            \"id\": \"3615693260\",\n                            \"json\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Sid\\\": \\\"\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"elasticloadbalancing:RegisterInstancesWithLoadBalancer\\\",\\n        \\\"elasticloadbalancing:Describe*\\\",\\n        \\\"elasticloadbalancing:DeregisterInstancesFromLoadBalancer\\\",\\n        \\\"ec2:Describe*\\\",\\n        \\\"ec2:AuthorizeSecurityGroupIngress\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\"\\n    }\\n  ]\\n}\",\n                            \"statement.#\": \"1\",\n                            \"statement.0.actions.#\": \"5\",\n                            \"statement.0.actions.2459212947\": \"ec2:Describe*\",\n                            \"statement.0.actions.2464853358\": \"ec2:AuthorizeSecurityGroupIngress\",\n                            \"statement.0.actions.2706807274\": \"elasticloadbalancing:DeregisterInstancesFromLoadBalancer\",\n                            \"statement.0.actions.2747799858\": \"elasticloadbalancing:Describe*\",\n                            \"statement.0.actions.982461153\": \"elasticloadbalancing:RegisterInstancesWithLoadBalancer\",\n                            \"statement.0.condition.#\": \"0\",\n                            \"statement.0.effect\": \"Allow\",\n                            \"statement.0.not_actions.#\": \"0\",\n                            \"statement.0.not_principals.#\": \"0\",\n                            \"statement.0.not_resources.#\": \"0\",\n                            \"statement.0.principals.#\": \"0\",\n                            \"statement.0.resources.#\": \"1\",\n                            \"statement.0.resources.2679715827\": \"*\",\n                            \"statement.0.sid\": \"\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"data.aws_iam_policy_document.ecs_service_role\": {\n                    \"type\": \"aws_iam_policy_document\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"3622649364\",\n                        \"attributes\": {\n                            \"id\": \"3622649364\",\n                            \"json\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Sid\\\": \\\"\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": \\\"sts:AssumeRole\\\",\\n      \\\"Principal\\\": {\\n        \\\"Service\\\": \\\"ecs.amazonaws.com\\\"\\n      }\\n    }\\n  ]\\n}\",\n                            \"statement.#\": \"1\",\n                            \"statement.0.actions.#\": \"1\",\n                            \"statement.0.actions.2528466339\": \"sts:AssumeRole\",\n                            \"statement.0.condition.#\": \"0\",\n                            \"statement.0.effect\": \"Allow\",\n                            \"statement.0.not_actions.#\": \"0\",\n                            \"statement.0.not_principals.#\": \"0\",\n                            \"statement.0.not_resources.#\": \"0\",\n                            \"statement.0.principals.#\": \"1\",\n                            \"statement.0.principals.1113412664.identifiers.#\": \"1\",\n                            \"statement.0.principals.1113412664.identifiers.1509832800\": \"ecs.amazonaws.com\",\n                            \"statement.0.principals.1113412664.type\": \"Service\",\n                            \"statement.0.resources.#\": \"0\",\n                            \"statement.0.sid\": \"\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"data.template_file.db_migrate_task\": {\n                    \"type\": \"template_file\",\n                    \"depends_on\": [\n                        \"aws_ecr_repository.openjobs_app\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"9f8dc05fb135a66b81d1a71719cc13472331e59cb17a7ffc53e4369a00a5d974\",\n                        \"attributes\": {\n                            \"id\": \"9f8dc05fb135a66b81d1a71719cc13472331e59cb17a7ffc53e4369a00a5d974\",\n                            \"rendered\": \"[\\n  {\\n    \\\"name\\\": \\\"db-migrate\\\",\\n    \\\"image\\\": \\\"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\\\",\\n    \\\"command\\\": [\\\"bundle\\\", \\\"exec\\\", \\\"rake\\\", \\\"db:migrate\\\"],\\n    \\\"memory\\\": 300,\\n    \\\"logConfiguration\\\": {\\n      \\\"logDriver\\\": \\\"awslogs\\\",\\n      \\\"options\\\": {\\n        \\\"awslogs-group\\\": \\\"openjobs\\\",\\n        \\\"awslogs-region\\\": \\\"us-east-1\\\",\\n        \\\"awslogs-stream-prefix\\\": \\\"db_migrate\\\"\\n      }\\n    },\\n    \\\"environment\\\": [\\n      {\\n        \\\"name\\\": \\\"RAILS_ENV\\\",\\n        \\\"value\\\": \\\"production\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"DATABASE_URL\\\",\\n        \\\"value\\\": \\\"postgresql://openjobs:myawesomepasswordproduction@production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com:5432/openjobs_production?encoding=utf8\\u0026pool=40\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"SECRET_KEY_BASE\\\",\\n        \\\"value\\\": \\\"8d412aee3ceaa494fe1c276f5f7e524b9e33f649c03690e689e5b36a0cf4ce2a6f50024bc31f276c22b668e619d61a42b79f5e595759f377a8fa373e2907f41e\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"RAILS_LOG_TO_STDOUT\\\",\\n        \\\"value\\\": \\\"true\\\"\\n      }\\n    ]\\n  }\\n]\\n\",\n                            \"template\": \"[\\n  {\\n    \\\"name\\\": \\\"db-migrate\\\",\\n    \\\"image\\\": \\\"${image}\\\",\\n    \\\"command\\\": [\\\"bundle\\\", \\\"exec\\\", \\\"rake\\\", \\\"db:migrate\\\"],\\n    \\\"memory\\\": 300,\\n    \\\"logConfiguration\\\": {\\n      \\\"logDriver\\\": \\\"awslogs\\\",\\n      \\\"options\\\": {\\n        \\\"awslogs-group\\\": \\\"${log_group}\\\",\\n        \\\"awslogs-region\\\": \\\"us-east-1\\\",\\n        \\\"awslogs-stream-prefix\\\": \\\"db_migrate\\\"\\n      }\\n    },\\n    \\\"environment\\\": [\\n      {\\n        \\\"name\\\": \\\"RAILS_ENV\\\",\\n        \\\"value\\\": \\\"production\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"DATABASE_URL\\\",\\n        \\\"value\\\": \\\"${database_url}\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"SECRET_KEY_BASE\\\",\\n        \\\"value\\\": \\\"${secret_key_base}\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"RAILS_LOG_TO_STDOUT\\\",\\n        \\\"value\\\": \\\"true\\\"\\n      }\\n    ]\\n  }\\n]\\n\",\n                            \"vars.%\": \"4\",\n                            \"vars.database_url\": \"postgresql://openjobs:myawesomepasswordproduction@production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com:5432/openjobs_production?encoding=utf8\\u0026pool=40\",\n                            \"vars.image\": \"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\",\n                            \"vars.log_group\": \"openjobs\",\n                            \"vars.secret_key_base\": \"8d412aee3ceaa494fe1c276f5f7e524b9e33f649c03690e689e5b36a0cf4ce2a6f50024bc31f276c22b668e619d61a42b79f5e595759f377a8fa373e2907f41e\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.template\"\n                },\n                \"data.template_file.web_task\": {\n                    \"type\": \"template_file\",\n                    \"depends_on\": [\n                        \"aws_cloudwatch_log_group.openjobs\",\n                        \"aws_ecr_repository.openjobs_app\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"73682dd0b9de61124ffb2871c60782725d5be54498ef1b502df4c39d4463ab49\",\n                        \"attributes\": {\n                            \"id\": \"73682dd0b9de61124ffb2871c60782725d5be54498ef1b502df4c39d4463ab49\",\n                            \"rendered\": \"[\\n  {\\n    \\\"name\\\": \\\"web\\\",\\n    \\\"image\\\": \\\"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\\\",\\n    \\\"portMappings\\\": [\\n      {\\n        \\\"containerPort\\\": 80,\\n        \\\"hostPort\\\": 80\\n      }\\n    ],\\n    \\\"memory\\\": 300,\\n    \\\"networkMode\\\": \\\"awsvpc\\\",\\n    \\\"logConfiguration\\\": {\\n      \\\"logDriver\\\": \\\"awslogs\\\",\\n      \\\"options\\\": {\\n        \\\"awslogs-group\\\": \\\"openjobs\\\",\\n        \\\"awslogs-region\\\": \\\"us-east-1\\\",\\n        \\\"awslogs-stream-prefix\\\": \\\"web\\\"\\n      }\\n    },\\n    \\\"environment\\\": [\\n      {\\n        \\\"name\\\": \\\"RAILS_ENV\\\",\\n        \\\"value\\\": \\\"production\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"DATABASE_URL\\\",\\n        \\\"value\\\": \\\"postgresql://openjobs:myawesomepasswordproduction@production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com:5432/openjobs_production?encoding=utf8\\u0026pool=40\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"SECRET_KEY_BASE\\\",\\n        \\\"value\\\": \\\"8d412aee3ceaa494fe1c276f5f7e524b9e33f649c03690e689e5b36a0cf4ce2a6f50024bc31f276c22b668e619d61a42b79f5e595759f377a8fa373e2907f41e\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"PORT\\\",\\n        \\\"value\\\": \\\"80\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"RAILS_LOG_TO_STDOUT\\\",\\n        \\\"value\\\": \\\"true\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"RAILS_SERVE_STATIC_FILES\\\",\\n        \\\"value\\\": \\\"true\\\"\\n      }\\n    ]\\n  }\\n]\\n\\n\",\n                            \"template\": \"[\\n  {\\n    \\\"name\\\": \\\"web\\\",\\n    \\\"image\\\": \\\"${image}\\\",\\n    \\\"portMappings\\\": [\\n      {\\n        \\\"containerPort\\\": 80,\\n        \\\"hostPort\\\": 80\\n      }\\n    ],\\n    \\\"memory\\\": 300,\\n    \\\"networkMode\\\": \\\"awsvpc\\\",\\n    \\\"logConfiguration\\\": {\\n      \\\"logDriver\\\": \\\"awslogs\\\",\\n      \\\"options\\\": {\\n        \\\"awslogs-group\\\": \\\"${log_group}\\\",\\n        \\\"awslogs-region\\\": \\\"us-east-1\\\",\\n        \\\"awslogs-stream-prefix\\\": \\\"web\\\"\\n      }\\n    },\\n    \\\"environment\\\": [\\n      {\\n        \\\"name\\\": \\\"RAILS_ENV\\\",\\n        \\\"value\\\": \\\"production\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"DATABASE_URL\\\",\\n        \\\"value\\\": \\\"${database_url}\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"SECRET_KEY_BASE\\\",\\n        \\\"value\\\": \\\"${secret_key_base}\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"PORT\\\",\\n        \\\"value\\\": \\\"80\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"RAILS_LOG_TO_STDOUT\\\",\\n        \\\"value\\\": \\\"true\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"RAILS_SERVE_STATIC_FILES\\\",\\n        \\\"value\\\": \\\"true\\\"\\n      }\\n    ]\\n  }\\n]\\n\\n\",\n                            \"vars.%\": \"4\",\n                            \"vars.database_url\": \"postgresql://openjobs:myawesomepasswordproduction@production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com:5432/openjobs_production?encoding=utf8\\u0026pool=40\",\n                            \"vars.image\": \"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\",\n                            \"vars.log_group\": \"openjobs\",\n                            \"vars.secret_key_base\": \"8d412aee3ceaa494fe1c276f5f7e524b9e33f649c03690e689e5b36a0cf4ce2a6f50024bc31f276c22b668e619d61a42b79f5e595759f377a8fa373e2907f41e\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.template\"\n                },\n                \"random_id.target_group_sufix\": {\n                    \"type\": \"random_id\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"8Uw\",\n                        \"attributes\": {\n                            \"b64\": \"8Uw\",\n                            \"b64_std\": \"8Uw=\",\n                            \"b64_url\": \"8Uw\",\n                            \"byte_length\": \"2\",\n                            \"dec\": \"61772\",\n                            \"hex\": \"f14c\",\n                            \"id\": \"8Uw\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.random\"\n                }\n            },\n            \"depends_on\": []\n        },\n        {\n            \"path\": [\n                \"root\",\n                \"networking\"\n            ],\n            \"outputs\": {\n                \"default_sg_id\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"sg-34438943\"\n                },\n                \"private_subnets_id\": {\n                    \"sensitive\": false,\n                    \"type\": \"list\",\n                    \"value\": [\n                        \"subnet-de3444f1\",\n                        \"subnet-30625b7b\"\n                    ]\n                },\n                \"public_subnets_id\": {\n                    \"sensitive\": false,\n                    \"type\": \"list\",\n                    \"value\": [\n                        \"subnet-6537474a\",\n                        \"subnet-08774e43\"\n                    ]\n                },\n                \"security_groups_ids\": {\n                    \"sensitive\": false,\n                    \"type\": \"list\",\n                    \"value\": [\n                        \"sg-34438943\"\n                    ]\n                },\n                \"vpc_id\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"vpc-32041f4a\"\n                }\n            },\n            \"resources\": {\n                \"aws_eip.nat_eip\": {\n                    \"type\": \"aws_eip\",\n                    \"depends_on\": [\n                        \"aws_internet_gateway.ig\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"eipalloc-098c613f\",\n                        \"attributes\": {\n                            \"association_id\": \"eipassoc-eed306e5\",\n                            \"domain\": \"vpc\",\n                            \"id\": \"eipalloc-098c613f\",\n                            \"instance\": \"\",\n                            \"network_interface\": \"eni-8bf61c46\",\n                            \"private_ip\": \"10.0.1.128\",\n                            \"public_ip\": \"34.193.75.40\",\n                            \"tags.%\": \"0\",\n                            \"vpc\": \"true\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_internet_gateway.ig\": {\n                    \"type\": \"aws_internet_gateway\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"igw-1a373e63\",\n                        \"attributes\": {\n                            \"id\": \"igw-1a373e63\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-igw\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_nat_gateway.nat\": {\n                    \"type\": \"aws_nat_gateway\",\n                    \"depends_on\": [\n                        \"aws_eip.nat_eip\",\n                        \"aws_internet_gateway.ig\",\n                        \"aws_subnet.public_subnet.*\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"nat-0000beab268c3255b\",\n                        \"attributes\": {\n                            \"allocation_id\": \"eipalloc-098c613f\",\n                            \"id\": \"nat-0000beab268c3255b\",\n                            \"network_interface_id\": \"eni-8bf61c46\",\n                            \"private_ip\": \"10.0.1.128\",\n                            \"public_ip\": \"34.193.75.40\",\n                            \"subnet_id\": \"subnet-6537474a\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-us-east-1a-nat\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route.private_nat_gateway\": {\n                    \"type\": \"aws_route\",\n                    \"depends_on\": [\n                        \"aws_nat_gateway.nat\",\n                        \"aws_route_table.private\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"r-rtb-6fc4f8121080289494\",\n                        \"attributes\": {\n                            \"destination_cidr_block\": \"0.0.0.0/0\",\n                            \"destination_prefix_list_id\": \"\",\n                            \"egress_only_gateway_id\": \"\",\n                            \"gateway_id\": \"\",\n                            \"id\": \"r-rtb-6fc4f8121080289494\",\n                            \"instance_id\": \"\",\n                            \"instance_owner_id\": \"\",\n                            \"nat_gateway_id\": \"nat-0000beab268c3255b\",\n                            \"network_interface_id\": \"\",\n                            \"origin\": \"CreateRoute\",\n                            \"route_table_id\": \"rtb-6fc4f812\",\n                            \"state\": \"active\",\n                            \"vpc_peering_connection_id\": \"\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route.public_internet_gateway\": {\n                    \"type\": \"aws_route\",\n                    \"depends_on\": [\n                        \"aws_internet_gateway.ig\",\n                        \"aws_route_table.public\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"r-rtb-8cccf0f11080289494\",\n                        \"attributes\": {\n                            \"destination_cidr_block\": \"0.0.0.0/0\",\n                            \"destination_prefix_list_id\": \"\",\n                            \"egress_only_gateway_id\": \"\",\n                            \"gateway_id\": \"igw-1a373e63\",\n                            \"id\": \"r-rtb-8cccf0f11080289494\",\n                            \"instance_id\": \"\",\n                            \"instance_owner_id\": \"\",\n                            \"nat_gateway_id\": \"\",\n                            \"network_interface_id\": \"\",\n                            \"origin\": \"CreateRoute\",\n                            \"route_table_id\": \"rtb-8cccf0f1\",\n                            \"state\": \"active\",\n                            \"vpc_peering_connection_id\": \"\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route_table.private\": {\n                    \"type\": \"aws_route_table\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"rtb-6fc4f812\",\n                        \"attributes\": {\n                            \"id\": \"rtb-6fc4f812\",\n                            \"propagating_vgws.#\": \"0\",\n                            \"route.#\": \"1\",\n                            \"route.4236193873.cidr_block\": \"0.0.0.0/0\",\n                            \"route.4236193873.egress_only_gateway_id\": \"\",\n                            \"route.4236193873.gateway_id\": \"\",\n                            \"route.4236193873.instance_id\": \"\",\n                            \"route.4236193873.ipv6_cidr_block\": \"\",\n                            \"route.4236193873.nat_gateway_id\": \"nat-0000beab268c3255b\",\n                            \"route.4236193873.network_interface_id\": \"\",\n                            \"route.4236193873.vpc_peering_connection_id\": \"\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-private-route-table\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route_table.public\": {\n                    \"type\": \"aws_route_table\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"rtb-8cccf0f1\",\n                        \"attributes\": {\n                            \"id\": \"rtb-8cccf0f1\",\n                            \"propagating_vgws.#\": \"0\",\n                            \"route.#\": \"1\",\n                            \"route.1381113949.cidr_block\": \"0.0.0.0/0\",\n                            \"route.1381113949.egress_only_gateway_id\": \"\",\n                            \"route.1381113949.gateway_id\": \"igw-1a373e63\",\n                            \"route.1381113949.instance_id\": \"\",\n                            \"route.1381113949.ipv6_cidr_block\": \"\",\n                            \"route.1381113949.nat_gateway_id\": \"\",\n                            \"route.1381113949.network_interface_id\": \"\",\n                            \"route.1381113949.vpc_peering_connection_id\": \"\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-public-route-table\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route_table_association.private.0\": {\n                    \"type\": \"aws_route_table_association\",\n                    \"depends_on\": [\n                        \"aws_route_table.private\",\n                        \"aws_subnet.private_subnet.*\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"rtbassoc-f2ef6e8e\",\n                        \"attributes\": {\n                            \"id\": \"rtbassoc-f2ef6e8e\",\n                            \"route_table_id\": \"rtb-6fc4f812\",\n                            \"subnet_id\": \"subnet-de3444f1\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route_table_association.private.1\": {\n                    \"type\": \"aws_route_table_association\",\n                    \"depends_on\": [\n                        \"aws_route_table.private\",\n                        \"aws_subnet.private_subnet.*\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"rtbassoc-78ec6d04\",\n                        \"attributes\": {\n                            \"id\": \"rtbassoc-78ec6d04\",\n                            \"route_table_id\": \"rtb-6fc4f812\",\n                            \"subnet_id\": \"subnet-30625b7b\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route_table_association.public.0\": {\n                    \"type\": \"aws_route_table_association\",\n                    \"depends_on\": [\n                        \"aws_route_table.public\",\n                        \"aws_subnet.public_subnet.*\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"rtbassoc-ebed6c97\",\n                        \"attributes\": {\n                            \"id\": \"rtbassoc-ebed6c97\",\n                            \"route_table_id\": \"rtb-8cccf0f1\",\n                            \"subnet_id\": \"subnet-6537474a\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route_table_association.public.1\": {\n                    \"type\": \"aws_route_table_association\",\n                    \"depends_on\": [\n                        \"aws_route_table.public\",\n                        \"aws_subnet.public_subnet.*\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"rtbassoc-f0f4758c\",\n                        \"attributes\": {\n                            \"id\": \"rtbassoc-f0f4758c\",\n                            \"route_table_id\": \"rtb-8cccf0f1\",\n                            \"subnet_id\": \"subnet-08774e43\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_security_group.default\": {\n                    \"type\": \"aws_security_group\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"sg-34438943\",\n                        \"attributes\": {\n                            \"description\": \"Default security group to allow inbound/outbound from the VPC\",\n                            \"egress.#\": \"1\",\n                            \"egress.753360330.cidr_blocks.#\": \"0\",\n                            \"egress.753360330.description\": \"\",\n                            \"egress.753360330.from_port\": \"0\",\n                            \"egress.753360330.ipv6_cidr_blocks.#\": \"0\",\n                            \"egress.753360330.prefix_list_ids.#\": \"0\",\n                            \"egress.753360330.protocol\": \"-1\",\n                            \"egress.753360330.security_groups.#\": \"0\",\n                            \"egress.753360330.self\": \"true\",\n                            \"egress.753360330.to_port\": \"0\",\n                            \"id\": \"sg-34438943\",\n                            \"ingress.#\": \"1\",\n                            \"ingress.753360330.cidr_blocks.#\": \"0\",\n                            \"ingress.753360330.description\": \"\",\n                            \"ingress.753360330.from_port\": \"0\",\n                            \"ingress.753360330.ipv6_cidr_blocks.#\": \"0\",\n                            \"ingress.753360330.protocol\": \"-1\",\n                            \"ingress.753360330.security_groups.#\": \"0\",\n                            \"ingress.753360330.self\": \"true\",\n                            \"ingress.753360330.to_port\": \"0\",\n                            \"name\": \"production-default-sg\",\n                            \"owner_id\": \"757895497645\",\n                            \"revoke_rules_on_delete\": \"false\",\n                            \"tags.%\": \"1\",\n                            \"tags.Environment\": \"production\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_subnet.private_subnet.0\": {\n                    \"type\": \"aws_subnet\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"subnet-de3444f1\",\n                        \"attributes\": {\n                            \"assign_ipv6_address_on_creation\": \"false\",\n                            \"availability_zone\": \"us-east-1a\",\n                            \"cidr_block\": \"10.0.10.0/24\",\n                            \"id\": \"subnet-de3444f1\",\n                            \"map_public_ip_on_launch\": \"false\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-us-east-1a-private-subnet\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_subnet.private_subnet.1\": {\n                    \"type\": \"aws_subnet\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"subnet-30625b7b\",\n                        \"attributes\": {\n                            \"assign_ipv6_address_on_creation\": \"false\",\n                            \"availability_zone\": \"us-east-1b\",\n                            \"cidr_block\": \"10.0.20.0/24\",\n                            \"id\": \"subnet-30625b7b\",\n                            \"map_public_ip_on_launch\": \"false\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-us-east-1b-private-subnet\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_subnet.public_subnet.0\": {\n                    \"type\": \"aws_subnet\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"subnet-6537474a\",\n                        \"attributes\": {\n                            \"assign_ipv6_address_on_creation\": \"false\",\n                            \"availability_zone\": \"us-east-1a\",\n                            \"cidr_block\": \"10.0.1.0/24\",\n                            \"id\": \"subnet-6537474a\",\n                            \"map_public_ip_on_launch\": \"true\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-us-east-1a-public-subnet\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_subnet.public_subnet.1\": {\n                    \"type\": \"aws_subnet\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"subnet-08774e43\",\n                        \"attributes\": {\n                            \"assign_ipv6_address_on_creation\": \"false\",\n                            \"availability_zone\": \"us-east-1b\",\n                            \"cidr_block\": \"10.0.2.0/24\",\n                            \"id\": \"subnet-08774e43\",\n                            \"map_public_ip_on_launch\": \"true\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-us-east-1b-public-subnet\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_vpc.vpc\": {\n                    \"type\": \"aws_vpc\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"vpc-32041f4a\",\n                        \"attributes\": {\n                            \"assign_generated_ipv6_cidr_block\": \"false\",\n                            \"cidr_block\": \"10.0.0.0/16\",\n                            \"default_network_acl_id\": \"acl-8280eef9\",\n                            \"default_route_table_id\": \"rtb-d6bd81ab\",\n                            \"default_security_group_id\": \"sg-d335ffa4\",\n                            \"dhcp_options_id\": \"dopt-15849877\",\n                            \"enable_classiclink\": \"false\",\n                            \"enable_classiclink_dns_support\": \"false\",\n                            \"enable_dns_hostnames\": \"true\",\n                            \"enable_dns_support\": \"true\",\n                            \"id\": \"vpc-32041f4a\",\n                            \"instance_tenancy\": \"default\",\n                            \"main_route_table_id\": \"rtb-d6bd81ab\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-vpc\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                }\n            },\n            \"depends_on\": []\n        },\n        {\n            \"path\": [\n                \"root\",\n                \"rds\"\n            ],\n            \"outputs\": {\n                \"db_access_sg_id\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"sg-2b37fd5c\"\n                },\n                \"rds_address\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com\"\n                }\n            },\n            \"resources\": {\n                \"aws_db_instance.rds\": {\n                    \"type\": \"aws_db_instance\",\n                    \"depends_on\": [\n                        \"aws_db_subnet_group.rds_subnet_group\",\n                        \"aws_security_group.rds_sg\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"production-database\",\n                        \"attributes\": {\n                            \"address\": \"production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com\",\n                            \"allocated_storage\": \"20\",\n                            \"arn\": \"arn:aws:rds:us-east-1:757895497645:db:production-database\",\n                            \"auto_minor_version_upgrade\": \"true\",\n                            \"availability_zone\": \"us-east-1a\",\n                            \"backup_retention_period\": \"0\",\n                            \"backup_window\": \"08:37-09:07\",\n                            \"ca_cert_identifier\": \"rds-ca-2015\",\n                            \"copy_tags_to_snapshot\": \"false\",\n                            \"db_subnet_group_name\": \"production-rds-subnet-group\",\n                            \"endpoint\": \"production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com:5432\",\n                            \"engine\": \"postgres\",\n                            \"engine_version\": \"9.6.6\",\n                            \"hosted_zone_id\": \"Z2R2ITUGPM61AM\",\n                            \"iam_database_authentication_enabled\": \"false\",\n                            \"id\": \"production-database\",\n                            \"identifier\": \"production-database\",\n                            \"instance_class\": \"db.t2.micro\",\n                            \"iops\": \"0\",\n                            \"kms_key_id\": \"\",\n                            \"license_model\": \"postgresql-license\",\n                            \"maintenance_window\": \"sat:04:07-sat:04:37\",\n                            \"monitoring_interval\": \"0\",\n                            \"multi_az\": \"false\",\n                            \"name\": \"openjobs_production\",\n                            \"option_group_name\": \"default:postgres-9-6\",\n                            \"parameter_group_name\": \"default.postgres9.6\",\n                            \"password\": \"myawesomepasswordproduction\",\n                            \"port\": \"5432\",\n                            \"publicly_accessible\": \"false\",\n                            \"replicas.#\": \"0\",\n                            \"replicate_source_db\": \"\",\n                            \"resource_id\": \"db-Z2YKHEFX3HMYUCQTU4Q3FC2BGY\",\n                            \"security_group_names.#\": \"0\",\n                            \"skip_final_snapshot\": \"true\",\n                            \"snapshot_identifier\": \"rds-production-snapshot\",\n                            \"status\": \"available\",\n                            \"storage_encrypted\": \"false\",\n                            \"storage_type\": \"standard\",\n                            \"tags.%\": \"1\",\n                            \"tags.Environment\": \"production\",\n                            \"timezone\": \"\",\n                            \"username\": \"openjobs\",\n                            \"vpc_security_group_ids.#\": \"1\",\n                            \"vpc_security_group_ids.251623276\": \"sg-c931fbbe\"\n                        },\n                        \"meta\": {\n                            \"e2bfb730-ecaa-11e6-8f88-34363bc7c4c0\": {\n                                \"create\": 2400000000000,\n                                \"delete\": 2400000000000,\n                                \"update\": 4800000000000\n                            }\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_db_subnet_group.rds_subnet_group\": {\n                    \"type\": \"aws_db_subnet_group\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"production-rds-subnet-group\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:rds:us-east-1:757895497645:subgrp:production-rds-subnet-group\",\n                            \"description\": \"RDS subnet group\",\n                            \"id\": \"production-rds-subnet-group\",\n                            \"name\": \"production-rds-subnet-group\",\n                            \"subnet_ids.#\": \"2\",\n                            \"subnet_ids.3113454962\": \"subnet-30625b7b\",\n                            \"subnet_ids.3378482322\": \"subnet-de3444f1\",\n                            \"tags.%\": \"1\",\n                            \"tags.Environment\": \"production\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_security_group.db_access_sg\": {\n                    \"type\": \"aws_security_group\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"sg-2b37fd5c\",\n                        \"attributes\": {\n                            \"description\": \"Allow access to RDS\",\n                            \"egress.#\": \"0\",\n                            \"id\": \"sg-2b37fd5c\",\n                            \"ingress.#\": \"0\",\n                            \"name\": \"production-db-access-sg\",\n                            \"owner_id\": \"757895497645\",\n                            \"revoke_rules_on_delete\": \"false\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-db-access-sg\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_security_group.rds_sg\": {\n                    \"type\": \"aws_security_group\",\n                    \"depends_on\": [\n                        \"aws_security_group.db_access_sg\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"sg-c931fbbe\",\n                        \"attributes\": {\n                            \"description\": \"production Security Group\",\n                            \"egress.#\": \"1\",\n                            \"egress.482069346.cidr_blocks.#\": \"1\",\n                            \"egress.482069346.cidr_blocks.0\": \"0.0.0.0/0\",\n                            \"egress.482069346.description\": \"\",\n                            \"egress.482069346.from_port\": \"0\",\n                            \"egress.482069346.ipv6_cidr_blocks.#\": \"0\",\n                            \"egress.482069346.prefix_list_ids.#\": \"0\",\n                            \"egress.482069346.protocol\": \"-1\",\n                            \"egress.482069346.security_groups.#\": \"0\",\n                            \"egress.482069346.self\": \"false\",\n                            \"egress.482069346.to_port\": \"0\",\n                            \"id\": \"sg-c931fbbe\",\n                            \"ingress.#\": \"2\",\n                            \"ingress.4257570995.cidr_blocks.#\": \"0\",\n                            \"ingress.4257570995.description\": \"\",\n                            \"ingress.4257570995.from_port\": \"5432\",\n                            \"ingress.4257570995.ipv6_cidr_blocks.#\": \"0\",\n                            \"ingress.4257570995.protocol\": \"tcp\",\n                            \"ingress.4257570995.security_groups.#\": \"1\",\n                            \"ingress.4257570995.security_groups.569761485\": \"sg-2b37fd5c\",\n                            \"ingress.4257570995.self\": \"false\",\n                            \"ingress.4257570995.to_port\": \"5432\",\n                            \"ingress.753360330.cidr_blocks.#\": \"0\",\n                            \"ingress.753360330.description\": \"\",\n                            \"ingress.753360330.from_port\": \"0\",\n                            \"ingress.753360330.ipv6_cidr_blocks.#\": \"0\",\n                            \"ingress.753360330.protocol\": \"-1\",\n                            \"ingress.753360330.security_groups.#\": \"0\",\n                            \"ingress.753360330.self\": \"true\",\n                            \"ingress.753360330.to_port\": \"0\",\n                            \"name\": \"production-rds-sg\",\n                            \"owner_id\": \"757895497645\",\n                            \"revoke_rules_on_delete\": \"false\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-rds-sg\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                }\n            },\n            \"depends_on\": []\n        }\n    ]\n}\n"
  },
  {
    "path": "terraform.tfstate.backup",
    "content": "{\n    \"version\": 3,\n    \"terraform_version\": \"0.11.2\",\n    \"serial\": 21,\n    \"lineage\": \"5c7c0514-ccd7-4ff8-acfa-da519b567c34\",\n    \"modules\": [\n        {\n            \"path\": [\n                \"root\"\n            ],\n            \"outputs\": {},\n            \"resources\": {\n                \"aws_key_pair.key\": {\n                    \"type\": \"aws_key_pair\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"production_key\",\n                        \"attributes\": {\n                            \"fingerprint\": \"1c:e1:6e:32:51:dc:48:e0:14:5f:b3:fe:73:c6:ff:ef\",\n                            \"id\": \"production_key\",\n                            \"key_name\": \"production_key\",\n                            \"public_key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDySaHA85axXRL25SMnHV8+DXnsGZMcy+zuQoJURDKZRkpsbo90iZgbugGtIal/6pw8voF/z/7FBJrNaZeo05kTCbqmftnDaKnqj24OlE8p5eIiiht02rXYSKQugDP7eyVK6s8iYOE9z8FhxjsfafgXBOJedhXwZj78WaRZ17P6/vp0+BgRupCWmM9otH4maN6jTHS8A4eYgketfYVk9WDo3Yvq3i+/6KYbFp6nx0kgjpwuR2zz7kRLV/IBSxFEf5TKnrhbj+DV4WFuMQjG2VjGjtnpEw6Lfz4aQ8FsAaHac2k0sbZwuG5NYEL7p+Sgx8uKp/K2CQRoGV7pgkVfj5af production_key\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route53_delegation_set.main\": {\n                    \"type\": \"aws_route53_delegation_set\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"N1RI8P0VVZSY5D\",\n                        \"attributes\": {\n                            \"id\": \"N1RI8P0VVZSY5D\",\n                            \"name_servers.#\": \"4\",\n                            \"name_servers.0\": \"ns-1524.awsdns-62.org\",\n                            \"name_servers.1\": \"ns-2002.awsdns-58.co.uk\",\n                            \"name_servers.2\": \"ns-500.awsdns-62.com\",\n                            \"name_servers.3\": \"ns-563.awsdns-06.net\",\n                            \"reference_name\": \"DynDNS\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route53_record.www-prod\": {\n                    \"type\": \"aws_route53_record\",\n                    \"depends_on\": [\n                        \"aws_route53_zone.primary_route\",\n                        \"module.ecs\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"Z2DB0BHE7U5H9Y_www.ecsfargateexample.tk_A\",\n                        \"attributes\": {\n                            \"alias.#\": \"1\",\n                            \"alias.2656789336.evaluate_target_health\": \"true\",\n                            \"alias.2656789336.name\": \"production-alb-openjobs-651485480.us-east-1.elb.amazonaws.com\",\n                            \"alias.2656789336.zone_id\": \"Z35SXDOTRQ7X7K\",\n                            \"fqdn\": \"www.ecsfargateexample.tk\",\n                            \"health_check_id\": \"\",\n                            \"id\": \"Z2DB0BHE7U5H9Y_www.ecsfargateexample.tk_A\",\n                            \"name\": \"www.ecsfargateexample.tk\",\n                            \"records.#\": \"0\",\n                            \"set_identifier\": \"\",\n                            \"ttl\": \"0\",\n                            \"type\": \"A\",\n                            \"zone_id\": \"Z2DB0BHE7U5H9Y\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"2\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route53_zone.primary_route\": {\n                    \"type\": \"aws_route53_zone\",\n                    \"depends_on\": [\n                        \"aws_route53_delegation_set.main\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"Z2DB0BHE7U5H9Y\",\n                        \"attributes\": {\n                            \"comment\": \"Managed by Terraform\",\n                            \"delegation_set_id\": \"N1RI8P0VVZSY5D\",\n                            \"force_destroy\": \"false\",\n                            \"id\": \"Z2DB0BHE7U5H9Y\",\n                            \"name\": \"ecsfargateexample.tk\",\n                            \"name_servers.#\": \"4\",\n                            \"name_servers.0\": \"ns-1524.awsdns-62.org\",\n                            \"name_servers.1\": \"ns-2002.awsdns-58.co.uk\",\n                            \"name_servers.2\": \"ns-500.awsdns-62.com\",\n                            \"name_servers.3\": \"ns-563.awsdns-06.net\",\n                            \"tags.%\": \"0\",\n                            \"zone_id\": \"Z2DB0BHE7U5H9Y\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                }\n            },\n            \"depends_on\": []\n        },\n        {\n            \"path\": [\n                \"root\",\n                \"code_pipeline\"\n            ],\n            \"outputs\": {},\n            \"resources\": {\n                \"aws_codebuild_project.openjobs_build\": {\n                    \"type\": \"aws_codebuild_project\",\n                    \"depends_on\": [\n                        \"aws_iam_role.codebuild_role\",\n                        \"data.template_file.buildspec\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"arn:aws:codebuild:us-east-1:757895497645:project/openjobs-codebuild\",\n                        \"attributes\": {\n                            \"artifacts.#\": \"1\",\n                            \"artifacts.2731293239.location\": \"\",\n                            \"artifacts.2731293239.name\": \"openjobs-codebuild\",\n                            \"artifacts.2731293239.namespace_type\": \"\",\n                            \"artifacts.2731293239.packaging\": \"NONE\",\n                            \"artifacts.2731293239.path\": \"\",\n                            \"artifacts.2731293239.type\": \"CODEPIPELINE\",\n                            \"build_timeout\": \"10\",\n                            \"description\": \"\",\n                            \"encryption_key\": \"arn:aws:kms:us-east-1:757895497645:alias/aws/s3\",\n                            \"environment.#\": \"1\",\n                            \"environment.2882962266.compute_type\": \"BUILD_GENERAL1_SMALL\",\n                            \"environment.2882962266.environment_variable.#\": \"0\",\n                            \"environment.2882962266.image\": \"aws/codebuild/docker:1.12.1\",\n                            \"environment.2882962266.privileged_mode\": \"true\",\n                            \"environment.2882962266.type\": \"LINUX_CONTAINER\",\n                            \"id\": \"arn:aws:codebuild:us-east-1:757895497645:project/openjobs-codebuild\",\n                            \"name\": \"openjobs-codebuild\",\n                            \"service_role\": \"arn:aws:iam::757895497645:role/codebuild-role\",\n                            \"source.#\": \"1\",\n                            \"source.3414224759.auth.#\": \"0\",\n                            \"source.3414224759.buildspec\": \"version: 0.2\\n\\nphases:\\n  pre_build:\\n    commands:\\n      - pip install awscli --upgrade --user\\n      - echo `aws --version`\\n      - echo Logging in to Amazon ECR...\\n      - $(aws ecr get-login --region us-east-1 --no-include-email)\\n      - REPOSITORY_URI=757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\\n      - IMAGE_TAG=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)\\n      - echo Entered the pre_build phase...\\n  build:\\n    commands:\\n      - echo Build started on `date`\\n      - echo Building the Docker image...\\n      - docker build --build-arg build_without=\\\"development test\\\" --build-arg rails_env=\\\"production\\\" -t $REPOSITORY_URI:latest .\\n      - docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG\\n  post_build:\\n    commands:\\n      - echo Build completed on `date`\\n      - echo Pushing the Docker images...\\n      - docker push $REPOSITORY_URI:latest\\n      - docker push $REPOSITORY_URI:$IMAGE_TAG\\n      - echo Writing image definitions file...\\n      - printf '[{\\\"name\\\":\\\"web\\\",\\\"imageUri\\\":\\\"%s\\\"}]' $REPOSITORY_URI:$IMAGE_TAG \\u003e imagedefinitions.json\\n      - echo upgrading db-migrate task definitions\\n      - aws ecs run-task --launch-type FARGATE --cluster production-ecs-cluster --task-definition production_db_migrate --network-configuration \\\"awsvpcConfiguration={subnets=[subnet-de3444f1],securityGroups=[sg-2b37fd5c,sg-34438943]}\\\"\\nartifacts:\\n  files: imagedefinitions.json\\n\",\n                            \"source.3414224759.location\": \"\",\n                            \"source.3414224759.type\": \"CODEPIPELINE\",\n                            \"tags.%\": \"0\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_codepipeline.pipeline\": {\n                    \"type\": \"aws_codepipeline\",\n                    \"depends_on\": [\n                        \"aws_iam_role.codepipeline_role\",\n                        \"aws_s3_bucket.source\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"openjobs-pipeline\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:codepipeline:us-east-1:757895497645:openjobs-pipeline\",\n                            \"artifact_store.#\": \"1\",\n                            \"artifact_store.0.encryption_key.#\": \"0\",\n                            \"artifact_store.0.location\": \"openjobs-experiment-source\",\n                            \"artifact_store.0.type\": \"S3\",\n                            \"id\": \"openjobs-pipeline\",\n                            \"name\": \"openjobs-pipeline\",\n                            \"role_arn\": \"arn:aws:iam::757895497645:role/codepipeline-role\",\n                            \"stage.#\": \"3\",\n                            \"stage.0.action.#\": \"1\",\n                            \"stage.0.action.0.category\": \"Source\",\n                            \"stage.0.action.0.configuration.%\": \"3\",\n                            \"stage.0.action.0.configuration.Branch\": \"master\",\n                            \"stage.0.action.0.configuration.Owner\": \"duduribeiro\",\n                            \"stage.0.action.0.configuration.Repo\": \"openjobs_experiment\",\n                            \"stage.0.action.0.input_artifacts.#\": \"0\",\n                            \"stage.0.action.0.name\": \"Source\",\n                            \"stage.0.action.0.output_artifacts.#\": \"1\",\n                            \"stage.0.action.0.output_artifacts.0\": \"source\",\n                            \"stage.0.action.0.owner\": \"ThirdParty\",\n                            \"stage.0.action.0.provider\": \"GitHub\",\n                            \"stage.0.action.0.role_arn\": \"\",\n                            \"stage.0.action.0.run_order\": \"1\",\n                            \"stage.0.action.0.version\": \"1\",\n                            \"stage.0.name\": \"Source\",\n                            \"stage.1.action.#\": \"1\",\n                            \"stage.1.action.0.category\": \"Build\",\n                            \"stage.1.action.0.configuration.%\": \"1\",\n                            \"stage.1.action.0.configuration.ProjectName\": \"openjobs-codebuild\",\n                            \"stage.1.action.0.input_artifacts.#\": \"1\",\n                            \"stage.1.action.0.input_artifacts.0\": \"source\",\n                            \"stage.1.action.0.name\": \"Build\",\n                            \"stage.1.action.0.output_artifacts.#\": \"1\",\n                            \"stage.1.action.0.output_artifacts.0\": \"imagedefinitions\",\n                            \"stage.1.action.0.owner\": \"AWS\",\n                            \"stage.1.action.0.provider\": \"CodeBuild\",\n                            \"stage.1.action.0.role_arn\": \"\",\n                            \"stage.1.action.0.run_order\": \"1\",\n                            \"stage.1.action.0.version\": \"1\",\n                            \"stage.1.name\": \"Build\",\n                            \"stage.2.action.#\": \"1\",\n                            \"stage.2.action.0.category\": \"Deploy\",\n                            \"stage.2.action.0.configuration.%\": \"3\",\n                            \"stage.2.action.0.configuration.ClusterName\": \"production-ecs-cluster\",\n                            \"stage.2.action.0.configuration.FileName\": \"imagedefinitions.json\",\n                            \"stage.2.action.0.configuration.ServiceName\": \"production-web\",\n                            \"stage.2.action.0.input_artifacts.#\": \"1\",\n                            \"stage.2.action.0.input_artifacts.0\": \"imagedefinitions\",\n                            \"stage.2.action.0.name\": \"Deploy\",\n                            \"stage.2.action.0.output_artifacts.#\": \"0\",\n                            \"stage.2.action.0.owner\": \"AWS\",\n                            \"stage.2.action.0.provider\": \"ECS\",\n                            \"stage.2.action.0.role_arn\": \"\",\n                            \"stage.2.action.0.run_order\": \"1\",\n                            \"stage.2.action.0.version\": \"1\",\n                            \"stage.2.name\": \"Production\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role.codebuild_role\": {\n                    \"type\": \"aws_iam_role\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"codebuild-role\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:iam::757895497645:role/codebuild-role\",\n                            \"assume_role_policy\": \"{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\":[{\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":{\\\"Service\\\":\\\"codebuild.amazonaws.com\\\"},\\\"Action\\\":\\\"sts:AssumeRole\\\"}]}\",\n                            \"create_date\": \"2018-01-29T23:28:37Z\",\n                            \"force_detach_policies\": \"false\",\n                            \"id\": \"codebuild-role\",\n                            \"name\": \"codebuild-role\",\n                            \"path\": \"/\",\n                            \"unique_id\": \"AROAICHAQ5FCSUYX4VXQK\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role.codepipeline_role\": {\n                    \"type\": \"aws_iam_role\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"codepipeline-role\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:iam::757895497645:role/codepipeline-role\",\n                            \"assume_role_policy\": \"{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\":[{\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":{\\\"Service\\\":\\\"codepipeline.amazonaws.com\\\"},\\\"Action\\\":\\\"sts:AssumeRole\\\"}]}\",\n                            \"create_date\": \"2018-01-29T23:28:37Z\",\n                            \"force_detach_policies\": \"false\",\n                            \"id\": \"codepipeline-role\",\n                            \"name\": \"codepipeline-role\",\n                            \"path\": \"/\",\n                            \"unique_id\": \"AROAJHWRJMZIPIHK55V3Y\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role_policy.codebuild_policy\": {\n                    \"type\": \"aws_iam_role_policy\",\n                    \"depends_on\": [\n                        \"aws_iam_role.codebuild_role\",\n                        \"data.template_file.codebuild_policy\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"codebuild-role:codebuild-policy\",\n                        \"attributes\": {\n                            \"id\": \"codebuild-role:codebuild-policy\",\n                            \"name\": \"codebuild-policy\",\n                            \"policy\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ],\\n      \\\"Action\\\": [\\n        \\\"logs:CreateLogGroup\\\",\\n        \\\"logs:CreateLogStream\\\",\\n        \\\"logs:PutLogEvents\\\",\\n        \\\"ecr:GetAuthorizationToken\\\",\\n        \\\"ecr:InitiateLayerUpload\\\",\\n        \\\"ecr:UploadLayerPart\\\",\\n        \\\"ecr:CompleteLayerUpload\\\",\\n        \\\"ecr:BatchCheckLayerAvailability\\\",\\n        \\\"ecr:PutImage\\\",\\n        \\\"ecs:RunTask\\\",\\n        \\\"iam:PassRole\\\"\\n      ]\\n    },\\n    {\\n      \\\"Effect\\\":\\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"s3:GetObject\\\",\\n        \\\"s3:GetObjectVersion\\\",\\n        \\\"s3:GetBucketVersioning\\\",\\n        \\\"s3:List*\\\",\\n        \\\"s3:PutObject\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:s3:::openjobs-experiment-source\\\",\\n        \\\"arn:aws:s3:::openjobs-experiment-source/*\\\"\\n      ]\\n    }\\n  ]\\n}\\n\",\n                            \"role\": \"codebuild-role\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role_policy.codepipeline_policy\": {\n                    \"type\": \"aws_iam_role_policy\",\n                    \"depends_on\": [\n                        \"aws_iam_role.codepipeline_role\",\n                        \"data.template_file.codepipeline_policy\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"codepipeline-role:codepipeline_policy\",\n                        \"attributes\": {\n                            \"id\": \"codepipeline-role:codepipeline_policy\",\n                            \"name\": \"codepipeline_policy\",\n                            \"policy\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\":\\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"s3:GetObject\\\",\\n        \\\"s3:GetObjectVersion\\\",\\n        \\\"s3:GetBucketVersioning\\\",\\n        \\\"s3:List*\\\",\\n        \\\"s3:PutObject\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:s3:::openjobs-experiment-source\\\",\\n        \\\"arn:aws:s3:::openjobs-experiment-source/*\\\"\\n      ]\\n    },\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"codebuild:BatchGetBuilds\\\",\\n        \\\"codebuild:StartBuild\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\"\\n    },\\n    {\\n      \\\"Action\\\": [\\n        \\\"ecs:*\\\",\\n        \\\"events:DescribeRule\\\",\\n        \\\"events:DeleteRule\\\",\\n        \\\"events:ListRuleNamesByTarget\\\",\\n        \\\"events:ListTargetsByRule\\\",\\n        \\\"events:PutRule\\\",\\n        \\\"events:PutTargets\\\",\\n        \\\"events:RemoveTargets\\\",\\n        \\\"iam:ListAttachedRolePolicies\\\",\\n        \\\"iam:ListInstanceProfiles\\\",\\n        \\\"iam:ListRoles\\\",\\n        \\\"logs:CreateLogGroup\\\",\\n        \\\"logs:DescribeLogGroups\\\",\\n        \\\"logs:FilterLogEvents\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\",\\n      \\\"Effect\\\": \\\"Allow\\\"\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": \\\"ecs-tasks.amazonaws.com\\\"\\n        }\\n      }\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:iam::*:role/ecsInstanceRole*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": [\\n            \\\"ec2.amazonaws.com\\\",\\n            \\\"ec2.amazonaws.com.cn\\\"\\n          ]\\n        }\\n      }\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:iam::*:role/ecsAutoscaleRole*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": [\\n            \\\"application-autoscaling.amazonaws.com\\\",\\n            \\\"application-autoscaling.amazonaws.com.cn\\\"\\n          ]\\n        }\\n      }\\n    },\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": \\\"iam:CreateServiceLinkedRole\\\",\\n      \\\"Resource\\\": \\\"*\\\",\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:AWSServiceName\\\": [\\n            \\\"ecs.amazonaws.com\\\",\\n            \\\"spot.amazonaws.com\\\",\\n            \\\"spotfleet.amazonaws.com\\\"\\n          ]\\n        }\\n      }\\n    }\\n  ]\\n}\\n\",\n                            \"role\": \"codepipeline-role\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_s3_bucket.source\": {\n                    \"type\": \"aws_s3_bucket\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"openjobs-experiment-source\",\n                        \"attributes\": {\n                            \"acceleration_status\": \"\",\n                            \"acl\": \"private\",\n                            \"arn\": \"arn:aws:s3:::openjobs-experiment-source\",\n                            \"bucket\": \"openjobs-experiment-source\",\n                            \"bucket_domain_name\": \"openjobs-experiment-source.s3.amazonaws.com\",\n                            \"force_destroy\": \"true\",\n                            \"hosted_zone_id\": \"Z3AQBSTGFYJSTF\",\n                            \"id\": \"openjobs-experiment-source\",\n                            \"logging.#\": \"0\",\n                            \"region\": \"us-east-1\",\n                            \"request_payer\": \"BucketOwner\",\n                            \"server_side_encryption_configuration.#\": \"0\",\n                            \"tags.%\": \"0\",\n                            \"versioning.#\": \"1\",\n                            \"versioning.0.enabled\": \"false\",\n                            \"versioning.0.mfa_delete\": \"false\",\n                            \"website.#\": \"0\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"data.template_file.buildspec\": {\n                    \"type\": \"template_file\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"e7702248cb433806793abb9abe4a00cf364fad9c8148e6325d33919122c8932f\",\n                        \"attributes\": {\n                            \"id\": \"e7702248cb433806793abb9abe4a00cf364fad9c8148e6325d33919122c8932f\",\n                            \"rendered\": \"version: 0.2\\n\\nphases:\\n  pre_build:\\n    commands:\\n      - pip install awscli --upgrade --user\\n      - echo `aws --version`\\n      - echo Logging in to Amazon ECR...\\n      - $(aws ecr get-login --region us-east-1 --no-include-email)\\n      - REPOSITORY_URI=757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\\n      - IMAGE_TAG=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)\\n      - echo Entered the pre_build phase...\\n  build:\\n    commands:\\n      - echo Build started on `date`\\n      - echo Building the Docker image...\\n      - docker build --build-arg build_without=\\\"development test\\\" --build-arg rails_env=\\\"production\\\" -t $REPOSITORY_URI:latest .\\n      - docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG\\n  post_build:\\n    commands:\\n      - echo Build completed on `date`\\n      - echo Pushing the Docker images...\\n      - docker push $REPOSITORY_URI:latest\\n      - docker push $REPOSITORY_URI:$IMAGE_TAG\\n      - echo Writing image definitions file...\\n      - printf '[{\\\"name\\\":\\\"web\\\",\\\"imageUri\\\":\\\"%s\\\"}]' $REPOSITORY_URI:$IMAGE_TAG \\u003e imagedefinitions.json\\n      - echo upgrading db-migrate task definitions\\n      - aws ecs run-task --launch-type FARGATE --cluster production-ecs-cluster --task-definition production_db_migrate --network-configuration \\\"awsvpcConfiguration={subnets=[subnet-de3444f1],securityGroups=[sg-2b37fd5c,sg-34438943]}\\\"\\nartifacts:\\n  files: imagedefinitions.json\\n\",\n                            \"template\": \"version: 0.2\\n\\nphases:\\n  pre_build:\\n    commands:\\n      - pip install awscli --upgrade --user\\n      - echo `aws --version`\\n      - echo Logging in to Amazon ECR...\\n      - $(aws ecr get-login --region ${region} --no-include-email)\\n      - REPOSITORY_URI=${repository_url}\\n      - IMAGE_TAG=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)\\n      - echo Entered the pre_build phase...\\n  build:\\n    commands:\\n      - echo Build started on `date`\\n      - echo Building the Docker image...\\n      - docker build --build-arg build_without=\\\"development test\\\" --build-arg rails_env=\\\"production\\\" -t $REPOSITORY_URI:latest .\\n      - docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG\\n  post_build:\\n    commands:\\n      - echo Build completed on `date`\\n      - echo Pushing the Docker images...\\n      - docker push $REPOSITORY_URI:latest\\n      - docker push $REPOSITORY_URI:$IMAGE_TAG\\n      - echo Writing image definitions file...\\n      - printf '[{\\\"name\\\":\\\"web\\\",\\\"imageUri\\\":\\\"%s\\\"}]' $REPOSITORY_URI:$IMAGE_TAG \\u003e imagedefinitions.json\\n      - echo upgrading db-migrate task definitions\\n      - aws ecs run-task --launch-type FARGATE --cluster ${cluster_name} --task-definition production_db_migrate --network-configuration \\\"awsvpcConfiguration={subnets=[${subnet_id}],securityGroups=[${security_group_ids}]}\\\"\\nartifacts:\\n  files: imagedefinitions.json\\n\",\n                            \"vars.%\": \"5\",\n                            \"vars.cluster_name\": \"production-ecs-cluster\",\n                            \"vars.region\": \"us-east-1\",\n                            \"vars.repository_url\": \"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\",\n                            \"vars.security_group_ids\": \"sg-2b37fd5c,sg-34438943\",\n                            \"vars.subnet_id\": \"subnet-de3444f1\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.template\"\n                },\n                \"data.template_file.codebuild_policy\": {\n                    \"type\": \"template_file\",\n                    \"depends_on\": [\n                        \"aws_s3_bucket.source\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"4c055009a1c510d22095df9aa79e4ae22ef6052f6fd5a4b27335c19c815dfc63\",\n                        \"attributes\": {\n                            \"id\": \"4c055009a1c510d22095df9aa79e4ae22ef6052f6fd5a4b27335c19c815dfc63\",\n                            \"rendered\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ],\\n      \\\"Action\\\": [\\n        \\\"logs:CreateLogGroup\\\",\\n        \\\"logs:CreateLogStream\\\",\\n        \\\"logs:PutLogEvents\\\",\\n        \\\"ecr:GetAuthorizationToken\\\",\\n        \\\"ecr:InitiateLayerUpload\\\",\\n        \\\"ecr:UploadLayerPart\\\",\\n        \\\"ecr:CompleteLayerUpload\\\",\\n        \\\"ecr:BatchCheckLayerAvailability\\\",\\n        \\\"ecr:PutImage\\\",\\n        \\\"ecs:RunTask\\\",\\n        \\\"iam:PassRole\\\"\\n      ]\\n    },\\n    {\\n      \\\"Effect\\\":\\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"s3:GetObject\\\",\\n        \\\"s3:GetObjectVersion\\\",\\n        \\\"s3:GetBucketVersioning\\\",\\n        \\\"s3:List*\\\",\\n        \\\"s3:PutObject\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:s3:::openjobs-experiment-source\\\",\\n        \\\"arn:aws:s3:::openjobs-experiment-source/*\\\"\\n      ]\\n    }\\n  ]\\n}\\n\",\n                            \"template\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ],\\n      \\\"Action\\\": [\\n        \\\"logs:CreateLogGroup\\\",\\n        \\\"logs:CreateLogStream\\\",\\n        \\\"logs:PutLogEvents\\\",\\n        \\\"ecr:GetAuthorizationToken\\\",\\n        \\\"ecr:InitiateLayerUpload\\\",\\n        \\\"ecr:UploadLayerPart\\\",\\n        \\\"ecr:CompleteLayerUpload\\\",\\n        \\\"ecr:BatchCheckLayerAvailability\\\",\\n        \\\"ecr:PutImage\\\",\\n        \\\"ecs:RunTask\\\",\\n        \\\"iam:PassRole\\\"\\n      ]\\n    },\\n    {\\n      \\\"Effect\\\":\\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"s3:GetObject\\\",\\n        \\\"s3:GetObjectVersion\\\",\\n        \\\"s3:GetBucketVersioning\\\",\\n        \\\"s3:List*\\\",\\n        \\\"s3:PutObject\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"${aws_s3_bucket_arn}\\\",\\n        \\\"${aws_s3_bucket_arn}/*\\\"\\n      ]\\n    }\\n  ]\\n}\\n\",\n                            \"vars.%\": \"1\",\n                            \"vars.aws_s3_bucket_arn\": \"arn:aws:s3:::openjobs-experiment-source\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.template\"\n                },\n                \"data.template_file.codepipeline_policy\": {\n                    \"type\": \"template_file\",\n                    \"depends_on\": [\n                        \"aws_s3_bucket.source\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"ab9ecdafdd89d3679ee56bbe11c6c8dbd04026580dc57ff1987a66c5b4e69fa6\",\n                        \"attributes\": {\n                            \"id\": \"ab9ecdafdd89d3679ee56bbe11c6c8dbd04026580dc57ff1987a66c5b4e69fa6\",\n                            \"rendered\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\":\\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"s3:GetObject\\\",\\n        \\\"s3:GetObjectVersion\\\",\\n        \\\"s3:GetBucketVersioning\\\",\\n        \\\"s3:List*\\\",\\n        \\\"s3:PutObject\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:s3:::openjobs-experiment-source\\\",\\n        \\\"arn:aws:s3:::openjobs-experiment-source/*\\\"\\n      ]\\n    },\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"codebuild:BatchGetBuilds\\\",\\n        \\\"codebuild:StartBuild\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\"\\n    },\\n    {\\n      \\\"Action\\\": [\\n        \\\"ecs:*\\\",\\n        \\\"events:DescribeRule\\\",\\n        \\\"events:DeleteRule\\\",\\n        \\\"events:ListRuleNamesByTarget\\\",\\n        \\\"events:ListTargetsByRule\\\",\\n        \\\"events:PutRule\\\",\\n        \\\"events:PutTargets\\\",\\n        \\\"events:RemoveTargets\\\",\\n        \\\"iam:ListAttachedRolePolicies\\\",\\n        \\\"iam:ListInstanceProfiles\\\",\\n        \\\"iam:ListRoles\\\",\\n        \\\"logs:CreateLogGroup\\\",\\n        \\\"logs:DescribeLogGroups\\\",\\n        \\\"logs:FilterLogEvents\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\",\\n      \\\"Effect\\\": \\\"Allow\\\"\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": \\\"ecs-tasks.amazonaws.com\\\"\\n        }\\n      }\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:iam::*:role/ecsInstanceRole*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": [\\n            \\\"ec2.amazonaws.com\\\",\\n            \\\"ec2.amazonaws.com.cn\\\"\\n          ]\\n        }\\n      }\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:iam::*:role/ecsAutoscaleRole*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": [\\n            \\\"application-autoscaling.amazonaws.com\\\",\\n            \\\"application-autoscaling.amazonaws.com.cn\\\"\\n          ]\\n        }\\n      }\\n    },\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": \\\"iam:CreateServiceLinkedRole\\\",\\n      \\\"Resource\\\": \\\"*\\\",\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:AWSServiceName\\\": [\\n            \\\"ecs.amazonaws.com\\\",\\n            \\\"spot.amazonaws.com\\\",\\n            \\\"spotfleet.amazonaws.com\\\"\\n          ]\\n        }\\n      }\\n    }\\n  ]\\n}\\n\",\n                            \"template\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\":\\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"s3:GetObject\\\",\\n        \\\"s3:GetObjectVersion\\\",\\n        \\\"s3:GetBucketVersioning\\\",\\n        \\\"s3:List*\\\",\\n        \\\"s3:PutObject\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"${aws_s3_bucket_arn}\\\",\\n        \\\"${aws_s3_bucket_arn}/*\\\"\\n      ]\\n    },\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"codebuild:BatchGetBuilds\\\",\\n        \\\"codebuild:StartBuild\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\"\\n    },\\n    {\\n      \\\"Action\\\": [\\n        \\\"ecs:*\\\",\\n        \\\"events:DescribeRule\\\",\\n        \\\"events:DeleteRule\\\",\\n        \\\"events:ListRuleNamesByTarget\\\",\\n        \\\"events:ListTargetsByRule\\\",\\n        \\\"events:PutRule\\\",\\n        \\\"events:PutTargets\\\",\\n        \\\"events:RemoveTargets\\\",\\n        \\\"iam:ListAttachedRolePolicies\\\",\\n        \\\"iam:ListInstanceProfiles\\\",\\n        \\\"iam:ListRoles\\\",\\n        \\\"logs:CreateLogGroup\\\",\\n        \\\"logs:DescribeLogGroups\\\",\\n        \\\"logs:FilterLogEvents\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\",\\n      \\\"Effect\\\": \\\"Allow\\\"\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": \\\"ecs-tasks.amazonaws.com\\\"\\n        }\\n      }\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:iam::*:role/ecsInstanceRole*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": [\\n            \\\"ec2.amazonaws.com\\\",\\n            \\\"ec2.amazonaws.com.cn\\\"\\n          ]\\n        }\\n      }\\n    },\\n    {\\n      \\\"Action\\\": \\\"iam:PassRole\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Resource\\\": [\\n        \\\"arn:aws:iam::*:role/ecsAutoscaleRole*\\\"\\n      ],\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:PassedToService\\\": [\\n            \\\"application-autoscaling.amazonaws.com\\\",\\n            \\\"application-autoscaling.amazonaws.com.cn\\\"\\n          ]\\n        }\\n      }\\n    },\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": \\\"iam:CreateServiceLinkedRole\\\",\\n      \\\"Resource\\\": \\\"*\\\",\\n      \\\"Condition\\\": {\\n        \\\"StringLike\\\": {\\n          \\\"iam:AWSServiceName\\\": [\\n            \\\"ecs.amazonaws.com\\\",\\n            \\\"spot.amazonaws.com\\\",\\n            \\\"spotfleet.amazonaws.com\\\"\\n          ]\\n        }\\n      }\\n    }\\n  ]\\n}\\n\",\n                            \"vars.%\": \"1\",\n                            \"vars.aws_s3_bucket_arn\": \"arn:aws:s3:::openjobs-experiment-source\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.template\"\n                }\n            },\n            \"depends_on\": []\n        },\n        {\n            \"path\": [\n                \"root\",\n                \"ecs\"\n            ],\n            \"outputs\": {\n                \"alb_dns_name\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"production-alb-openjobs-651485480.us-east-1.elb.amazonaws.com\"\n                },\n                \"alb_zone_id\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"Z35SXDOTRQ7X7K\"\n                },\n                \"cluster_name\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"production-ecs-cluster\"\n                },\n                \"repository_url\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\"\n                },\n                \"service_name\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"production-web\"\n                }\n            },\n            \"resources\": {\n                \"aws_alb.alb_openjobs\": {\n                    \"type\": \"aws_alb\",\n                    \"depends_on\": [\n                        \"aws_security_group.web_inbound_sg\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:loadbalancer/app/production-alb-openjobs/e05233787da23cb4\",\n                        \"attributes\": {\n                            \"access_logs.#\": \"0\",\n                            \"arn\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:loadbalancer/app/production-alb-openjobs/e05233787da23cb4\",\n                            \"arn_suffix\": \"app/production-alb-openjobs/e05233787da23cb4\",\n                            \"dns_name\": \"production-alb-openjobs-651485480.us-east-1.elb.amazonaws.com\",\n                            \"enable_deletion_protection\": \"false\",\n                            \"id\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:loadbalancer/app/production-alb-openjobs/e05233787da23cb4\",\n                            \"idle_timeout\": \"60\",\n                            \"internal\": \"false\",\n                            \"ip_address_type\": \"ipv4\",\n                            \"load_balancer_type\": \"application\",\n                            \"name\": \"production-alb-openjobs\",\n                            \"security_groups.#\": \"3\",\n                            \"security_groups.2014916961\": \"sg-34438943\",\n                            \"security_groups.569761485\": \"sg-2b37fd5c\",\n                            \"security_groups.796629976\": \"sg-9c36fceb\",\n                            \"subnets.#\": \"2\",\n                            \"subnets.1535720245\": \"subnet-6537474a\",\n                            \"subnets.2382224226\": \"subnet-08774e43\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-alb-openjobs\",\n                            \"vpc_id\": \"vpc-32041f4a\",\n                            \"zone_id\": \"Z35SXDOTRQ7X7K\"\n                        },\n                        \"meta\": {\n                            \"e2bfb730-ecaa-11e6-8f88-34363bc7c4c0\": {\n                                \"create\": 600000000000,\n                                \"delete\": 600000000000,\n                                \"update\": 600000000000\n                            }\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_alb_listener.openjobs\": {\n                    \"type\": \"aws_alb_listener\",\n                    \"depends_on\": [\n                        \"aws_alb.alb_openjobs\",\n                        \"aws_alb_target_group.alb_target_group\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:listener/app/production-alb-openjobs/e05233787da23cb4/f40e25cfcd5b6579\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:listener/app/production-alb-openjobs/e05233787da23cb4/f40e25cfcd5b6579\",\n                            \"default_action.#\": \"1\",\n                            \"default_action.0.target_group_arn\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:targetgroup/production-alb-target-group-f14c/64f397ce227b864f\",\n                            \"default_action.0.type\": \"forward\",\n                            \"id\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:listener/app/production-alb-openjobs/e05233787da23cb4/f40e25cfcd5b6579\",\n                            \"load_balancer_arn\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:loadbalancer/app/production-alb-openjobs/e05233787da23cb4\",\n                            \"port\": \"80\",\n                            \"protocol\": \"HTTP\",\n                            \"ssl_policy\": \"\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_alb_target_group.alb_target_group\": {\n                    \"type\": \"aws_alb_target_group\",\n                    \"depends_on\": [\n                        \"random_id.target_group_sufix\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:targetgroup/production-alb-target-group-f14c/64f397ce227b864f\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:targetgroup/production-alb-target-group-f14c/64f397ce227b864f\",\n                            \"arn_suffix\": \"targetgroup/production-alb-target-group-f14c/64f397ce227b864f\",\n                            \"deregistration_delay\": \"300\",\n                            \"health_check.#\": \"1\",\n                            \"health_check.0.healthy_threshold\": \"5\",\n                            \"health_check.0.interval\": \"30\",\n                            \"health_check.0.matcher\": \"200\",\n                            \"health_check.0.path\": \"/\",\n                            \"health_check.0.port\": \"traffic-port\",\n                            \"health_check.0.protocol\": \"HTTP\",\n                            \"health_check.0.timeout\": \"5\",\n                            \"health_check.0.unhealthy_threshold\": \"2\",\n                            \"id\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:targetgroup/production-alb-target-group-f14c/64f397ce227b864f\",\n                            \"name\": \"production-alb-target-group-f14c\",\n                            \"port\": \"80\",\n                            \"protocol\": \"HTTP\",\n                            \"stickiness.#\": \"1\",\n                            \"stickiness.0.cookie_duration\": \"86400\",\n                            \"stickiness.0.enabled\": \"false\",\n                            \"stickiness.0.type\": \"lb_cookie\",\n                            \"tags.%\": \"0\",\n                            \"target_type\": \"ip\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_appautoscaling_policy.down\": {\n                    \"type\": \"aws_appautoscaling_policy\",\n                    \"depends_on\": [\n                        \"aws_appautoscaling_target.target\",\n                        \"aws_ecs_cluster.cluster\",\n                        \"aws_ecs_service.web\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"production_scale_down\",\n                        \"attributes\": {\n                            \"alarms.#\": \"0\",\n                            \"arn\": \"arn:aws:autoscaling:us-east-1:757895497645:scalingPolicy:4b2eb401-228f-42bb-a58c-97f439ab6844:resource/ecs/service/production-ecs-cluster/production-web:policyName/production_scale_down\",\n                            \"id\": \"production_scale_down\",\n                            \"name\": \"production_scale_down\",\n                            \"policy_type\": \"StepScaling\",\n                            \"resource_id\": \"service/production-ecs-cluster/production-web\",\n                            \"scalable_dimension\": \"ecs:service:DesiredCount\",\n                            \"service_namespace\": \"ecs\",\n                            \"step_scaling_policy_configuration.#\": \"1\",\n                            \"step_scaling_policy_configuration.0.adjustment_type\": \"ChangeInCapacity\",\n                            \"step_scaling_policy_configuration.0.cooldown\": \"60\",\n                            \"step_scaling_policy_configuration.0.metric_aggregation_type\": \"Maximum\",\n                            \"step_scaling_policy_configuration.0.min_adjustment_magnitude\": \"0\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.#\": \"1\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.1330763481.metric_interval_lower_bound\": \"0\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.1330763481.metric_interval_upper_bound\": \"-1\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.1330763481.scaling_adjustment\": \"-1\",\n                            \"target_tracking_scaling_policy_configuration.#\": \"0\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_appautoscaling_policy.up\": {\n                    \"type\": \"aws_appautoscaling_policy\",\n                    \"depends_on\": [\n                        \"aws_appautoscaling_target.target\",\n                        \"aws_ecs_cluster.cluster\",\n                        \"aws_ecs_service.web\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"production_scale_up\",\n                        \"attributes\": {\n                            \"alarms.#\": \"0\",\n                            \"arn\": \"arn:aws:autoscaling:us-east-1:757895497645:scalingPolicy:4b2eb401-228f-42bb-a58c-97f439ab6844:resource/ecs/service/production-ecs-cluster/production-web:policyName/production_scale_up\",\n                            \"id\": \"production_scale_up\",\n                            \"name\": \"production_scale_up\",\n                            \"policy_type\": \"StepScaling\",\n                            \"resource_id\": \"service/production-ecs-cluster/production-web\",\n                            \"scalable_dimension\": \"ecs:service:DesiredCount\",\n                            \"service_namespace\": \"ecs\",\n                            \"step_scaling_policy_configuration.#\": \"1\",\n                            \"step_scaling_policy_configuration.0.adjustment_type\": \"ChangeInCapacity\",\n                            \"step_scaling_policy_configuration.0.cooldown\": \"60\",\n                            \"step_scaling_policy_configuration.0.metric_aggregation_type\": \"Maximum\",\n                            \"step_scaling_policy_configuration.0.min_adjustment_magnitude\": \"0\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.#\": \"1\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.2280411133.metric_interval_lower_bound\": \"0\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.2280411133.metric_interval_upper_bound\": \"-1\",\n                            \"step_scaling_policy_configuration.0.step_adjustment.2280411133.scaling_adjustment\": \"1\",\n                            \"target_tracking_scaling_policy_configuration.#\": \"0\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_appautoscaling_target.target\": {\n                    \"type\": \"aws_appautoscaling_target\",\n                    \"depends_on\": [\n                        \"aws_ecs_cluster.cluster\",\n                        \"aws_ecs_service.web\",\n                        \"aws_iam_role.ecs_autoscale_role\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"service/production-ecs-cluster/production-web\",\n                        \"attributes\": {\n                            \"id\": \"service/production-ecs-cluster/production-web\",\n                            \"max_capacity\": \"4\",\n                            \"min_capacity\": \"2\",\n                            \"resource_id\": \"service/production-ecs-cluster/production-web\",\n                            \"role_arn\": \"arn:aws:iam::757895497645:role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService\",\n                            \"scalable_dimension\": \"ecs:service:DesiredCount\",\n                            \"service_namespace\": \"ecs\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_cloudwatch_log_group.openjobs\": {\n                    \"type\": \"aws_cloudwatch_log_group\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"openjobs\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:logs:us-east-1:757895497645:log-group:openjobs:*\",\n                            \"id\": \"openjobs\",\n                            \"kms_key_id\": \"\",\n                            \"name\": \"openjobs\",\n                            \"retention_in_days\": \"0\",\n                            \"tags.%\": \"2\",\n                            \"tags.Application\": \"OpenJobs\",\n                            \"tags.Environment\": \"production\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_cloudwatch_metric_alarm.service_cpu_high\": {\n                    \"type\": \"aws_cloudwatch_metric_alarm\",\n                    \"depends_on\": [\n                        \"aws_appautoscaling_policy.down\",\n                        \"aws_appautoscaling_policy.up\",\n                        \"aws_ecs_cluster.cluster\",\n                        \"aws_ecs_service.web\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"production_openjobs_web_cpu_utilization_high\",\n                        \"attributes\": {\n                            \"actions_enabled\": \"true\",\n                            \"alarm_actions.#\": \"1\",\n                            \"alarm_actions.2876257399\": \"arn:aws:autoscaling:us-east-1:757895497645:scalingPolicy:4b2eb401-228f-42bb-a58c-97f439ab6844:resource/ecs/service/production-ecs-cluster/production-web:policyName/production_scale_up\",\n                            \"alarm_description\": \"\",\n                            \"alarm_name\": \"production_openjobs_web_cpu_utilization_high\",\n                            \"comparison_operator\": \"GreaterThanOrEqualToThreshold\",\n                            \"datapoints_to_alarm\": \"0\",\n                            \"dimensions.%\": \"2\",\n                            \"dimensions.ClusterName\": \"production-ecs-cluster\",\n                            \"dimensions.ServiceName\": \"production-web\",\n                            \"evaluate_low_sample_count_percentiles\": \"\",\n                            \"evaluation_periods\": \"2\",\n                            \"extended_statistic\": \"\",\n                            \"id\": \"production_openjobs_web_cpu_utilization_high\",\n                            \"insufficient_data_actions.#\": \"0\",\n                            \"metric_name\": \"CPUUtilization\",\n                            \"namespace\": \"AWS/ECS\",\n                            \"ok_actions.#\": \"1\",\n                            \"ok_actions.901305810\": \"arn:aws:autoscaling:us-east-1:757895497645:scalingPolicy:4b2eb401-228f-42bb-a58c-97f439ab6844:resource/ecs/service/production-ecs-cluster/production-web:policyName/production_scale_down\",\n                            \"period\": \"60\",\n                            \"statistic\": \"Maximum\",\n                            \"threshold\": \"85\",\n                            \"treat_missing_data\": \"missing\",\n                            \"unit\": \"\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_ecr_repository.openjobs_app\": {\n                    \"type\": \"aws_ecr_repository\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"openjobs/production\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:ecr:us-east-1:757895497645:repository/openjobs/production\",\n                            \"id\": \"openjobs/production\",\n                            \"name\": \"openjobs/production\",\n                            \"registry_id\": \"757895497645\",\n                            \"repository_url\": \"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_ecs_cluster.cluster\": {\n                    \"type\": \"aws_ecs_cluster\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"arn:aws:ecs:us-east-1:757895497645:cluster/production-ecs-cluster\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:ecs:us-east-1:757895497645:cluster/production-ecs-cluster\",\n                            \"id\": \"arn:aws:ecs:us-east-1:757895497645:cluster/production-ecs-cluster\",\n                            \"name\": \"production-ecs-cluster\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_ecs_service.web\": {\n                    \"type\": \"aws_ecs_service\",\n                    \"depends_on\": [\n                        \"aws_alb_target_group.alb_target_group\",\n                        \"aws_ecs_cluster.cluster\",\n                        \"aws_ecs_task_definition.web\",\n                        \"aws_iam_role_policy.ecs_service_role_policy\",\n                        \"aws_security_group.ecs_service\",\n                        \"data.aws_ecs_task_definition.web\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"arn:aws:ecs:us-east-1:757895497645:service/production-web\",\n                        \"attributes\": {\n                            \"cluster\": \"arn:aws:ecs:us-east-1:757895497645:cluster/production-ecs-cluster\",\n                            \"deployment_maximum_percent\": \"200\",\n                            \"deployment_minimum_healthy_percent\": \"100\",\n                            \"desired_count\": \"2\",\n                            \"health_check_grace_period_seconds\": \"0\",\n                            \"iam_role\": \"aws-service-role\",\n                            \"id\": \"arn:aws:ecs:us-east-1:757895497645:service/production-web\",\n                            \"launch_type\": \"FARGATE\",\n                            \"load_balancer.#\": \"1\",\n                            \"load_balancer.3261201814.container_name\": \"web\",\n                            \"load_balancer.3261201814.container_port\": \"80\",\n                            \"load_balancer.3261201814.elb_name\": \"\",\n                            \"load_balancer.3261201814.target_group_arn\": \"arn:aws:elasticloadbalancing:us-east-1:757895497645:targetgroup/production-alb-target-group-f14c/64f397ce227b864f\",\n                            \"name\": \"production-web\",\n                            \"network_configuration.#\": \"1\",\n                            \"network_configuration.0.security_groups.#\": \"3\",\n                            \"network_configuration.0.security_groups.2014916961\": \"sg-34438943\",\n                            \"network_configuration.0.security_groups.3119024256\": \"sg-ab4983dc\",\n                            \"network_configuration.0.security_groups.569761485\": \"sg-2b37fd5c\",\n                            \"network_configuration.0.subnets.#\": \"2\",\n                            \"network_configuration.0.subnets.3113454962\": \"subnet-30625b7b\",\n                            \"network_configuration.0.subnets.3378482322\": \"subnet-de3444f1\",\n                            \"placement_constraints.#\": \"0\",\n                            \"placement_strategy.#\": \"0\",\n                            \"task_definition\": \"production_web:17\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_ecs_task_definition.db_migrate\": {\n                    \"type\": \"aws_ecs_task_definition\",\n                    \"depends_on\": [\n                        \"aws_iam_role.ecs_execution_role\",\n                        \"data.template_file.db_migrate_task\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"production_db_migrate\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:ecs:us-east-1:757895497645:task-definition/production_db_migrate:3\",\n                            \"container_definitions\": \"[{\\\"command\\\":[\\\"bundle\\\",\\\"exec\\\",\\\"rake\\\",\\\"db:migrate\\\"],\\\"cpu\\\":0,\\\"environment\\\":[{\\\"name\\\":\\\"RAILS_LOG_TO_STDOUT\\\",\\\"value\\\":\\\"true\\\"},{\\\"name\\\":\\\"RAILS_ENV\\\",\\\"value\\\":\\\"production\\\"},{\\\"name\\\":\\\"DATABASE_URL\\\",\\\"value\\\":\\\"postgresql://openjobs:myawesomepasswordproduction@production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com:5432/openjobs_production?encoding=utf8\\u0026pool=40\\\"},{\\\"name\\\":\\\"SECRET_KEY_BASE\\\",\\\"value\\\":\\\"8d412aee3ceaa494fe1c276f5f7e524b9e33f649c03690e689e5b36a0cf4ce2a6f50024bc31f276c22b668e619d61a42b79f5e595759f377a8fa373e2907f41e\\\"}],\\\"essential\\\":true,\\\"image\\\":\\\"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\\\",\\\"logConfiguration\\\":{\\\"logDriver\\\":\\\"awslogs\\\",\\\"options\\\":{\\\"awslogs-group\\\":\\\"openjobs\\\",\\\"awslogs-region\\\":\\\"us-east-1\\\",\\\"awslogs-stream-prefix\\\":\\\"db_migrate\\\"}},\\\"memory\\\":300,\\\"mountPoints\\\":[],\\\"name\\\":\\\"db-migrate\\\",\\\"portMappings\\\":[],\\\"volumesFrom\\\":[]}]\",\n                            \"cpu\": \"256\",\n                            \"execution_role_arn\": \"arn:aws:iam::757895497645:role/ecs_task_execution_role\",\n                            \"family\": \"production_db_migrate\",\n                            \"id\": \"production_db_migrate\",\n                            \"memory\": \"512\",\n                            \"network_mode\": \"awsvpc\",\n                            \"placement_constraints.#\": \"0\",\n                            \"requires_compatibilities.#\": \"1\",\n                            \"requires_compatibilities.3072437307\": \"FARGATE\",\n                            \"revision\": \"3\",\n                            \"task_role_arn\": \"arn:aws:iam::757895497645:role/ecs_task_execution_role\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_ecs_task_definition.web\": {\n                    \"type\": \"aws_ecs_task_definition\",\n                    \"depends_on\": [\n                        \"aws_ecs_task_definition.web\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"production_web\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:ecs:us-east-1:757895497645:task-definition/production_web:15\",\n                            \"container_definitions\": \"[{\\\"cpu\\\":0,\\\"environment\\\":[{\\\"name\\\":\\\"RAILS_LOG_TO_STDOUT\\\",\\\"value\\\":\\\"true\\\"},{\\\"name\\\":\\\"RAILS_ENV\\\",\\\"value\\\":\\\"production\\\"},{\\\"name\\\":\\\"RAILS_SERVE_STATIC_FILES\\\",\\\"value\\\":\\\"true\\\"},{\\\"name\\\":\\\"DATABASE_URL\\\",\\\"value\\\":\\\"postgresql://openjobs:myawesomepasswordproduction@production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com:5432/openjobs_production?encoding=utf8\\u0026pool=40\\\"},{\\\"name\\\":\\\"PORT\\\",\\\"value\\\":\\\"80\\\"},{\\\"name\\\":\\\"SECRET_KEY_BASE\\\",\\\"value\\\":\\\"8d412aee3ceaa494fe1c276f5f7e524b9e33f649c03690e689e5b36a0cf4ce2a6f50024bc31f276c22b668e619d61a42b79f5e595759f377a8fa373e2907f41e\\\"}],\\\"essential\\\":true,\\\"image\\\":\\\"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\\\",\\\"logConfiguration\\\":{\\\"logDriver\\\":\\\"awslogs\\\",\\\"options\\\":{\\\"awslogs-group\\\":\\\"openjobs\\\",\\\"awslogs-region\\\":\\\"us-east-1\\\",\\\"awslogs-stream-prefix\\\":\\\"web\\\"}},\\\"memory\\\":300,\\\"mountPoints\\\":[],\\\"name\\\":\\\"web\\\",\\\"portMappings\\\":[{\\\"containerPort\\\":80,\\\"hostPort\\\":80,\\\"protocol\\\":\\\"tcp\\\"}],\\\"volumesFrom\\\":[]}]\",\n                            \"cpu\": \"256\",\n                            \"execution_role_arn\": \"arn:aws:iam::757895497645:role/ecs_task_execution_role\",\n                            \"family\": \"production_web\",\n                            \"id\": \"production_web\",\n                            \"memory\": \"512\",\n                            \"network_mode\": \"awsvpc\",\n                            \"placement_constraints.#\": \"0\",\n                            \"requires_compatibilities.#\": \"1\",\n                            \"requires_compatibilities.3072437307\": \"FARGATE\",\n                            \"revision\": \"15\",\n                            \"task_role_arn\": \"arn:aws:iam::757895497645:role/ecs_task_execution_role\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role.ecs_autoscale_role\": {\n                    \"type\": \"aws_iam_role\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"production_ecs_autoscale_role\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:iam::757895497645:role/production_ecs_autoscale_role\",\n                            \"assume_role_policy\": \"{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\":[{\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":{\\\"Service\\\":\\\"application-autoscaling.amazonaws.com\\\"},\\\"Action\\\":\\\"sts:AssumeRole\\\"}]}\",\n                            \"create_date\": \"2018-01-29T23:28:37Z\",\n                            \"force_detach_policies\": \"false\",\n                            \"id\": \"production_ecs_autoscale_role\",\n                            \"name\": \"production_ecs_autoscale_role\",\n                            \"path\": \"/\",\n                            \"unique_id\": \"AROAJVPUE3QI2CNQV4IDS\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role.ecs_execution_role\": {\n                    \"type\": \"aws_iam_role\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"ecs_task_execution_role\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:iam::757895497645:role/ecs_task_execution_role\",\n                            \"assume_role_policy\": \"{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\":[{\\\"Sid\\\":\\\"\\\",\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":{\\\"Service\\\":\\\"ecs-tasks.amazonaws.com\\\"},\\\"Action\\\":\\\"sts:AssumeRole\\\"}]}\",\n                            \"create_date\": \"2018-01-29T23:28:37Z\",\n                            \"force_detach_policies\": \"false\",\n                            \"id\": \"ecs_task_execution_role\",\n                            \"name\": \"ecs_task_execution_role\",\n                            \"path\": \"/\",\n                            \"unique_id\": \"AROAICQO62AXRIGA7AA4K\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role.ecs_role\": {\n                    \"type\": \"aws_iam_role\",\n                    \"depends_on\": [\n                        \"data.aws_iam_policy_document.ecs_service_role\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"ecs_role\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:iam::757895497645:role/ecs_role\",\n                            \"assume_role_policy\": \"{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\":[{\\\"Sid\\\":\\\"\\\",\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":{\\\"Service\\\":\\\"ecs.amazonaws.com\\\"},\\\"Action\\\":\\\"sts:AssumeRole\\\"}]}\",\n                            \"create_date\": \"2018-01-29T23:28:37Z\",\n                            \"force_detach_policies\": \"false\",\n                            \"id\": \"ecs_role\",\n                            \"name\": \"ecs_role\",\n                            \"path\": \"/\",\n                            \"unique_id\": \"AROAIVPNQJFMXVLEUPUAE\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role_policy.ecs_autoscale_role_policy\": {\n                    \"type\": \"aws_iam_role_policy\",\n                    \"depends_on\": [\n                        \"aws_iam_role.ecs_autoscale_role\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"production_ecs_autoscale_role:ecs_autoscale_role_policy\",\n                        \"attributes\": {\n                            \"id\": \"production_ecs_autoscale_role:ecs_autoscale_role_policy\",\n                            \"name\": \"ecs_autoscale_role_policy\",\n                            \"policy\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"ecs:DescribeServices\\\",\\n        \\\"ecs:UpdateService\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ]\\n    },\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"cloudwatch:DescribeAlarms\\\"\\n      ],\\n      \\\"Resource\\\": [\\n        \\\"*\\\"\\n      ]\\n    }\\n  ]\\n}\\n\",\n                            \"role\": \"production_ecs_autoscale_role\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role_policy.ecs_execution_role_policy\": {\n                    \"type\": \"aws_iam_role_policy\",\n                    \"depends_on\": [\n                        \"aws_iam_role.ecs_execution_role\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"ecs_task_execution_role:ecs_execution_role_policy\",\n                        \"attributes\": {\n                            \"id\": \"ecs_task_execution_role:ecs_execution_role_policy\",\n                            \"name\": \"ecs_execution_role_policy\",\n                            \"policy\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"ecr:GetAuthorizationToken\\\",\\n        \\\"ecr:BatchCheckLayerAvailability\\\",\\n        \\\"ecr:GetDownloadUrlForLayer\\\",\\n        \\\"ecr:BatchGetImage\\\",\\n        \\\"logs:CreateLogStream\\\",\\n        \\\"logs:PutLogEvents\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\"\\n    }\\n  ]\\n}\\n\",\n                            \"role\": \"ecs_task_execution_role\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_iam_role_policy.ecs_service_role_policy\": {\n                    \"type\": \"aws_iam_role_policy\",\n                    \"depends_on\": [\n                        \"aws_iam_role.ecs_role\",\n                        \"data.aws_iam_policy_document.ecs_service_policy\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"ecs_role:ecs_service_role_policy\",\n                        \"attributes\": {\n                            \"id\": \"ecs_role:ecs_service_role_policy\",\n                            \"name\": \"ecs_service_role_policy\",\n                            \"policy\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Sid\\\": \\\"\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"elasticloadbalancing:RegisterInstancesWithLoadBalancer\\\",\\n        \\\"elasticloadbalancing:Describe*\\\",\\n        \\\"elasticloadbalancing:DeregisterInstancesFromLoadBalancer\\\",\\n        \\\"ec2:Describe*\\\",\\n        \\\"ec2:AuthorizeSecurityGroupIngress\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\"\\n    }\\n  ]\\n}\",\n                            \"role\": \"ecs_role\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_security_group.ecs_service\": {\n                    \"type\": \"aws_security_group\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"sg-ab4983dc\",\n                        \"attributes\": {\n                            \"description\": \"Allow egress from container\",\n                            \"egress.#\": \"1\",\n                            \"egress.482069346.cidr_blocks.#\": \"1\",\n                            \"egress.482069346.cidr_blocks.0\": \"0.0.0.0/0\",\n                            \"egress.482069346.description\": \"\",\n                            \"egress.482069346.from_port\": \"0\",\n                            \"egress.482069346.ipv6_cidr_blocks.#\": \"0\",\n                            \"egress.482069346.prefix_list_ids.#\": \"0\",\n                            \"egress.482069346.protocol\": \"-1\",\n                            \"egress.482069346.security_groups.#\": \"0\",\n                            \"egress.482069346.self\": \"false\",\n                            \"egress.482069346.to_port\": \"0\",\n                            \"id\": \"sg-ab4983dc\",\n                            \"ingress.#\": \"1\",\n                            \"ingress.3068409405.cidr_blocks.#\": \"1\",\n                            \"ingress.3068409405.cidr_blocks.0\": \"0.0.0.0/0\",\n                            \"ingress.3068409405.description\": \"\",\n                            \"ingress.3068409405.from_port\": \"8\",\n                            \"ingress.3068409405.ipv6_cidr_blocks.#\": \"0\",\n                            \"ingress.3068409405.protocol\": \"icmp\",\n                            \"ingress.3068409405.security_groups.#\": \"0\",\n                            \"ingress.3068409405.self\": \"false\",\n                            \"ingress.3068409405.to_port\": \"0\",\n                            \"name\": \"production-ecs-service-sg\",\n                            \"owner_id\": \"757895497645\",\n                            \"revoke_rules_on_delete\": \"false\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-ecs-service-sg\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_security_group.web_inbound_sg\": {\n                    \"type\": \"aws_security_group\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"sg-9c36fceb\",\n                        \"attributes\": {\n                            \"description\": \"Allow HTTP from Anywhere into ALB\",\n                            \"egress.#\": \"1\",\n                            \"egress.482069346.cidr_blocks.#\": \"1\",\n                            \"egress.482069346.cidr_blocks.0\": \"0.0.0.0/0\",\n                            \"egress.482069346.description\": \"\",\n                            \"egress.482069346.from_port\": \"0\",\n                            \"egress.482069346.ipv6_cidr_blocks.#\": \"0\",\n                            \"egress.482069346.prefix_list_ids.#\": \"0\",\n                            \"egress.482069346.protocol\": \"-1\",\n                            \"egress.482069346.security_groups.#\": \"0\",\n                            \"egress.482069346.self\": \"false\",\n                            \"egress.482069346.to_port\": \"0\",\n                            \"id\": \"sg-9c36fceb\",\n                            \"ingress.#\": \"2\",\n                            \"ingress.2214680975.cidr_blocks.#\": \"1\",\n                            \"ingress.2214680975.cidr_blocks.0\": \"0.0.0.0/0\",\n                            \"ingress.2214680975.description\": \"\",\n                            \"ingress.2214680975.from_port\": \"80\",\n                            \"ingress.2214680975.ipv6_cidr_blocks.#\": \"0\",\n                            \"ingress.2214680975.protocol\": \"tcp\",\n                            \"ingress.2214680975.security_groups.#\": \"0\",\n                            \"ingress.2214680975.self\": \"false\",\n                            \"ingress.2214680975.to_port\": \"80\",\n                            \"ingress.3068409405.cidr_blocks.#\": \"1\",\n                            \"ingress.3068409405.cidr_blocks.0\": \"0.0.0.0/0\",\n                            \"ingress.3068409405.description\": \"\",\n                            \"ingress.3068409405.from_port\": \"8\",\n                            \"ingress.3068409405.ipv6_cidr_blocks.#\": \"0\",\n                            \"ingress.3068409405.protocol\": \"icmp\",\n                            \"ingress.3068409405.security_groups.#\": \"0\",\n                            \"ingress.3068409405.self\": \"false\",\n                            \"ingress.3068409405.to_port\": \"0\",\n                            \"name\": \"production-web-inbound-sg\",\n                            \"owner_id\": \"757895497645\",\n                            \"revoke_rules_on_delete\": \"false\",\n                            \"tags.%\": \"1\",\n                            \"tags.Name\": \"production-web-inbound-sg\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"data.aws_ecs_task_definition.web\": {\n                    \"type\": \"aws_ecs_task_definition\",\n                    \"depends_on\": [\n                        \"aws_ecs_task_definition.web\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"arn:aws:ecs:us-east-1:757895497645:task-definition/production_web:17\",\n                        \"attributes\": {\n                            \"family\": \"production_web\",\n                            \"id\": \"arn:aws:ecs:us-east-1:757895497645:task-definition/production_web:17\",\n                            \"network_mode\": \"awsvpc\",\n                            \"revision\": \"17\",\n                            \"status\": \"ACTIVE\",\n                            \"task_definition\": \"production_web\",\n                            \"task_role_arn\": \"arn:aws:iam::757895497645:role/ecs_task_execution_role\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"data.aws_iam_policy_document.ecs_service_policy\": {\n                    \"type\": \"aws_iam_policy_document\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"3615693260\",\n                        \"attributes\": {\n                            \"id\": \"3615693260\",\n                            \"json\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Sid\\\": \\\"\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": [\\n        \\\"elasticloadbalancing:RegisterInstancesWithLoadBalancer\\\",\\n        \\\"elasticloadbalancing:Describe*\\\",\\n        \\\"elasticloadbalancing:DeregisterInstancesFromLoadBalancer\\\",\\n        \\\"ec2:Describe*\\\",\\n        \\\"ec2:AuthorizeSecurityGroupIngress\\\"\\n      ],\\n      \\\"Resource\\\": \\\"*\\\"\\n    }\\n  ]\\n}\",\n                            \"statement.#\": \"1\",\n                            \"statement.0.actions.#\": \"5\",\n                            \"statement.0.actions.2459212947\": \"ec2:Describe*\",\n                            \"statement.0.actions.2464853358\": \"ec2:AuthorizeSecurityGroupIngress\",\n                            \"statement.0.actions.2706807274\": \"elasticloadbalancing:DeregisterInstancesFromLoadBalancer\",\n                            \"statement.0.actions.2747799858\": \"elasticloadbalancing:Describe*\",\n                            \"statement.0.actions.982461153\": \"elasticloadbalancing:RegisterInstancesWithLoadBalancer\",\n                            \"statement.0.condition.#\": \"0\",\n                            \"statement.0.effect\": \"Allow\",\n                            \"statement.0.not_actions.#\": \"0\",\n                            \"statement.0.not_principals.#\": \"0\",\n                            \"statement.0.not_resources.#\": \"0\",\n                            \"statement.0.principals.#\": \"0\",\n                            \"statement.0.resources.#\": \"1\",\n                            \"statement.0.resources.2679715827\": \"*\",\n                            \"statement.0.sid\": \"\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"data.aws_iam_policy_document.ecs_service_role\": {\n                    \"type\": \"aws_iam_policy_document\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"3622649364\",\n                        \"attributes\": {\n                            \"id\": \"3622649364\",\n                            \"json\": \"{\\n  \\\"Version\\\": \\\"2012-10-17\\\",\\n  \\\"Statement\\\": [\\n    {\\n      \\\"Sid\\\": \\\"\\\",\\n      \\\"Effect\\\": \\\"Allow\\\",\\n      \\\"Action\\\": \\\"sts:AssumeRole\\\",\\n      \\\"Principal\\\": {\\n        \\\"Service\\\": \\\"ecs.amazonaws.com\\\"\\n      }\\n    }\\n  ]\\n}\",\n                            \"statement.#\": \"1\",\n                            \"statement.0.actions.#\": \"1\",\n                            \"statement.0.actions.2528466339\": \"sts:AssumeRole\",\n                            \"statement.0.condition.#\": \"0\",\n                            \"statement.0.effect\": \"Allow\",\n                            \"statement.0.not_actions.#\": \"0\",\n                            \"statement.0.not_principals.#\": \"0\",\n                            \"statement.0.not_resources.#\": \"0\",\n                            \"statement.0.principals.#\": \"1\",\n                            \"statement.0.principals.1113412664.identifiers.#\": \"1\",\n                            \"statement.0.principals.1113412664.identifiers.1509832800\": \"ecs.amazonaws.com\",\n                            \"statement.0.principals.1113412664.type\": \"Service\",\n                            \"statement.0.resources.#\": \"0\",\n                            \"statement.0.sid\": \"\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"data.template_file.db_migrate_task\": {\n                    \"type\": \"template_file\",\n                    \"depends_on\": [\n                        \"aws_ecr_repository.openjobs_app\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"9f8dc05fb135a66b81d1a71719cc13472331e59cb17a7ffc53e4369a00a5d974\",\n                        \"attributes\": {\n                            \"id\": \"9f8dc05fb135a66b81d1a71719cc13472331e59cb17a7ffc53e4369a00a5d974\",\n                            \"rendered\": \"[\\n  {\\n    \\\"name\\\": \\\"db-migrate\\\",\\n    \\\"image\\\": \\\"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\\\",\\n    \\\"command\\\": [\\\"bundle\\\", \\\"exec\\\", \\\"rake\\\", \\\"db:migrate\\\"],\\n    \\\"memory\\\": 300,\\n    \\\"logConfiguration\\\": {\\n      \\\"logDriver\\\": \\\"awslogs\\\",\\n      \\\"options\\\": {\\n        \\\"awslogs-group\\\": \\\"openjobs\\\",\\n        \\\"awslogs-region\\\": \\\"us-east-1\\\",\\n        \\\"awslogs-stream-prefix\\\": \\\"db_migrate\\\"\\n      }\\n    },\\n    \\\"environment\\\": [\\n      {\\n        \\\"name\\\": \\\"RAILS_ENV\\\",\\n        \\\"value\\\": \\\"production\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"DATABASE_URL\\\",\\n        \\\"value\\\": \\\"postgresql://openjobs:myawesomepasswordproduction@production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com:5432/openjobs_production?encoding=utf8\\u0026pool=40\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"SECRET_KEY_BASE\\\",\\n        \\\"value\\\": \\\"8d412aee3ceaa494fe1c276f5f7e524b9e33f649c03690e689e5b36a0cf4ce2a6f50024bc31f276c22b668e619d61a42b79f5e595759f377a8fa373e2907f41e\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"RAILS_LOG_TO_STDOUT\\\",\\n        \\\"value\\\": \\\"true\\\"\\n      }\\n    ]\\n  }\\n]\\n\",\n                            \"template\": \"[\\n  {\\n    \\\"name\\\": \\\"db-migrate\\\",\\n    \\\"image\\\": \\\"${image}\\\",\\n    \\\"command\\\": [\\\"bundle\\\", \\\"exec\\\", \\\"rake\\\", \\\"db:migrate\\\"],\\n    \\\"memory\\\": 300,\\n    \\\"logConfiguration\\\": {\\n      \\\"logDriver\\\": \\\"awslogs\\\",\\n      \\\"options\\\": {\\n        \\\"awslogs-group\\\": \\\"${log_group}\\\",\\n        \\\"awslogs-region\\\": \\\"us-east-1\\\",\\n        \\\"awslogs-stream-prefix\\\": \\\"db_migrate\\\"\\n      }\\n    },\\n    \\\"environment\\\": [\\n      {\\n        \\\"name\\\": \\\"RAILS_ENV\\\",\\n        \\\"value\\\": \\\"production\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"DATABASE_URL\\\",\\n        \\\"value\\\": \\\"${database_url}\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"SECRET_KEY_BASE\\\",\\n        \\\"value\\\": \\\"${secret_key_base}\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"RAILS_LOG_TO_STDOUT\\\",\\n        \\\"value\\\": \\\"true\\\"\\n      }\\n    ]\\n  }\\n]\\n\",\n                            \"vars.%\": \"4\",\n                            \"vars.database_url\": \"postgresql://openjobs:myawesomepasswordproduction@production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com:5432/openjobs_production?encoding=utf8\\u0026pool=40\",\n                            \"vars.image\": \"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\",\n                            \"vars.log_group\": \"openjobs\",\n                            \"vars.secret_key_base\": \"8d412aee3ceaa494fe1c276f5f7e524b9e33f649c03690e689e5b36a0cf4ce2a6f50024bc31f276c22b668e619d61a42b79f5e595759f377a8fa373e2907f41e\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.template\"\n                },\n                \"data.template_file.web_task\": {\n                    \"type\": \"template_file\",\n                    \"depends_on\": [\n                        \"aws_cloudwatch_log_group.openjobs\",\n                        \"aws_ecr_repository.openjobs_app\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"73682dd0b9de61124ffb2871c60782725d5be54498ef1b502df4c39d4463ab49\",\n                        \"attributes\": {\n                            \"id\": \"73682dd0b9de61124ffb2871c60782725d5be54498ef1b502df4c39d4463ab49\",\n                            \"rendered\": \"[\\n  {\\n    \\\"name\\\": \\\"web\\\",\\n    \\\"image\\\": \\\"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\\\",\\n    \\\"portMappings\\\": [\\n      {\\n        \\\"containerPort\\\": 80,\\n        \\\"hostPort\\\": 80\\n      }\\n    ],\\n    \\\"memory\\\": 300,\\n    \\\"networkMode\\\": \\\"awsvpc\\\",\\n    \\\"logConfiguration\\\": {\\n      \\\"logDriver\\\": \\\"awslogs\\\",\\n      \\\"options\\\": {\\n        \\\"awslogs-group\\\": \\\"openjobs\\\",\\n        \\\"awslogs-region\\\": \\\"us-east-1\\\",\\n        \\\"awslogs-stream-prefix\\\": \\\"web\\\"\\n      }\\n    },\\n    \\\"environment\\\": [\\n      {\\n        \\\"name\\\": \\\"RAILS_ENV\\\",\\n        \\\"value\\\": \\\"production\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"DATABASE_URL\\\",\\n        \\\"value\\\": \\\"postgresql://openjobs:myawesomepasswordproduction@production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com:5432/openjobs_production?encoding=utf8\\u0026pool=40\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"SECRET_KEY_BASE\\\",\\n        \\\"value\\\": \\\"8d412aee3ceaa494fe1c276f5f7e524b9e33f649c03690e689e5b36a0cf4ce2a6f50024bc31f276c22b668e619d61a42b79f5e595759f377a8fa373e2907f41e\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"PORT\\\",\\n        \\\"value\\\": \\\"80\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"RAILS_LOG_TO_STDOUT\\\",\\n        \\\"value\\\": \\\"true\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"RAILS_SERVE_STATIC_FILES\\\",\\n        \\\"value\\\": \\\"true\\\"\\n      }\\n    ]\\n  }\\n]\\n\\n\",\n                            \"template\": \"[\\n  {\\n    \\\"name\\\": \\\"web\\\",\\n    \\\"image\\\": \\\"${image}\\\",\\n    \\\"portMappings\\\": [\\n      {\\n        \\\"containerPort\\\": 80,\\n        \\\"hostPort\\\": 80\\n      }\\n    ],\\n    \\\"memory\\\": 300,\\n    \\\"networkMode\\\": \\\"awsvpc\\\",\\n    \\\"logConfiguration\\\": {\\n      \\\"logDriver\\\": \\\"awslogs\\\",\\n      \\\"options\\\": {\\n        \\\"awslogs-group\\\": \\\"${log_group}\\\",\\n        \\\"awslogs-region\\\": \\\"us-east-1\\\",\\n        \\\"awslogs-stream-prefix\\\": \\\"web\\\"\\n      }\\n    },\\n    \\\"environment\\\": [\\n      {\\n        \\\"name\\\": \\\"RAILS_ENV\\\",\\n        \\\"value\\\": \\\"production\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"DATABASE_URL\\\",\\n        \\\"value\\\": \\\"${database_url}\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"SECRET_KEY_BASE\\\",\\n        \\\"value\\\": \\\"${secret_key_base}\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"PORT\\\",\\n        \\\"value\\\": \\\"80\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"RAILS_LOG_TO_STDOUT\\\",\\n        \\\"value\\\": \\\"true\\\"\\n      },\\n      {\\n        \\\"name\\\": \\\"RAILS_SERVE_STATIC_FILES\\\",\\n        \\\"value\\\": \\\"true\\\"\\n      }\\n    ]\\n  }\\n]\\n\\n\",\n                            \"vars.%\": \"4\",\n                            \"vars.database_url\": \"postgresql://openjobs:myawesomepasswordproduction@production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com:5432/openjobs_production?encoding=utf8\\u0026pool=40\",\n                            \"vars.image\": \"757895497645.dkr.ecr.us-east-1.amazonaws.com/openjobs/production\",\n                            \"vars.log_group\": \"openjobs\",\n                            \"vars.secret_key_base\": \"8d412aee3ceaa494fe1c276f5f7e524b9e33f649c03690e689e5b36a0cf4ce2a6f50024bc31f276c22b668e619d61a42b79f5e595759f377a8fa373e2907f41e\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.template\"\n                },\n                \"random_id.target_group_sufix\": {\n                    \"type\": \"random_id\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"8Uw\",\n                        \"attributes\": {\n                            \"b64\": \"8Uw\",\n                            \"b64_std\": \"8Uw=\",\n                            \"b64_url\": \"8Uw\",\n                            \"byte_length\": \"2\",\n                            \"dec\": \"61772\",\n                            \"hex\": \"f14c\",\n                            \"id\": \"8Uw\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.random\"\n                }\n            },\n            \"depends_on\": []\n        },\n        {\n            \"path\": [\n                \"root\",\n                \"networking\"\n            ],\n            \"outputs\": {\n                \"default_sg_id\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"sg-34438943\"\n                },\n                \"private_subnets_id\": {\n                    \"sensitive\": false,\n                    \"type\": \"list\",\n                    \"value\": [\n                        \"subnet-de3444f1\",\n                        \"subnet-30625b7b\"\n                    ]\n                },\n                \"public_subnets_id\": {\n                    \"sensitive\": false,\n                    \"type\": \"list\",\n                    \"value\": [\n                        \"subnet-6537474a\",\n                        \"subnet-08774e43\"\n                    ]\n                },\n                \"security_groups_ids\": {\n                    \"sensitive\": false,\n                    \"type\": \"list\",\n                    \"value\": [\n                        \"sg-34438943\"\n                    ]\n                },\n                \"vpc_id\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"vpc-32041f4a\"\n                }\n            },\n            \"resources\": {\n                \"aws_eip.nat_eip\": {\n                    \"type\": \"aws_eip\",\n                    \"depends_on\": [\n                        \"aws_internet_gateway.ig\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"eipalloc-098c613f\",\n                        \"attributes\": {\n                            \"association_id\": \"eipassoc-eed306e5\",\n                            \"domain\": \"vpc\",\n                            \"id\": \"eipalloc-098c613f\",\n                            \"instance\": \"\",\n                            \"network_interface\": \"eni-8bf61c46\",\n                            \"private_ip\": \"10.0.1.128\",\n                            \"public_ip\": \"34.193.75.40\",\n                            \"tags.%\": \"0\",\n                            \"vpc\": \"true\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_internet_gateway.ig\": {\n                    \"type\": \"aws_internet_gateway\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"igw-1a373e63\",\n                        \"attributes\": {\n                            \"id\": \"igw-1a373e63\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-igw\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_nat_gateway.nat\": {\n                    \"type\": \"aws_nat_gateway\",\n                    \"depends_on\": [\n                        \"aws_eip.nat_eip\",\n                        \"aws_internet_gateway.ig\",\n                        \"aws_subnet.public_subnet.*\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"nat-0000beab268c3255b\",\n                        \"attributes\": {\n                            \"allocation_id\": \"eipalloc-098c613f\",\n                            \"id\": \"nat-0000beab268c3255b\",\n                            \"network_interface_id\": \"eni-8bf61c46\",\n                            \"private_ip\": \"10.0.1.128\",\n                            \"public_ip\": \"34.193.75.40\",\n                            \"subnet_id\": \"subnet-6537474a\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-us-east-1a-nat\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route.private_nat_gateway\": {\n                    \"type\": \"aws_route\",\n                    \"depends_on\": [\n                        \"aws_nat_gateway.nat\",\n                        \"aws_route_table.private\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"r-rtb-6fc4f8121080289494\",\n                        \"attributes\": {\n                            \"destination_cidr_block\": \"0.0.0.0/0\",\n                            \"destination_prefix_list_id\": \"\",\n                            \"egress_only_gateway_id\": \"\",\n                            \"gateway_id\": \"\",\n                            \"id\": \"r-rtb-6fc4f8121080289494\",\n                            \"instance_id\": \"\",\n                            \"instance_owner_id\": \"\",\n                            \"nat_gateway_id\": \"nat-0000beab268c3255b\",\n                            \"network_interface_id\": \"\",\n                            \"origin\": \"CreateRoute\",\n                            \"route_table_id\": \"rtb-6fc4f812\",\n                            \"state\": \"active\",\n                            \"vpc_peering_connection_id\": \"\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route.public_internet_gateway\": {\n                    \"type\": \"aws_route\",\n                    \"depends_on\": [\n                        \"aws_internet_gateway.ig\",\n                        \"aws_route_table.public\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"r-rtb-8cccf0f11080289494\",\n                        \"attributes\": {\n                            \"destination_cidr_block\": \"0.0.0.0/0\",\n                            \"destination_prefix_list_id\": \"\",\n                            \"egress_only_gateway_id\": \"\",\n                            \"gateway_id\": \"igw-1a373e63\",\n                            \"id\": \"r-rtb-8cccf0f11080289494\",\n                            \"instance_id\": \"\",\n                            \"instance_owner_id\": \"\",\n                            \"nat_gateway_id\": \"\",\n                            \"network_interface_id\": \"\",\n                            \"origin\": \"CreateRoute\",\n                            \"route_table_id\": \"rtb-8cccf0f1\",\n                            \"state\": \"active\",\n                            \"vpc_peering_connection_id\": \"\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route_table.private\": {\n                    \"type\": \"aws_route_table\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"rtb-6fc4f812\",\n                        \"attributes\": {\n                            \"id\": \"rtb-6fc4f812\",\n                            \"propagating_vgws.#\": \"0\",\n                            \"route.#\": \"1\",\n                            \"route.4236193873.cidr_block\": \"0.0.0.0/0\",\n                            \"route.4236193873.egress_only_gateway_id\": \"\",\n                            \"route.4236193873.gateway_id\": \"\",\n                            \"route.4236193873.instance_id\": \"\",\n                            \"route.4236193873.ipv6_cidr_block\": \"\",\n                            \"route.4236193873.nat_gateway_id\": \"nat-0000beab268c3255b\",\n                            \"route.4236193873.network_interface_id\": \"\",\n                            \"route.4236193873.vpc_peering_connection_id\": \"\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-private-route-table\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route_table.public\": {\n                    \"type\": \"aws_route_table\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"rtb-8cccf0f1\",\n                        \"attributes\": {\n                            \"id\": \"rtb-8cccf0f1\",\n                            \"propagating_vgws.#\": \"0\",\n                            \"route.#\": \"1\",\n                            \"route.1381113949.cidr_block\": \"0.0.0.0/0\",\n                            \"route.1381113949.egress_only_gateway_id\": \"\",\n                            \"route.1381113949.gateway_id\": \"igw-1a373e63\",\n                            \"route.1381113949.instance_id\": \"\",\n                            \"route.1381113949.ipv6_cidr_block\": \"\",\n                            \"route.1381113949.nat_gateway_id\": \"\",\n                            \"route.1381113949.network_interface_id\": \"\",\n                            \"route.1381113949.vpc_peering_connection_id\": \"\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-public-route-table\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route_table_association.private.0\": {\n                    \"type\": \"aws_route_table_association\",\n                    \"depends_on\": [\n                        \"aws_route_table.private\",\n                        \"aws_subnet.private_subnet.*\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"rtbassoc-f2ef6e8e\",\n                        \"attributes\": {\n                            \"id\": \"rtbassoc-f2ef6e8e\",\n                            \"route_table_id\": \"rtb-6fc4f812\",\n                            \"subnet_id\": \"subnet-de3444f1\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route_table_association.private.1\": {\n                    \"type\": \"aws_route_table_association\",\n                    \"depends_on\": [\n                        \"aws_route_table.private\",\n                        \"aws_subnet.private_subnet.*\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"rtbassoc-78ec6d04\",\n                        \"attributes\": {\n                            \"id\": \"rtbassoc-78ec6d04\",\n                            \"route_table_id\": \"rtb-6fc4f812\",\n                            \"subnet_id\": \"subnet-30625b7b\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route_table_association.public.0\": {\n                    \"type\": \"aws_route_table_association\",\n                    \"depends_on\": [\n                        \"aws_route_table.public\",\n                        \"aws_subnet.public_subnet.*\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"rtbassoc-ebed6c97\",\n                        \"attributes\": {\n                            \"id\": \"rtbassoc-ebed6c97\",\n                            \"route_table_id\": \"rtb-8cccf0f1\",\n                            \"subnet_id\": \"subnet-6537474a\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_route_table_association.public.1\": {\n                    \"type\": \"aws_route_table_association\",\n                    \"depends_on\": [\n                        \"aws_route_table.public\",\n                        \"aws_subnet.public_subnet.*\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"rtbassoc-f0f4758c\",\n                        \"attributes\": {\n                            \"id\": \"rtbassoc-f0f4758c\",\n                            \"route_table_id\": \"rtb-8cccf0f1\",\n                            \"subnet_id\": \"subnet-08774e43\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_security_group.default\": {\n                    \"type\": \"aws_security_group\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"sg-34438943\",\n                        \"attributes\": {\n                            \"description\": \"Default security group to allow inbound/outbound from the VPC\",\n                            \"egress.#\": \"1\",\n                            \"egress.753360330.cidr_blocks.#\": \"0\",\n                            \"egress.753360330.description\": \"\",\n                            \"egress.753360330.from_port\": \"0\",\n                            \"egress.753360330.ipv6_cidr_blocks.#\": \"0\",\n                            \"egress.753360330.prefix_list_ids.#\": \"0\",\n                            \"egress.753360330.protocol\": \"-1\",\n                            \"egress.753360330.security_groups.#\": \"0\",\n                            \"egress.753360330.self\": \"true\",\n                            \"egress.753360330.to_port\": \"0\",\n                            \"id\": \"sg-34438943\",\n                            \"ingress.#\": \"1\",\n                            \"ingress.753360330.cidr_blocks.#\": \"0\",\n                            \"ingress.753360330.description\": \"\",\n                            \"ingress.753360330.from_port\": \"0\",\n                            \"ingress.753360330.ipv6_cidr_blocks.#\": \"0\",\n                            \"ingress.753360330.protocol\": \"-1\",\n                            \"ingress.753360330.security_groups.#\": \"0\",\n                            \"ingress.753360330.self\": \"true\",\n                            \"ingress.753360330.to_port\": \"0\",\n                            \"name\": \"production-default-sg\",\n                            \"owner_id\": \"757895497645\",\n                            \"revoke_rules_on_delete\": \"false\",\n                            \"tags.%\": \"1\",\n                            \"tags.Environment\": \"production\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_subnet.private_subnet.0\": {\n                    \"type\": \"aws_subnet\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"subnet-de3444f1\",\n                        \"attributes\": {\n                            \"assign_ipv6_address_on_creation\": \"false\",\n                            \"availability_zone\": \"us-east-1a\",\n                            \"cidr_block\": \"10.0.10.0/24\",\n                            \"id\": \"subnet-de3444f1\",\n                            \"map_public_ip_on_launch\": \"false\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-us-east-1a-private-subnet\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_subnet.private_subnet.1\": {\n                    \"type\": \"aws_subnet\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"subnet-30625b7b\",\n                        \"attributes\": {\n                            \"assign_ipv6_address_on_creation\": \"false\",\n                            \"availability_zone\": \"us-east-1b\",\n                            \"cidr_block\": \"10.0.20.0/24\",\n                            \"id\": \"subnet-30625b7b\",\n                            \"map_public_ip_on_launch\": \"false\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-us-east-1b-private-subnet\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_subnet.public_subnet.0\": {\n                    \"type\": \"aws_subnet\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"subnet-6537474a\",\n                        \"attributes\": {\n                            \"assign_ipv6_address_on_creation\": \"false\",\n                            \"availability_zone\": \"us-east-1a\",\n                            \"cidr_block\": \"10.0.1.0/24\",\n                            \"id\": \"subnet-6537474a\",\n                            \"map_public_ip_on_launch\": \"true\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-us-east-1a-public-subnet\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_subnet.public_subnet.1\": {\n                    \"type\": \"aws_subnet\",\n                    \"depends_on\": [\n                        \"aws_vpc.vpc\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"subnet-08774e43\",\n                        \"attributes\": {\n                            \"assign_ipv6_address_on_creation\": \"false\",\n                            \"availability_zone\": \"us-east-1b\",\n                            \"cidr_block\": \"10.0.2.0/24\",\n                            \"id\": \"subnet-08774e43\",\n                            \"map_public_ip_on_launch\": \"true\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-us-east-1b-public-subnet\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_vpc.vpc\": {\n                    \"type\": \"aws_vpc\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"vpc-32041f4a\",\n                        \"attributes\": {\n                            \"assign_generated_ipv6_cidr_block\": \"false\",\n                            \"cidr_block\": \"10.0.0.0/16\",\n                            \"default_network_acl_id\": \"acl-8280eef9\",\n                            \"default_route_table_id\": \"rtb-d6bd81ab\",\n                            \"default_security_group_id\": \"sg-d335ffa4\",\n                            \"dhcp_options_id\": \"dopt-15849877\",\n                            \"enable_classiclink\": \"false\",\n                            \"enable_classiclink_dns_support\": \"false\",\n                            \"enable_dns_hostnames\": \"true\",\n                            \"enable_dns_support\": \"true\",\n                            \"id\": \"vpc-32041f4a\",\n                            \"instance_tenancy\": \"default\",\n                            \"main_route_table_id\": \"rtb-d6bd81ab\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-vpc\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                }\n            },\n            \"depends_on\": []\n        },\n        {\n            \"path\": [\n                \"root\",\n                \"rds\"\n            ],\n            \"outputs\": {\n                \"db_access_sg_id\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"sg-2b37fd5c\"\n                },\n                \"rds_address\": {\n                    \"sensitive\": false,\n                    \"type\": \"string\",\n                    \"value\": \"production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com\"\n                }\n            },\n            \"resources\": {\n                \"aws_db_instance.rds\": {\n                    \"type\": \"aws_db_instance\",\n                    \"depends_on\": [\n                        \"aws_db_subnet_group.rds_subnet_group\",\n                        \"aws_security_group.rds_sg\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"production-database\",\n                        \"attributes\": {\n                            \"address\": \"production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com\",\n                            \"allocated_storage\": \"20\",\n                            \"arn\": \"arn:aws:rds:us-east-1:757895497645:db:production-database\",\n                            \"auto_minor_version_upgrade\": \"true\",\n                            \"availability_zone\": \"us-east-1a\",\n                            \"backup_retention_period\": \"0\",\n                            \"backup_window\": \"08:37-09:07\",\n                            \"ca_cert_identifier\": \"rds-ca-2015\",\n                            \"copy_tags_to_snapshot\": \"false\",\n                            \"db_subnet_group_name\": \"production-rds-subnet-group\",\n                            \"endpoint\": \"production-database.ccgs7gcr5zuj.us-east-1.rds.amazonaws.com:5432\",\n                            \"engine\": \"postgres\",\n                            \"engine_version\": \"9.6.6\",\n                            \"hosted_zone_id\": \"Z2R2ITUGPM61AM\",\n                            \"iam_database_authentication_enabled\": \"false\",\n                            \"id\": \"production-database\",\n                            \"identifier\": \"production-database\",\n                            \"instance_class\": \"db.t2.micro\",\n                            \"iops\": \"0\",\n                            \"kms_key_id\": \"\",\n                            \"license_model\": \"postgresql-license\",\n                            \"maintenance_window\": \"sat:04:07-sat:04:37\",\n                            \"monitoring_interval\": \"0\",\n                            \"multi_az\": \"false\",\n                            \"name\": \"openjobs_production\",\n                            \"option_group_name\": \"default:postgres-9-6\",\n                            \"parameter_group_name\": \"default.postgres9.6\",\n                            \"password\": \"myawesomepasswordproduction\",\n                            \"port\": \"5432\",\n                            \"publicly_accessible\": \"false\",\n                            \"replicas.#\": \"0\",\n                            \"replicate_source_db\": \"\",\n                            \"resource_id\": \"db-Z2YKHEFX3HMYUCQTU4Q3FC2BGY\",\n                            \"security_group_names.#\": \"0\",\n                            \"skip_final_snapshot\": \"true\",\n                            \"snapshot_identifier\": \"rds-production-snapshot\",\n                            \"status\": \"available\",\n                            \"storage_encrypted\": \"false\",\n                            \"storage_type\": \"standard\",\n                            \"tags.%\": \"1\",\n                            \"tags.Environment\": \"production\",\n                            \"timezone\": \"\",\n                            \"username\": \"openjobs\",\n                            \"vpc_security_group_ids.#\": \"1\",\n                            \"vpc_security_group_ids.251623276\": \"sg-c931fbbe\"\n                        },\n                        \"meta\": {\n                            \"e2bfb730-ecaa-11e6-8f88-34363bc7c4c0\": {\n                                \"create\": 2400000000000,\n                                \"delete\": 2400000000000,\n                                \"update\": 4800000000000\n                            }\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_db_subnet_group.rds_subnet_group\": {\n                    \"type\": \"aws_db_subnet_group\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"production-rds-subnet-group\",\n                        \"attributes\": {\n                            \"arn\": \"arn:aws:rds:us-east-1:757895497645:subgrp:production-rds-subnet-group\",\n                            \"description\": \"RDS subnet group\",\n                            \"id\": \"production-rds-subnet-group\",\n                            \"name\": \"production-rds-subnet-group\",\n                            \"subnet_ids.#\": \"2\",\n                            \"subnet_ids.3113454962\": \"subnet-30625b7b\",\n                            \"subnet_ids.3378482322\": \"subnet-de3444f1\",\n                            \"tags.%\": \"1\",\n                            \"tags.Environment\": \"production\"\n                        },\n                        \"meta\": {},\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_security_group.db_access_sg\": {\n                    \"type\": \"aws_security_group\",\n                    \"depends_on\": [],\n                    \"primary\": {\n                        \"id\": \"sg-2b37fd5c\",\n                        \"attributes\": {\n                            \"description\": \"Allow access to RDS\",\n                            \"egress.#\": \"0\",\n                            \"id\": \"sg-2b37fd5c\",\n                            \"ingress.#\": \"0\",\n                            \"name\": \"production-db-access-sg\",\n                            \"owner_id\": \"757895497645\",\n                            \"revoke_rules_on_delete\": \"false\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-db-access-sg\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                },\n                \"aws_security_group.rds_sg\": {\n                    \"type\": \"aws_security_group\",\n                    \"depends_on\": [\n                        \"aws_security_group.db_access_sg\"\n                    ],\n                    \"primary\": {\n                        \"id\": \"sg-c931fbbe\",\n                        \"attributes\": {\n                            \"description\": \"production Security Group\",\n                            \"egress.#\": \"1\",\n                            \"egress.482069346.cidr_blocks.#\": \"1\",\n                            \"egress.482069346.cidr_blocks.0\": \"0.0.0.0/0\",\n                            \"egress.482069346.description\": \"\",\n                            \"egress.482069346.from_port\": \"0\",\n                            \"egress.482069346.ipv6_cidr_blocks.#\": \"0\",\n                            \"egress.482069346.prefix_list_ids.#\": \"0\",\n                            \"egress.482069346.protocol\": \"-1\",\n                            \"egress.482069346.security_groups.#\": \"0\",\n                            \"egress.482069346.self\": \"false\",\n                            \"egress.482069346.to_port\": \"0\",\n                            \"id\": \"sg-c931fbbe\",\n                            \"ingress.#\": \"2\",\n                            \"ingress.4257570995.cidr_blocks.#\": \"0\",\n                            \"ingress.4257570995.description\": \"\",\n                            \"ingress.4257570995.from_port\": \"5432\",\n                            \"ingress.4257570995.ipv6_cidr_blocks.#\": \"0\",\n                            \"ingress.4257570995.protocol\": \"tcp\",\n                            \"ingress.4257570995.security_groups.#\": \"1\",\n                            \"ingress.4257570995.security_groups.569761485\": \"sg-2b37fd5c\",\n                            \"ingress.4257570995.self\": \"false\",\n                            \"ingress.4257570995.to_port\": \"5432\",\n                            \"ingress.753360330.cidr_blocks.#\": \"0\",\n                            \"ingress.753360330.description\": \"\",\n                            \"ingress.753360330.from_port\": \"0\",\n                            \"ingress.753360330.ipv6_cidr_blocks.#\": \"0\",\n                            \"ingress.753360330.protocol\": \"-1\",\n                            \"ingress.753360330.security_groups.#\": \"0\",\n                            \"ingress.753360330.self\": \"true\",\n                            \"ingress.753360330.to_port\": \"0\",\n                            \"name\": \"production-rds-sg\",\n                            \"owner_id\": \"757895497645\",\n                            \"revoke_rules_on_delete\": \"false\",\n                            \"tags.%\": \"2\",\n                            \"tags.Environment\": \"production\",\n                            \"tags.Name\": \"production-rds-sg\",\n                            \"vpc_id\": \"vpc-32041f4a\"\n                        },\n                        \"meta\": {\n                            \"schema_version\": \"1\"\n                        },\n                        \"tainted\": false\n                    },\n                    \"deposed\": [],\n                    \"provider\": \"provider.aws\"\n                }\n            },\n            \"depends_on\": []\n        }\n    ]\n}\n"
  },
  {
    "path": "terraform.tfvars",
    "content": "region                        = \"us-east-1\"\ndomain                        = \"ecsfargateexample.tk\"\n\n/* rds */\nproduction_database_name      = \"openjobs_production\"\nproduction_database_username  = \"openjobs\"\nproduction_database_password  = \"myawesomepasswordproduction\"\n\n/* secret key */\nproduction_secret_key_base    = \"8d412aee3ceaa494fe1c276f5f7e524b9e33f649c03690e689e5b36a0cf4ce2a6f50024bc31f276c22b668e619d61a42b79f5e595759f377a8fa373e2907f41e\"\n"
  },
  {
    "path": "variables.tf",
    "content": "variable \"region\" {\n  description = \"Region that the instances will be created\"\n}\n\n/*====\nenvironment specific variables\n======*/\n\nvariable \"production_database_name\" {\n  description = \"The database name for Production\"\n}\n\nvariable \"production_database_username\" {\n  description = \"The username for the Production database\"\n}\n\nvariable \"production_database_password\" {\n  description = \"The user password for the Production database\"\n}\n\nvariable \"production_secret_key_base\" {\n  description = \"The Rails secret key for production\"\n}\n\nvariable \"domain\" {\n  default = \"The domain of your application\"\n}\n"
  }
]