<NME> waypoint.prod.hcl
<BEF> project = "cardstack"

# Labels can be specified for organizational purposes.
# labels = { "foo" = "bar" }

app "hub" {
  path = "./packages/hub"

  build {
    use "docker" {
      dockerfile = "Dockerfile"

      build_args = {
        hub_command = "server"
      }
    }

    registry {
      use "aws-ecr" {
        region     = "us-east-1"
        repository = "hub"
        tag        = "latest"
      }
    }
  }

  deploy {
    use "aws-ecs" {
      service_port        = 3000
      region              = "us-east-1"
      memory              = "512"
      cluster             = "hub-prod"
      count               = 2
      subnets             = ["subnet-0c22641bd41cbdd1e", "subnet-01d36d7bcd0334fc0"]
      task_role_name      = "hub-ecs-task"
      execution_role_name = "hub-ecs-task-execution"
      security_group_ids  = ["sg-098518120fd2269f8"]

      alb {
        certificate = "arn:aws:acm:us-east-1:120317779495:certificate/20f287dd-ba3c-4175-8b06-5c3b1e75f6d9"
        subnets     = ["subnet-01d36d7bcd0334fc0", "subnet-0c22641bd41cbdd1e"]
      }

      secrets = {
        LAYER1_RPC_NODE_HTTPS_URL                     = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_https_url-p9kYAu"
        LAYER1_RPC_NODE_WSS_URL                       = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_wss_url-cTukZK"
        LAYER2_RPC_NODE_HTTPS_URL                     = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_url-K67DON"
        LAYER2_RPC_NODE_WSS_URL                       = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_wss_url-BXGFlG"
        GNOSIS_RPC_NODE_HTTPS_URL                     = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_https_url-G4nICS"
        GNOSIS_RPC_NODE_WSS_URL                       = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_wss_url-PWACaa"
        ETHEREUM_RPC_NODE_HTTPS_URL                   = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_https_url-9fE3dF"
        ETHEREUM_RPC_NODE_WSS_URL                     = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_wss_url-rH3BDy"
        POLYGON_RPC_NODE_HTTPS_URL                    = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_https_url-DlBN06"
        POLYGON_RPC_NODE_WSS_URL                      = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_wss_url-ErLq0E"
        HUB_AUTH_SECRET                               = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_auth_secret-amva1E"
        HUB_EMAIL_CARD_DROP_RATE_LIMIT_COUNT          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_email_card_drop_rate_limit_count-mdtxRC"
        HUB_EMAIL_CARD_DROP_RATE_LIMIT_PERIOD_MINUTES = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_email_card_drop_rate_limit_period_minutes-m71GVI"
        HUB_EMAIL_HASH_SALT                           = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_email_hash_salt-6j6HZV"
        HUB_GOOGLE_IAP_SERVICE_ACCOUNT                = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_google_iap_service_account-sePWyQ"
        HUB_STORAGE_CLOUDFRONT_DISTRIBUTION           = "arn:aws:secretsmanager:us-east-1:120317779495:secret:hub_storage_cloudfront_distribution-UQfA6A"
        DISCORD_ON_CALL_INTERNAL_WEBHOOK              = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_discord_on_call_internal_webhook-n7SCZC"
        PAGERDUTY_TOKEN                               = "arn:aws:secretsmanager:us-east-1:120317779495:secret:PAGERDUTY_TOKEN-1L68JJ"
        MAILCHIMP_API_KEY                             = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_MAILCHIMP_API_KEY-XCGDUW"
        CRYPTOCOMPARE_API_KEY                         = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_CRYPTOCOMPARE_API_KEY-c9yTJ9"
      }
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "hub"]
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/wait-service-stable.mjs", "hub"]
    }
  }

  url {
    auto_hostname = false
  }
}

