Skip to content

Commit 2c73be8

Browse files
Merge pull request #6857 from hotosm/fix/scaling-policy
Fix/scaling policy
2 parents 868d44b + b428cf6 commit 2c73be8

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

.github/workflows/terragrunt.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
name: Get Deployment Meta
2020
runs-on: ubuntu-latest
2121
outputs:
22+
INFRA_ENV_NAME: ${{ steps.export_meta.outputs.INFRA_ENV_NAME }}
2223
INFRA_BRANCH_NAME: ${{ steps.export_meta.outputs.INFRA_BRANCH_NAME }}
2324
INFRA_BRANCH_URL: ${{ steps.export_meta.outputs.INFRA_BRANCH_URL }}
2425
PLAN_ID: ${{ steps.export_meta.outputs.PLAN_ID }}
@@ -29,18 +30,22 @@ jobs:
2930
run: |
3031
case "${{ github.ref }}" in
3132
refs/heads/develop)
33+
export INFRA_ENV_NAME=develop
3234
export INFRA_BRANCH_NAME=develop
3335
export INFRA_BRANCH_URL=https://tasks-dev.hotosm.org
3436
;;
3537
refs/heads/staging)
38+
export INFRA_ENV_NAME=staging
3639
export INFRA_BRANCH_NAME=staging
3740
export INFRA_BRANCH_URL=https://tasks-stage.hotosm.org
3841
;;
3942
refs/heads/main)
40-
export INFRA_BRANCH_NAME=main
43+
export INFRA_ENV_NAME=main
44+
export INFRA_BRANCH_NAME=production
4145
export INFRA_BRANCH_URL=https://tasks.hotosm.org
4246
;;
4347
esac
48+
echo "INFRA_ENV_NAME=${INFRA_ENV_NAME}" >> $GITHUB_OUTPUT
4449
echo "INFRA_BRANCH_NAME=${INFRA_BRANCH_NAME}" >> $GITHUB_OUTPUT
4550
echo "INFRA_BRANCH_URL=${INFRA_BRANCH_URL}" >> $GITHUB_OUTPUT
4651
@@ -58,7 +63,7 @@ jobs:
5863
terragrunt_version: "0.67.15"
5964
aws_region: us-east-1
6065
load_env: true
61-
environment_name: ${{ needs.get_deployment_meta.outputs.INFRA_BRANCH_NAME }}
66+
environment_name: ${{ needs.get_deployment_meta.outputs.INFRA_ENV_NAME }}
6267
environment_url: ${{ needs.get_deployment_meta.outputs.INFRA_BRANCH_URL }}
6368
encrypt_plan_file: true
6469
secrets: inherit
@@ -71,7 +76,7 @@ jobs:
7176
- get_deployment_meta
7277
if: ${{ success() }}
7378
environment:
74-
name: ${{ needs.get_deployment_meta.outputs.INFRA_BRANCH_NAME }}-approval
79+
name: ${{ needs.get_deployment_meta.outputs.INFRA_ENV_NAME }}-approval
7580
url: ${{ needs.get_deployment_meta.outputs.INFRA_BRANCH_URL }}
7681
steps:
7782
- name: Manual approval step
@@ -94,7 +99,7 @@ jobs:
9499
load_env: true
95100
plan_file_name: ${{ github.event.repository.name }}-${{ github.run_id }}-${{github.run_attempt}}
96101
use_gh_artifacts: true
97-
environment_name: ${{ needs.get_deployment_meta.outputs.INFRA_BRANCH_NAME }}
102+
environment_name: ${{ needs.get_deployment_meta.outputs.INFRA_ENV_NAME }}
98103
environment_url: ${{ needs.get_deployment_meta.outputs.INFRA_BRANCH_URL }}
99104
decrypt_plan_file: true
100105
secrets: inherit

scripts/aws/infra/production/purgeable/ecs/terragrunt.hcl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,13 @@ inputs = {
156156
scale_up_cooldown = 60
157157
scale_down_cooldown = 180
158158
scale_up_steps = [
159-
{ lower_bound = 0, upper_bound = 100, adjustment = 1 },
160-
{ lower_bound = 100, upper_bound = 300, adjustment = 2 },
161-
{ lower_bound = 300, upper_bound = null, adjustment = 3 }
159+
{ lower_bound = 0, upper_bound = 300, adjustment = 1 },
160+
{ lower_bound = 300, upper_bound = 900, adjustment = 2 },
161+
{ lower_bound = 900, upper_bound = null, adjustment = 3 }
162162
]
163163
scale_down_steps = [
164-
{ lower_bound = null, upper_bound = -20, adjustment = -2 },
165-
{ lower_bound = -20, upper_bound = 0, adjustment = -1 }
164+
{ lower_bound = null, upper_bound = -200, adjustment = -2 },
165+
{ lower_bound = -200, upper_bound = -100, adjustment = -1 }
166166
]
167167
}
168168
}

0 commit comments

Comments
 (0)