Skip to content

Commit

Permalink
Merge pull request #82 from veezor/reuse-loadbalancer
Browse files Browse the repository at this point in the history
Reuse Load Balancer
  • Loading branch information
fagianijunior authored Aug 20, 2024
2 parents af2797e + c25cc98 commit 10a2f07
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Variable | Description | Examples/Values | Default
`DEPLOYMENT_CIRCUIT_BREAKER_RULE` | Enable or disable circuit breaker | `enable=true,rollback=true`
`ECS_CONTAINER_STOP_TIMEOUT` | Set stopTimeout on taskdefinition | min: 0, max: 120, default: 30
`TZ`| Set this variable to the desired task timezone | America/Sao_Paulo
`ALB_NAME_OVERRIDE`| Set this variable to temporary overriding the ALB name | test-alb
### How to enable scheduled tasks
- Create a file tasks/run_tasks.conf with the schedules on your code:
Expand Down
8 changes: 6 additions & 2 deletions provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ fi

provision_json_workload_resource_tags=$(jq --raw-input --raw-output '[ split(",") | .[] | "Key=" + split("=")[0] + ",Value=" + split("=")[1] ] | join(" ")' <<<"$WORKLOAD_RESOURCE_TAGS")
if [ "$provision_process_type" = "web" ]; then
provision_alb_name=$provision_repository_slug-$provision_branch_name
if [ ! -z "$ALB_NAME_OVERRIDE" ]; then
provision_alb_name=$ALB_NAME_OVERRIDE
else
provision_alb_name=$provision_repository_slug-$provision_branch_name
fi
provision_alb_exists=$(aws elbv2 describe-load-balancers --name ${provision_alb_name:0:32} || echo false)
if [ "$provision_alb_exists" = false ]; then
if [ -z "$ALB_SCHEME" ]; then
Expand All @@ -104,7 +108,7 @@ if [ "$provision_process_type" = "web" ]; then
fi
provision_json_workload_resource_tags=$(jq --raw-input --raw-output '[ split(",") | .[] | "Key=" + split("=")[0] + ",Value=" + split("=")[1] ] | join(" ")' <<<"$WORKLOAD_RESOURCE_TAGS")
provision_tg_name=$provision_repository_slug-$provision_branch_name
provision_tg_exists=$(aws elbv2 describe-target-groups --name ${provision_alb_name:0:32} || echo false)
provision_tg_exists=$(aws elbv2 describe-target-groups --name ${provision_tg_name:0:32} || echo false)
if [ "$provision_tg_exists" = false ]; then
if [ -z "$PORT" ]; then
# TODO: remember to load it from SM
Expand Down

0 comments on commit 10a2f07

Please sign in to comment.