app "hub-worker" {
  path = "./packages/hub"

  build {
    use "docker" {
      dockerfile = "Dockerfile"

      build_args = {
        hub_command = "worker"
      }
    }

    registry {
      use "aws-ecr" {
        region     = "us-east-1"
        repository = "hub-worker-prod"
        tag        = "latest"
      }
    }
  }

  deploy {
    use "aws-ecs" {
      region              = "us-east-1"
      memory              = "512"
      cluster             = "hub-worker-prod"
      count               = 2
      subnets             = ["subnet-0c22641bd41cbdd1e", "subnet-01d36d7bcd0334fc0"]
      task_role_name      = "hub-worker-ecs-task"
      execution_role_name = "hub-worker-ecs-task-execution"
      security_group_ids  = ["sg-03ae615bbcfa87393"]
      disable_alb         = true

      secrets = {
        LAYER1_RPC_NODE_HTTPS_URL           = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_https_url-p9kYAu"
        LAYER1_RPC_NODE_WSS_URL             = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_wss_url-cTukZK"
        LAYER2_RPC_NODE_HTTPS_URL           = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_url-K67DON"
        LAYER2_RPC_NODE_WSS_URL             = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_wss_url-BXGFlG"
        GNOSIS_RPC_NODE_HTTPS_URL           = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_https_url-G4nICS"
        GNOSIS_RPC_NODE_WSS_URL             = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_wss_url-PWACaa"
        ETHEREUM_RPC_NODE_HTTPS_URL         = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_https_url-9fE3dF"
        ETHEREUM_RPC_NODE_WSS_URL           = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_wss_url-rH3BDy"
        POLYGON_RPC_NODE_HTTPS_URL          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_https_url-DlBN06"
        POLYGON_RPC_NODE_WSS_URL            = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_wss_url-ErLq0E"
        HUB_AUTH_SECRET                     = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_auth_secret-amva1E"
        HUB_STORAGE_CLOUDFRONT_DISTRIBUTION = "arn:aws:secretsmanager:us-east-1:120317779495:secret:hub_storage_cloudfront_distribution-UQfA6A"
        DISCORD_ON_CALL_INTERNAL_WEBHOOK    = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_discord_on_call_internal_webhook-n7SCZC"
        PAGERDUTY_TOKEN                     = "arn:aws:secretsmanager:us-east-1:120317779495:secret:PAGERDUTY_TOKEN-1L68JJ"
        MAILCHIMP_API_KEY                   = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_MAILCHIMP_API_KEY-XCGDUW"
      }
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "hub-worker"]
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/wait-service-stable.mjs", "hub-worker"]
    }
  }

  url {
    auto_hostname = false
  }
          memory = "512"
          cluster = "hub-event-listener-prod"
          count = 1
          subnets = ["subnet-09af2ce7fb316890b", "subnet-08c7d485ed397ca69"]
          task_role_name = "hub-prod-hub_ecr_task"
          disable_alb = true
      }
      dockerfile = "Dockerfile"

      build_args = {
        hub_command = "bot"
      }
    }

    registry {
      use "aws-ecr" {
        region     = "us-east-1"
        repository = "hub-bot-prod"
        tag        = "latest"
      }
    }
  }

  deploy {
    use "aws-ecs" {
      region              = "us-east-1"
      memory              = "512"
      cluster             = "hub-bot-prod"
      count               = 1
      subnets             = ["subnet-0c22641bd41cbdd1e", "subnet-01d36d7bcd0334fc0"]
      task_role_name      = "hub-bot-ecs-task"
      execution_role_name = "hub-bot-ecs-task-execution"
      security_group_ids  = ["sg-003ba9cd5594cbcc2"]
      disable_alb         = true

      secrets = {
        LAYER1_RPC_NODE_HTTPS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_https_url-p9kYAu"
        LAYER1_RPC_NODE_WSS_URL          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_wss_url-cTukZK"
        LAYER2_RPC_NODE_HTTPS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_url-K67DON"
        LAYER2_RPC_NODE_WSS_URL          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_wss_url-BXGFlG"
        GNOSIS_RPC_NODE_HTTPS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_https_url-G4nICS"
        GNOSIS_RPC_NODE_WSS_URL          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_wss_url-PWACaa"
        ETHEREUM_RPC_NODE_HTTPS_URL      = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_https_url-9fE3dF"
        ETHEREUM_RPC_NODE_WSS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_wss_url-rH3BDy"
        POLYGON_RPC_NODE_HTTPS_URL       = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_https_url-DlBN06"
        POLYGON_RPC_NODE_WSS_URL         = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_wss_url-ErLq0E"
        HUB_AUTH_SECRET                  = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_auth_secret-amva1E"
        DISCORD_ON_CALL_INTERNAL_WEBHOOK = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_discord_on_call_internal_webhook-n7SCZC"
        PAGERDUTY_TOKEN                  = "arn:aws:secretsmanager:us-east-1:120317779495:secret:PAGERDUTY_TOKEN-1L68JJ"
      }
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "hub-bot"]
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/wait-service-stable.mjs", "hub-bot"]
    }
  }

  url {
    auto_hostname = false
  }
}

app "hub-event-listener" {
  path = "./packages/hub"

  build {
    use "docker" {
      dockerfile = "Dockerfile"

      build_args = {
        hub_command = "event-listener"
      }
    }

    registry {
      use "aws-ecr" {
        region     = "us-east-1"
        repository = "hub-event-listener-prod"
        tag        = "latest"
      }
    }
  }

  deploy {
    use "aws-ecs" {
      region              = "us-east-1"
      memory              = "512"
      cluster             = "hub-event-listener-prod"
      count               = 1
      subnets             = ["subnet-0c22641bd41cbdd1e", "subnet-01d36d7bcd0334fc0"]
      task_role_name      = "hub-event-listener-ecs-task"
      execution_role_name = "hub-event-listener-ecs-task-execution"
      security_group_ids  = ["sg-09b022c7166e01262"]
      disable_alb         = true

      secrets = {
        LAYER1_RPC_NODE_HTTPS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_https_url-p9kYAu"
        LAYER1_RPC_NODE_WSS_URL          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_wss_url-cTukZK"
        LAYER2_RPC_NODE_HTTPS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_url-K67DON"
        LAYER2_RPC_NODE_WSS_URL          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_wss_url-BXGFlG"
        GNOSIS_RPC_NODE_HTTPS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_https_url-G4nICS"
        GNOSIS_RPC_NODE_WSS_URL          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_wss_url-PWACaa"
        ETHEREUM_RPC_NODE_HTTPS_URL      = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_https_url-9fE3dF"
        ETHEREUM_RPC_NODE_WSS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_wss_url-rH3BDy"
        POLYGON_RPC_NODE_HTTPS_URL       = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_https_url-DlBN06"
        POLYGON_RPC_NODE_WSS_URL         = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_wss_url-ErLq0E"
        HUB_AUTH_SECRET                  = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_auth_secret-amva1E"
        DISCORD_ON_CALL_INTERNAL_WEBHOOK = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_discord_on_call_internal_webhook-n7SCZC"
        PAGERDUTY_TOKEN                  = "arn:aws:secretsmanager:us-east-1:120317779495:secret:PAGERDUTY_TOKEN-1L68JJ"
      }
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "hub-event-listener"]
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/wait-service-stable.mjs", "hub-event-listener"]
    }
  }

  url {
    auto_hostname = false
  }
}

