Skip to content

Action to scale an ECS service to a desired target count

License

Notifications You must be signed in to change notification settings

zachelrath/github-action-ecs-scale

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Repository files navigation

github-action-ecs-scale

The purpose of this repository is to provide a GitHub Action to scale an ECS service's desired count up/down to a desired value.

What it does

  1. Uses the AWS SDK for JavaScript to update the specified ECS Service's desired count attribute to a given value.

General Usage

This Action expects that you have already configured AWS credentials in a prior step, e.g. using aws-actions/configure-aws-credentials. Please see that Action's documentation for more details.

jobs:
  ecs-scaledown:
    name: Scale down ECS Tasks
    runs-on: ubuntu-latest
    steps:
      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v2
        with:
          role-to-assume: ${{ secrets.AWS_ECS_ROLE_ARN }}
          role-session-name: ecsscale
          aws-region: ${{ vars.AWS_REGION }}
      - name: Scale Web App to zero
        uses: zachelrath/[email protected]
        with:
          service: ${{ vars.ECS_WEB_APP_SERVICE_NAME }}
          cluster: ${{ vars.ECS_CLUSTER_NAME }}
          desired-count: 0
      - name: Scale Worker task to 1
        uses: zachelrath/[email protected]
        with:
          service: ${{ vars.ECS_WORKER_SERVICE_NAME }}
          cluster: ${{ vars.ECS_CLUSTER_NAME }}
          desired-count: 1

About

Action to scale an ECS service to a desired target count

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%