Skip to content

AWS ECS Standalone Task

Actions
Run a Standalone task on an ECS cluster, wait for it s completion and check it s CloudWatch Logs for errors
v1.1.1
Latest
Star (4)

github-action-aws-ecs-standalone-task

NPM Version

Start an ECS Standalone task, wait for it to complete and get it's logs from CloudWatch.

This package mimics the aws ecs run-task aws-cli command and awaits it's execution.

Made for personal use, but if it suites your needs you are welcome to use it.

NPM Package available for use within your code.

Requirements

You need to have an ECS Cluster as well as a task definition created for your task along with container definitions and optionally a log group where it's container writes the log events.

Usage

Github Actions

To use the GitHub Action, you'll need to add it as a step in your workflow file.

on:
  push:
    branches: main

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Run an AWS ECS Standalone Task
        uses: xplodeart/github-action-aws-ecs-standalone-task@v1
        with:
          aws_region: "us-east-2"
          # ecs:RunTask and ecs:DescribeTasks permissions to the IAM User
          # optional: logs:GetLogEvents permission for the log-group and log-stream
          aws_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws_secret: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          ecs_cluster: "MyClusterName"
          ecs_task_def: "my-standalone-task-definition"
          security_groups: "sg-*****************,sg-*****************"
          subnets: "subnet-*****************"
          #check_interval: "6000" #default 6000 to check for each 6 seconds
          #iterations: "20" #default 20 to check for completion 20 times each interval
          #optional
          #log_read_enable: false
          #log_group_name: "/ecs/my-standalone-ecs-task"
          #log_stream_prefix: "ecs/my-task-container/"

License

MIT

AWS ECS Standalone Task is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Run a Standalone task on an ECS cluster, wait for it s completion and check it s CloudWatch Logs for errors
v1.1.1
Latest

AWS ECS Standalone Task is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.