# This name has been chosen to be much shorter than 32 characters
# If the name comes close to 32 characters there are unreliable
# deployments. See
#  https://github.com/hashicorp/waypoint/issues/2957
# for more details
app "cardpay-subg-ext" {
  path = "./packages/cardpay-subgraph-extraction"

  config {
    env = {
      ENVIRONMENT = "production"
    }
  }

  build {
    use "docker" {
      dockerfile = "Dockerfile"
    }

    registry {
      use "aws-ecr" {
        region     = "us-east-1"
        repository = "cardpay-production-subgraph-extraction"
        tag        = "latest"
      }
    }
  }

  deploy {
    use "aws-ecs" {
      region              = "us-east-1"
      memory              = "512"
      cluster             = "cardpay-production-subgraph-extraction"
      count               = 1
      subnets             = ["subnet-0544d680b5f494842", "subnet-051e48e37cf15329c"]
      task_role_name      = "cardpay-subg-ext-ecs-task"
      execution_role_name = "cardpay-subg-ext-ecs-task-execution"
      security_group_ids  = ["sg-08a9f0f453e7e7a43"]

      secrets = {
        SE_DATABASE_STRING = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_subg_extract_database_url-5HyPh7"
        SE_OUTPUT_LOCATION = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_subg_extract_output_location-YDoQUt"
      }

      disable_alb = true
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "cardpay-subg-ext"]
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/wait-service-stable.mjs", "cardpay-subg-ext"]
    }
  }

  url {
    auto_hostname = false
  }
}

app "ssr-web" {
  path = "./packages/ssr-web/deployment"

  build {
    use "docker" {
      dockerfile = "Dockerfile"
    }

    registry {
      use "aws-ecr" {
        region     = "us-east-1"
        repository = "ssr-web-prod"
        tag        = "latest"
      }
    }
  }

  deploy {
    use "aws-ecs" {
      service_port        = 4000
      region              = "us-east-1"
      memory              = "512"
      cluster             = "ssr-web-prod"
      count               = 2
      subnets             = ["subnet-0c22641bd41cbdd1e", "subnet-01d36d7bcd0334fc0"]
      security_group_ids  = ["sg-0c8b6a2abf52d009a"]
      task_role_name      = "ssr-web-ecs-task"
      execution_role_name = "ssr-web-ecs-task-execution"

      alb {
        subnets     = ["subnet-0c22641bd41cbdd1e", "subnet-01d36d7bcd0334fc0"]
        certificate = "arn:aws:acm:us-east-1:120317779495:certificate/e1d6a1c7-456e-4058-b90b-9c603a65734d"
      }
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "ssr-web"]
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/wait-service-stable.mjs", "ssr-web"]
    }
  }

  url {
    auto_hostname = false
  }
}

app "reward-submit-lambda" {
  path = "./packages/reward-root-submitter"


  build {
    use "docker" {
      dockerfile = "Dockerfile"
    }

    registry {
      use "aws-ecr" {
        region     = "us-east-1"
        repository = "reward-root-submitter-lambda"
        tag        = "latest"
      }
    }
  }

  deploy {
  use "aws-lambda" {
    region = "us-east-1"
  }
}

  url {
    auto_hostname = false
  }
}


app "reward-api" {
  path = "./packages/cardpay-reward-api"

  config {
    env = {
      ENVIRONMENT    = "production"
      REWARDS_BUCKET = "s3://cardpay-production-reward-programs"
      SUBGRAPH_URL   = "https://graph.cardstack.com/subgraphs/name/habdelra/cardpay-xdai"
    }
  }

  build {
    use "docker" {
      dockerfile = "Dockerfile"
    }

    registry {
      use "aws-ecr" {
        region     = "us-east-1"
        repository = "reward-api"
        tag        = "latest"
      }
    }
  }

  deploy {
    use "aws-ecs" {
      service_port        = 8000
      region              = "us-east-1"
      memory              = "512"
      cluster             = "reward-api"
      count               = 2
      subnets             = ["subnet-0d71c50519109f369", "subnet-03eac43ed0e35227e"]
      task_role_name      = "reward-api-ecs-task"
      execution_role_name = "reward-api-ecs-task-execution"
      security_group_ids  = ["sg-0539922b04d6141a3"]

      alb {
        subnets     = ["subnet-0d71c50519109f369", "subnet-03eac43ed0e35227e"]
        certificate = "arn:aws:acm:us-east-1:120317779495:certificate/e8ea5aa9-f28e-40ea-88a6-05ff8f47fa5e"
      }

      secrets = {
        DB_STRING         = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_reward_api_database_url-EIMQl7"
        SENTRY_DSN        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_reward_api_sentry_dsn-Pwim3k"
        EVM_FULL_NODE_URL = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_url-K67DON"
      }
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "reward-api"]
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/wait-service-stable.mjs", "reward-api"]
    }
  }

  url {
    auto_hostname = false
  }
}

app "reward-indexer" {
  path = "./packages/cardpay-reward-indexer"

  config {
    env = {
      ENVIRONMENT    = "production"
      REWARDS_BUCKET = "s3://cardpay-production-reward-programs"
      SUBGRAPH_URL   = "https://graph.cardstack.com/subgraphs/name/habdelra/cardpay-xdai"
    }
  }

  build {
    use "docker" {
      dockerfile = "Dockerfile"
    }

    registry {
      use "aws-ecr" {
        region     = "us-east-1"
        repository = "reward-indexer"
        tag        = "latest"
      }
    }
  }

  deploy {
    use "aws-ecs" {
      region              = "us-east-1"
      memory              = "512"
      cluster             = "reward-indexer"
      count               = 1
      subnets             = ["subnet-0d71c50519109f369", "subnet-03eac43ed0e35227e"]
      task_role_name      = "reward-indexer-ecs-task"
      execution_role_name = "reward-indexer-ecs-task-execution"
      security_group_ids  = ["sg-05c9c059e019205ca"]
      disable_alb         = true

      secrets = {
        DB_STRING  = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_reward_api_database_url-EIMQl7"
        SENTRY_DSN = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_reward_api_sentry_dsn-Pwim3k"
      }
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "reward-indexer"]
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/wait-service-stable.mjs", "reward-indexer"]
    }
  }

  url {
    auto_hostname = false
  }
}

