• Stars
    star
    274
  • Rank 150,274 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 21 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Inserts a container image URI into an Amazon ECS task definition JSON file.

Amazon ECS "Render Task Definition" Action for GitHub Actions

Inserts a container image URI into an Amazon ECS task definition JSON file, creating a new task definition file.

Table of Contents

Usage

To insert the image URI amazon/amazon-ecs-sample:latest as the image for the web container in the task definition file, and then deploy the edited task definition file to ECS:

    - name: Render Amazon ECS task definition
      id: render-web-container
      uses: aws-actions/amazon-ecs-render-task-definition@v1
      with:
        task-definition: task-definition.json
        container-name: web
        image: amazon/amazon-ecs-sample:latest
        environment-variables: "LOG_LEVEL=info"

    - name: Deploy to Amazon ECS service
      uses: aws-actions/amazon-ecs-deploy-task-definition@v1
      with:
        task-definition: ${{ steps.render-web-container.outputs.task-definition }}
        service: my-service
        cluster: my-cluster

If your task definition file holds multiple containers in the containerDefinitions section which require updated image URIs, chain multiple executions of this action together using the output value from the first action for the task-definition input of the second:

    - name: Render Amazon ECS task definition for first container
      id: render-web-container
      uses: aws-actions/amazon-ecs-render-task-definition@v1
      with:
        task-definition: task-definition.json
        container-name: web
        image: amazon/amazon-ecs-sample-1:latest
        environment-variables: |
            LOG_LEVEL=info
            ENVIRONMENT=prod

    - name: Modify Amazon ECS task definition with second container
      id: render-app-container
      uses: aws-actions/amazon-ecs-render-task-definition@v1
      with:
        task-definition: ${{ steps.render-web-container.outputs.task-definition }}
        container-name: app
        image: amazon/amazon-ecs-sample-2:latest

    - name: Deploy to Amazon ECS service
      uses: aws-actions/amazon-ecs-deploy-task-definition@v1
      with:
        task-definition: ${{ steps.render-app-container.outputs.task-definition }}
        service: my-service
        cluster: my-cluster

See action.yml for the full documentation for this action's inputs and outputs.

License Summary

This code is made available under the MIT license.

Security Disclosures

If you would like to report a potential security issue in this project, please do not create a GitHub issue. Instead, please follow the instructions here or email AWS security directly.

More Repositories

1

configure-aws-credentials

Configure AWS credential environment variables for use in other GitHub Actions.
TypeScript
2,460
star
2

amazon-ecr-login

Logs into Amazon ECR with the local Docker client.
JavaScript
914
star
3

amazon-ecs-deploy-task-definition

Registers an Amazon ECS task definition and deploys it to an ECS service.
JavaScript
647
star
4

aws-codebuild-run-build

Run an AWS CodeBuild project as a step in a GitHub Actions workflow job.
JavaScript
274
star
5

aws-cloudformation-github-deploy

Deploys AWS CloudFormation Stacks
TypeScript
248
star
6

setup-sam

Action to set up AWS SAM CLI and add it to the PATH
JavaScript
151
star
7

aws-secretsmanager-get-secrets

TypeScript
144
star
8

codeguru-reviewer

84
star
9

amazon-eks-fargate

Creates an EKS on Fargate cluster
Shell
55
star
10

vulnerability-scan-github-action-for-amazon-inspector

Scan artifacts with Amazon Inspector from GitHub Actions workflows.
Python
25
star
11

sustainability-scanner

Runs AWS Sustainability Scanner against infrastructure-as-code.
Shell
19
star
12

closed-issue-message

Github Action to set a default message to be commented on all issues when they get closed.
JavaScript
10
star
13

codeguru-security

10
star
14

stale-issue-cleanup

Clean up stale issues in your repository with GitHub Actions!
JavaScript
9
star
15

cloudformation-aws-iam-policy-validator

Policy Validator for AWS IAM Policies in CloudFormation templates
Python
9
star
16

aws-devicefarm-browser-testing

Automates Browser Testing on AWS Device Farm
JavaScript
7
star
17

terraform-aws-iam-policy-validator

Policy Validator for AWS IAM Policies in Terraform templates
Python
6
star
18

aws-devicefarm-mobile-device-testing

Run automated Mobile Device Testing on AWS Device Farm
JavaScript
5
star
19

action-cloudwatch-metrics

[Unmaintained] Github Action to publish metrics to AWS CloudWatch
TypeScript
4
star