Skip to content

cfntag is a command-line utility and GitHub Action that enables tagging of AWS resources within a CloudFormation stack, providing a flexible solution for resource management in both local and CI/CD environments.

Notifications You must be signed in to change notification settings

ygpark80/aws-cfntag

Repository files navigation

cfntag

cfntag is a command-line tool for tagging AWS resources within a given CloudFormation Stack. Currently, it supports a limited number of AWS services. You can find the list of supported services in the src/aws folder. The current codebase serves my personal needs; if you need more resources to be implemented, please mention it in the Issues section.

Usage

To use cfntag, you need to pass the stack name and tags as command-line arguments. You can run cfntag either by installing it globally or using npx:

# Run with global installation
npm install -g aws-cfntag
cfntag --stack-name my-stack --tags Key1=Value1,Key2=Value2

# Or run with npx
npx -p aws-cfntag cfntag --stack-name my-stack --tags Key1=Value1,Key2=Value2

In this command, replace my-stack with the name of your stack, and Key1=Value1,Key2=Value2 with your tags.

GitHub Actions

See action.yml

- uses: ygpark80/[email protected]
  with:
    # The name or unique stack ID of the stack to update.
    stack-name: ''
    # The name of the AWS profile to use. (optional)
    profile: ''
    # Specifies a list of tags that you want to add to the specified resources.
    tags: |
      {
        "Key1": "Value1",
        "Key2": "Value2"
      }
    # or
    tags: 'Key1=Value1,Key2=Value2'

About

cfntag is a command-line utility and GitHub Action that enables tagging of AWS resources within a CloudFormation stack, providing a flexible solution for resource management in both local and CI/CD environments.

Resources

Stars

Watchers

Forks

Languages