app "reward-indexer-blue" {
  path = "./packages/cardpay-reward-indexer"

  config {
    env = {
      ENVIRONMENT    = "production"
      REWARDS_BUCKET = "s3://cardpay-production-reward-programs"
      SUBGRAPH_URL   = "https://graph.cardstack.com/subgraphs/name/habdelra/cardpay-xdai"
    }
  }

  build {
    use "docker" {
      dockerfile = "Dockerfile"
    }

    registry {
      use "aws-ecr" {
        region     = "us-east-1"
        repository = "reward-indexer"
        tag        = "latest"
      }
    }
  }

  deploy {
    use "aws-ecs" {
      region              = "us-east-1"
      memory              = "512"
      cluster             = "reward-indexer-blue"
      count               = 1
      subnets             = ["subnet-0d71c50519109f369", "subnet-03eac43ed0e35227e"]
      task_role_name      = "reward-indexer-blue-ecs-task"
      execution_role_name = "reward-indexer-blue-ecs-task-execution"
      security_group_ids  = ["sg-05c9c059e019205ca"]
      disable_alb         = true

      secrets = {
        DB_STRING  = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_reward_api_database_url_blue-gtyUuy"
        SENTRY_DSN = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_reward_api_sentry_dsn-Pwim3k"
      }
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "reward-indexer-blue"]
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/wait-service-stable.mjs", "reward-indexer-blue"]
    }
  }

  url {
    auto_hostname = false
  }
}

app "reward-scheduler" {
  path = "./packages/cardpay-reward-scheduler"

  config {
    env = {
      ENVIRONMENT                        = "production"
      REWARDS_BUCKET                     = "s3://cardpay-production-reward-programs"
      SUBGRAPH_URL                       = "https://graph.cardstack.com/subgraphs/name/habdelra/cardpay-xdai"
      REWARD_SCHEDULER_APPROVED_PROGRAMS = "0x979C9F171fb6e9BC501Aa7eEd71ca8dC27cF1185"
      REWARD_MANAGER_ADDRESS             = "0xDbAe2bC81bFa4e46df43a34403aAcde5FFdB2A9D"
      REWARDS_SUBGRAPH_EXTRACTION        = "s3://cardpay-production-partitioned-graph-data/data/rewards/0.0.2/"
      REWARD_SCHEDULER_UPDATE_FREQUENCY  = "600"
    }
  }

  build {
    use "docker" {
      dockerfile = "Dockerfile"
    }

    registry {
      use "aws-ecr" {
        region     = "us-east-1"
        repository = "cardpay-reward-scheduler-production"
        tag        = "latest"
      }
    }
  }

  deploy {
    use "aws-ecs" {
      region              = "us-east-1"
      memory              = "512"
      cluster             = "cardpay-reward-scheduler-production"
      count               = 1
      task_role_name      = "reward-scheduler-ecs-task"
      execution_role_name = "reward-scheduler-ecs-task-execution"
      subnets             = ["subnet-0d71c50519109f369", "subnet-03eac43ed0e35227e"]
      security_group_ids  = ["sg-0e26577768ce001a2"]
      disable_alb         = true

      secrets = {
        SENTRY_DSN        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_reward_programs_sentry_dsn-lsCwEe"
        EVM_FULL_NODE_URL = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_url-K67DON"
      }
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "reward-scheduler"]
    }

    hook {
      when    = "after"
      command = ["node", "./scripts/wait-service-stable.mjs", "reward-scheduler"]
    }
  }

  url {
    auto_hostname = false
  }
}

<MSG> Fix subnets for prod hub event listener

<DFF> @@ -150,7 +150,7 @@ app "hub-event-listener" {
           memory = "512"
           cluster = "hub-event-listener-prod"
           count = 1
-          subnets = ["subnet-09af2ce7fb316890b", "subnet-08c7d485ed397ca69"]
+          subnets = ["subnet-0c22641bd41cbdd1e", "subnet-01d36d7bcd0334fc0"]
           task_role_name = "hub-prod-hub_ecr_task"
           disable_alb = true
       }

{'commit': 'diff --git a/waypoint.prod.hcl b/waypoint.prod.hcl\nindex c01fdbaf4..cd997dc2f 100644\n--- a/waypoint.prod.hcl\n+++ b/waypoint.prod.hcl\n@@ -150,7 +150,7 @@ app "hub-event-listener" {\n           memory = "512"\n           cluster = "hub-event-listener-prod"\n           count = 1\n-          subnets = ["subnet-09af2ce7fb316890b", "subnet-08c7d485ed397ca69"]\n+          subnets = ["subnet-0c22641bd41cbdd1e", "subnet-01d36d7bcd0334fc0"]\n           task_role_name = "hub-prod-hub_ecr_task"\n           disable_alb = true\n       }\n', 'commit_subject': 'Fix subnets for prod hub event listener', 'repo_name': 'cardstack/cardstack', 'committer': {'name': 'Matic Jurglič', 'email': '36afb23dfcd8c3da57ff29c0889e8e27556cdbfd@jurglic.si', 'time_sec': '1640082622', 'tz_offset': '60', 'date': {'seconds': '1640082622'}}, 'commit_tree': '45e7d87b72c5c82835ee2bdc15f913abdf0a4b81', 'commit_message': 'Fix subnets for prod hub event listener\n', 'language_name': 'Python', 'license': 'mit', 'hunks': '@@ -150,7 +150,7 @@ app "hub-event-listener" {\n           memory = "512"\n           cluster = "hub-event-listener-prod"\n           count = 1\n-          subnets = ["subnet-09af2ce7fb316890b", "subnet-08c7d485ed397ca69"]\n+          subnets = ["subnet-0c22641bd41cbdd1e", "subnet-01d36d7bcd0334fc0"]\n           task_role_name = "hub-prod-hub_ecr_task"\n           disable_alb = true\n       }\n', 'addition_count': 1, 'deletion_count': 1, 'src_file': 'a/waypoint.prod.hcl', 'tgt_file': 'b/waypoint.prod.hcl', 'file_extension': '.hcl', 'before_file': 'project = "cardstack"\n\n# Labels can be specified for organizational purposes.\n# labels = { "foo" = "bar" }\n\napp "hub" {\n  path = "./packages/hub"\n\n  build {\n    use "docker" {\n      dockerfile = "Dockerfile"\n\n      build_args = {\n        hub_command = "server"\n      }\n    }\n\n    registry {\n      use "aws-ecr" {\n        region     = "us-east-1"\n        repository = "hub"\n        tag        = "latest"\n      }\n    }\n  }\n\n  deploy {\n    use "aws-ecs" {\n      service_port        = 3000\n      region              = "us-east-1"\n      memory              = "512"\n      cluster             = "hub-prod"\n      count               = 2\n      subnets             = ["subnet-0c22641bd41cbdd1e", "subnet-01d36d7bcd0334fc0"]\n      task_role_name      = "hub-ecs-task"\n      execution_role_name = "hub-ecs-task-execution"\n      security_group_ids  = ["sg-098518120fd2269f8"]\n\n      alb {\n        certificate = "arn:aws:acm:us-east-1:120317779495:certificate/20f287dd-ba3c-4175-8b06-5c3b1e75f6d9"\n        subnets     = ["subnet-01d36d7bcd0334fc0", "subnet-0c22641bd41cbdd1e"]\n      }\n\n      secrets = {\n        LAYER1_RPC_NODE_HTTPS_URL                     = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_https_url-p9kYAu"\n        LAYER1_RPC_NODE_WSS_URL                       = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_wss_url-cTukZK"\n        LAYER2_RPC_NODE_HTTPS_URL                     = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_url-K67DON"\n        LAYER2_RPC_NODE_WSS_URL                       = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_wss_url-BXGFlG"\n        GNOSIS_RPC_NODE_HTTPS_URL                     = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_https_url-G4nICS"\n        GNOSIS_RPC_NODE_WSS_URL                       = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_wss_url-PWACaa"\n        ETHEREUM_RPC_NODE_HTTPS_URL                   = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_https_url-9fE3dF"\n        ETHEREUM_RPC_NODE_WSS_URL                     = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_wss_url-rH3BDy"\n        POLYGON_RPC_NODE_HTTPS_URL                    = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_https_url-DlBN06"\n        POLYGON_RPC_NODE_WSS_URL                      = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_wss_url-ErLq0E"\n        HUB_AUTH_SECRET                               = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_auth_secret-amva1E"\n        HUB_EMAIL_CARD_DROP_RATE_LIMIT_COUNT          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_email_card_drop_rate_limit_count-mdtxRC"\n        HUB_EMAIL_CARD_DROP_RATE_LIMIT_PERIOD_MINUTES = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_email_card_drop_rate_limit_period_minutes-m71GVI"\n        HUB_EMAIL_HASH_SALT                           = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_email_hash_salt-6j6HZV"\n        HUB_GOOGLE_IAP_SERVICE_ACCOUNT                = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_google_iap_service_account-sePWyQ"\n        HUB_STORAGE_CLOUDFRONT_DISTRIBUTION           = "arn:aws:secretsmanager:us-east-1:120317779495:secret:hub_storage_cloudfront_distribution-UQfA6A"\n        DISCORD_ON_CALL_INTERNAL_WEBHOOK              = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_discord_on_call_internal_webhook-n7SCZC"\n        PAGERDUTY_TOKEN                               = "arn:aws:secretsmanager:us-east-1:120317779495:secret:PAGERDUTY_TOKEN-1L68JJ"\n        MAILCHIMP_API_KEY                             = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_MAILCHIMP_API_KEY-XCGDUW"\n        CRYPTOCOMPARE_API_KEY                         = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_CRYPTOCOMPARE_API_KEY-c9yTJ9"\n      }\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "hub"]\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/wait-service-stable.mjs", "hub"]\n    }\n  }\n\n  url {\n    auto_hostname = false\n  }\n}\n\napp "hub-worker" {\n  path = "./packages/hub"\n\n  build {\n    use "docker" {\n      dockerfile = "Dockerfile"\n\n      build_args = {\n        hub_command = "worker"\n      }\n    }\n\n    registry {\n      use "aws-ecr" {\n        region     = "us-east-1"\n        repository = "hub-worker-prod"\n        tag        = "latest"\n      }\n    }\n  }\n\n  deploy {\n    use "aws-ecs" {\n      region              = "us-east-1"\n      memory              = "512"\n      cluster             = "hub-worker-prod"\n      count               = 2\n      subnets             = ["subnet-0c22641bd41cbdd1e", "subnet-01d36d7bcd0334fc0"]\n      task_role_name      = "hub-worker-ecs-task"\n      execution_role_name = "hub-worker-ecs-task-execution"\n      security_group_ids  = ["sg-03ae615bbcfa87393"]\n      disable_alb         = true\n\n      secrets = {\n        LAYER1_RPC_NODE_HTTPS_URL           = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_https_url-p9kYAu"\n        LAYER1_RPC_NODE_WSS_URL             = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_wss_url-cTukZK"\n        LAYER2_RPC_NODE_HTTPS_URL           = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_url-K67DON"\n        LAYER2_RPC_NODE_WSS_URL             = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_wss_url-BXGFlG"\n        GNOSIS_RPC_NODE_HTTPS_URL           = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_https_url-G4nICS"\n        GNOSIS_RPC_NODE_WSS_URL             = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_wss_url-PWACaa"\n        ETHEREUM_RPC_NODE_HTTPS_URL         = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_https_url-9fE3dF"\n        ETHEREUM_RPC_NODE_WSS_URL           = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_wss_url-rH3BDy"\n        POLYGON_RPC_NODE_HTTPS_URL          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_https_url-DlBN06"\n        POLYGON_RPC_NODE_WSS_URL            = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_wss_url-ErLq0E"\n        HUB_AUTH_SECRET                     = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_auth_secret-amva1E"\n        HUB_STORAGE_CLOUDFRONT_DISTRIBUTION = "arn:aws:secretsmanager:us-east-1:120317779495:secret:hub_storage_cloudfront_distribution-UQfA6A"\n        DISCORD_ON_CALL_INTERNAL_WEBHOOK    = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_discord_on_call_internal_webhook-n7SCZC"\n        PAGERDUTY_TOKEN                     = "arn:aws:secretsmanager:us-east-1:120317779495:secret:PAGERDUTY_TOKEN-1L68JJ"\n        MAILCHIMP_API_KEY                   = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_MAILCHIMP_API_KEY-XCGDUW"\n      }\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "hub-worker"]\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/wait-service-stable.mjs", "hub-worker"]\n    }\n  }\n\n  url {\n    auto_hostname = false\n  }\n          memory = "512"\n          cluster = "hub-event-listener-prod"\n          count = 1\n          subnets = ["subnet-09af2ce7fb316890b", "subnet-08c7d485ed397ca69"]\n          task_role_name = "hub-prod-hub_ecr_task"\n          disable_alb = true\n      }\n      dockerfile = "Dockerfile"\n\n      build_args = {\n        hub_command = "bot"\n      }\n    }\n\n    registry {\n      use "aws-ecr" {\n        region     = "us-east-1"\n        repository = "hub-bot-prod"\n        tag        = "latest"\n      }\n    }\n  }\n\n  deploy {\n    use "aws-ecs" {\n      region              = "us-east-1"\n      memory              = "512"\n      cluster             = "hub-bot-prod"\n      count               = 1\n      subnets             = ["subnet-0c22641bd41cbdd1e", "subnet-01d36d7bcd0334fc0"]\n      task_role_name      = "hub-bot-ecs-task"\n      execution_role_name = "hub-bot-ecs-task-execution"\n      security_group_ids  = ["sg-003ba9cd5594cbcc2"]\n      disable_alb         = true\n\n      secrets = {\n        LAYER1_RPC_NODE_HTTPS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_https_url-p9kYAu"\n        LAYER1_RPC_NODE_WSS_URL          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_wss_url-cTukZK"\n        LAYER2_RPC_NODE_HTTPS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_url-K67DON"\n        LAYER2_RPC_NODE_WSS_URL          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_wss_url-BXGFlG"\n        GNOSIS_RPC_NODE_HTTPS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_https_url-G4nICS"\n        GNOSIS_RPC_NODE_WSS_URL          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_wss_url-PWACaa"\n        ETHEREUM_RPC_NODE_HTTPS_URL      = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_https_url-9fE3dF"\n        ETHEREUM_RPC_NODE_WSS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_wss_url-rH3BDy"\n        POLYGON_RPC_NODE_HTTPS_URL       = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_https_url-DlBN06"\n        POLYGON_RPC_NODE_WSS_URL         = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_wss_url-ErLq0E"\n        HUB_AUTH_SECRET                  = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_auth_secret-amva1E"\n        DISCORD_ON_CALL_INTERNAL_WEBHOOK = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_discord_on_call_internal_webhook-n7SCZC"\n        PAGERDUTY_TOKEN                  = "arn:aws:secretsmanager:us-east-1:120317779495:secret:PAGERDUTY_TOKEN-1L68JJ"\n      }\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "hub-bot"]\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/wait-service-stable.mjs", "hub-bot"]\n    }\n  }\n\n  url {\n    auto_hostname = false\n  }\n}\n\napp "hub-event-listener" {\n  path = "./packages/hub"\n\n  build {\n    use "docker" {\n      dockerfile = "Dockerfile"\n\n      build_args = {\n        hub_command = "event-listener"\n      }\n    }\n\n    registry {\n      use "aws-ecr" {\n        region     = "us-east-1"\n        repository = "hub-event-listener-prod"\n        tag        = "latest"\n      }\n    }\n  }\n\n  deploy {\n    use "aws-ecs" {\n      region              = "us-east-1"\n      memory              = "512"\n      cluster             = "hub-event-listener-prod"\n      count               = 1\n      subnets             = ["subnet-0c22641bd41cbdd1e", "subnet-01d36d7bcd0334fc0"]\n      task_role_name      = "hub-event-listener-ecs-task"\n      execution_role_name = "hub-event-listener-ecs-task-execution"\n      security_group_ids  = ["sg-09b022c7166e01262"]\n      disable_alb         = true\n\n      secrets = {\n        LAYER1_RPC_NODE_HTTPS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_https_url-p9kYAu"\n        LAYER1_RPC_NODE_WSS_URL          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_infura_wss_url-cTukZK"\n        LAYER2_RPC_NODE_HTTPS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_url-K67DON"\n        LAYER2_RPC_NODE_WSS_URL          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_wss_url-BXGFlG"\n        GNOSIS_RPC_NODE_HTTPS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_https_url-G4nICS"\n        GNOSIS_RPC_NODE_WSS_URL          = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_gnosis_wss_url-PWACaa"\n        ETHEREUM_RPC_NODE_HTTPS_URL      = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_https_url-9fE3dF"\n        ETHEREUM_RPC_NODE_WSS_URL        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_ethereum_infura_wss_url-rH3BDy"\n        POLYGON_RPC_NODE_HTTPS_URL       = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_https_url-DlBN06"\n        POLYGON_RPC_NODE_WSS_URL         = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_polygon_infura_wss_url-ErLq0E"\n        HUB_AUTH_SECRET                  = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_hub_auth_secret-amva1E"\n        DISCORD_ON_CALL_INTERNAL_WEBHOOK = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_discord_on_call_internal_webhook-n7SCZC"\n        PAGERDUTY_TOKEN                  = "arn:aws:secretsmanager:us-east-1:120317779495:secret:PAGERDUTY_TOKEN-1L68JJ"\n      }\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "hub-event-listener"]\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/wait-service-stable.mjs", "hub-event-listener"]\n    }\n  }\n\n  url {\n    auto_hostname = false\n  }\n}\n\n# This name has been chosen to be much shorter than 32 characters\n# If the name comes close to 32 characters there are unreliable\n# deployments. See\n#  https://github.com/hashicorp/waypoint/issues/2957\n# for more details\napp "cardpay-subg-ext" {\n  path = "./packages/cardpay-subgraph-extraction"\n\n  config {\n    env = {\n      ENVIRONMENT = "production"\n    }\n  }\n\n  build {\n    use "docker" {\n      dockerfile = "Dockerfile"\n    }\n\n    registry {\n      use "aws-ecr" {\n        region     = "us-east-1"\n        repository = "cardpay-production-subgraph-extraction"\n        tag        = "latest"\n      }\n    }\n  }\n\n  deploy {\n    use "aws-ecs" {\n      region              = "us-east-1"\n      memory              = "512"\n      cluster             = "cardpay-production-subgraph-extraction"\n      count               = 1\n      subnets             = ["subnet-0544d680b5f494842", "subnet-051e48e37cf15329c"]\n      task_role_name      = "cardpay-subg-ext-ecs-task"\n      execution_role_name = "cardpay-subg-ext-ecs-task-execution"\n      security_group_ids  = ["sg-08a9f0f453e7e7a43"]\n\n      secrets = {\n        SE_DATABASE_STRING = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_subg_extract_database_url-5HyPh7"\n        SE_OUTPUT_LOCATION = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_subg_extract_output_location-YDoQUt"\n      }\n\n      disable_alb = true\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "cardpay-subg-ext"]\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/wait-service-stable.mjs", "cardpay-subg-ext"]\n    }\n  }\n\n  url {\n    auto_hostname = false\n  }\n}\n\napp "ssr-web" {\n  path = "./packages/ssr-web/deployment"\n\n  build {\n    use "docker" {\n      dockerfile = "Dockerfile"\n    }\n\n    registry {\n      use "aws-ecr" {\n        region     = "us-east-1"\n        repository = "ssr-web-prod"\n        tag        = "latest"\n      }\n    }\n  }\n\n  deploy {\n    use "aws-ecs" {\n      service_port        = 4000\n      region              = "us-east-1"\n      memory              = "512"\n      cluster             = "ssr-web-prod"\n      count               = 2\n      subnets             = ["subnet-0c22641bd41cbdd1e", "subnet-01d36d7bcd0334fc0"]\n      security_group_ids  = ["sg-0c8b6a2abf52d009a"]\n      task_role_name      = "ssr-web-ecs-task"\n      execution_role_name = "ssr-web-ecs-task-execution"\n\n      alb {\n        subnets     = ["subnet-0c22641bd41cbdd1e", "subnet-01d36d7bcd0334fc0"]\n        certificate = "arn:aws:acm:us-east-1:120317779495:certificate/e1d6a1c7-456e-4058-b90b-9c603a65734d"\n      }\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "ssr-web"]\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/wait-service-stable.mjs", "ssr-web"]\n    }\n  }\n\n  url {\n    auto_hostname = false\n  }\n}\n\napp "reward-submit-lambda" {\n  path = "./packages/reward-root-submitter"\n\n\n  build {\n    use "docker" {\n      dockerfile = "Dockerfile"\n    }\n\n    registry {\n      use "aws-ecr" {\n        region     = "us-east-1"\n        repository = "reward-root-submitter-lambda"\n        tag        = "latest"\n      }\n    }\n  }\n\n  deploy {\n  use "aws-lambda" {\n    region = "us-east-1"\n  }\n}\n\n  url {\n    auto_hostname = false\n  }\n}\n\n\napp "reward-api" {\n  path = "./packages/cardpay-reward-api"\n\n  config {\n    env = {\n      ENVIRONMENT    = "production"\n      REWARDS_BUCKET = "s3://cardpay-production-reward-programs"\n      SUBGRAPH_URL   = "https://graph.cardstack.com/subgraphs/name/habdelra/cardpay-xdai"\n    }\n  }\n\n  build {\n    use "docker" {\n      dockerfile = "Dockerfile"\n    }\n\n    registry {\n      use "aws-ecr" {\n        region     = "us-east-1"\n        repository = "reward-api"\n        tag        = "latest"\n      }\n    }\n  }\n\n  deploy {\n    use "aws-ecs" {\n      service_port        = 8000\n      region              = "us-east-1"\n      memory              = "512"\n      cluster             = "reward-api"\n      count               = 2\n      subnets             = ["subnet-0d71c50519109f369", "subnet-03eac43ed0e35227e"]\n      task_role_name      = "reward-api-ecs-task"\n      execution_role_name = "reward-api-ecs-task-execution"\n      security_group_ids  = ["sg-0539922b04d6141a3"]\n\n      alb {\n        subnets     = ["subnet-0d71c50519109f369", "subnet-03eac43ed0e35227e"]\n        certificate = "arn:aws:acm:us-east-1:120317779495:certificate/e8ea5aa9-f28e-40ea-88a6-05ff8f47fa5e"\n      }\n\n      secrets = {\n        DB_STRING         = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_reward_api_database_url-EIMQl7"\n        SENTRY_DSN        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_reward_api_sentry_dsn-Pwim3k"\n        EVM_FULL_NODE_URL = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_url-K67DON"\n      }\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "reward-api"]\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/wait-service-stable.mjs", "reward-api"]\n    }\n  }\n\n  url {\n    auto_hostname = false\n  }\n}\n\napp "reward-indexer" {\n  path = "./packages/cardpay-reward-indexer"\n\n  config {\n    env = {\n      ENVIRONMENT    = "production"\n      REWARDS_BUCKET = "s3://cardpay-production-reward-programs"\n      SUBGRAPH_URL   = "https://graph.cardstack.com/subgraphs/name/habdelra/cardpay-xdai"\n    }\n  }\n\n  build {\n    use "docker" {\n      dockerfile = "Dockerfile"\n    }\n\n    registry {\n      use "aws-ecr" {\n        region     = "us-east-1"\n        repository = "reward-indexer"\n        tag        = "latest"\n      }\n    }\n  }\n\n  deploy {\n    use "aws-ecs" {\n      region              = "us-east-1"\n      memory              = "512"\n      cluster             = "reward-indexer"\n      count               = 1\n      subnets             = ["subnet-0d71c50519109f369", "subnet-03eac43ed0e35227e"]\n      task_role_name      = "reward-indexer-ecs-task"\n      execution_role_name = "reward-indexer-ecs-task-execution"\n      security_group_ids  = ["sg-05c9c059e019205ca"]\n      disable_alb         = true\n\n      secrets = {\n        DB_STRING  = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_reward_api_database_url-EIMQl7"\n        SENTRY_DSN = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_reward_api_sentry_dsn-Pwim3k"\n      }\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "reward-indexer"]\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/wait-service-stable.mjs", "reward-indexer"]\n    }\n  }\n\n  url {\n    auto_hostname = false\n  }\n}\n\napp "reward-indexer-blue" {\n  path = "./packages/cardpay-reward-indexer"\n\n  config {\n    env = {\n      ENVIRONMENT    = "production"\n      REWARDS_BUCKET = "s3://cardpay-production-reward-programs"\n      SUBGRAPH_URL   = "https://graph.cardstack.com/subgraphs/name/habdelra/cardpay-xdai"\n    }\n  }\n\n  build {\n    use "docker" {\n      dockerfile = "Dockerfile"\n    }\n\n    registry {\n      use "aws-ecr" {\n        region     = "us-east-1"\n        repository = "reward-indexer"\n        tag        = "latest"\n      }\n    }\n  }\n\n  deploy {\n    use "aws-ecs" {\n      region              = "us-east-1"\n      memory              = "512"\n      cluster             = "reward-indexer-blue"\n      count               = 1\n      subnets             = ["subnet-0d71c50519109f369", "subnet-03eac43ed0e35227e"]\n      task_role_name      = "reward-indexer-blue-ecs-task"\n      execution_role_name = "reward-indexer-blue-ecs-task-execution"\n      security_group_ids  = ["sg-05c9c059e019205ca"]\n      disable_alb         = true\n\n      secrets = {\n        DB_STRING  = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_reward_api_database_url_blue-gtyUuy"\n        SENTRY_DSN = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_reward_api_sentry_dsn-Pwim3k"\n      }\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "reward-indexer-blue"]\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/wait-service-stable.mjs", "reward-indexer-blue"]\n    }\n  }\n\n  url {\n    auto_hostname = false\n  }\n}\n\napp "reward-scheduler" {\n  path = "./packages/cardpay-reward-scheduler"\n\n  config {\n    env = {\n      ENVIRONMENT                        = "production"\n      REWARDS_BUCKET                     = "s3://cardpay-production-reward-programs"\n      SUBGRAPH_URL                       = "https://graph.cardstack.com/subgraphs/name/habdelra/cardpay-xdai"\n      REWARD_SCHEDULER_APPROVED_PROGRAMS = "0x979C9F171fb6e9BC501Aa7eEd71ca8dC27cF1185"\n      REWARD_MANAGER_ADDRESS             = "0xDbAe2bC81bFa4e46df43a34403aAcde5FFdB2A9D"\n      REWARDS_SUBGRAPH_EXTRACTION        = "s3://cardpay-production-partitioned-graph-data/data/rewards/0.0.2/"\n      REWARD_SCHEDULER_UPDATE_FREQUENCY  = "600"\n    }\n  }\n\n  build {\n    use "docker" {\n      dockerfile = "Dockerfile"\n    }\n\n    registry {\n      use "aws-ecr" {\n        region     = "us-east-1"\n        repository = "cardpay-reward-scheduler-production"\n        tag        = "latest"\n      }\n    }\n  }\n\n  deploy {\n    use "aws-ecs" {\n      region              = "us-east-1"\n      memory              = "512"\n      cluster             = "cardpay-reward-scheduler-production"\n      count               = 1\n      task_role_name      = "reward-scheduler-ecs-task"\n      execution_role_name = "reward-scheduler-ecs-task-execution"\n      subnets             = ["subnet-0d71c50519109f369", "subnet-03eac43ed0e35227e"]\n      security_group_ids  = ["sg-0e26577768ce001a2"]\n      disable_alb         = true\n\n      secrets = {\n        SENTRY_DSN        = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_reward_programs_sentry_dsn-lsCwEe"\n        EVM_FULL_NODE_URL = "arn:aws:secretsmanager:us-east-1:120317779495:secret:production_evm_full_node_url-K67DON"\n      }\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/waypoint-ecs-add-tags.mjs", "reward-scheduler"]\n    }\n\n    hook {\n      when    = "after"\n      command = ["node", "./scripts/wait-service-stable.mjs", "reward-scheduler"]\n    }\n  }\n\n  url {\n    auto_hostname = false\n  }\n}\n', 'message': 'Fix subnets for prod hub event listener\n', 'author_name': 'Matic Jurglič', 'lang': 'prod'}