aws-cloudformation-github-deploy icon indicating copy to clipboard operation
aws-cloudformation-github-deploy copied to clipboard

Can't assign tags to stack

Open kalhokail opened this issue 1 year ago • 2 comments

I have been trying to include tags for my CF stack template but I'm failing. No error is coming at all. I just doesn't appear at all. I followed the format in action.yml file:

tags: description: 'Key-value pairs to associate with this stack. This input should be JSON-formatted, for example [ { "Key": "string", "Value": "string" } ]' required: false

But it's not doing any affect at all. Here is my yaml file

  • name: Deploy API Gateway Setup if: github.ref == 'refs/heads/main' id: My-api-gateway uses: aws-actions/aws-cloudformation-github-deploy@v1 with: name: My-Infra-API-GW template: Infrastructure/eu-west-1/API-GW/api-gw-setup.yaml role-arn: arn:aws:iam::1234567890:role/GitHub-Role no-fail-on-empty-changeset: "1" tags: > '[ { "Key": "Product", "Value": "Infrastructure" }, { "Key": "Environment", "Value": "AWS" }, { "Key": "CreatedBy", "Value": "GitHubActions" } ]'

kalhokail avatar Dec 20 '24 08:12 kalhokail

I have the same issue. I have also tried with the same format as parameter-overrides.

egut avatar Feb 27 '25 11:02 egut

FWIW, I ran into semi-similar issue in using the CDK and was able to do:

    for (const [key, value] of Object.entries(TAGS)) {
      Tags.of(this).add(key, value)
    }

to the stack resource and that resolved my issue. Not sure that's applicable here but figured I'd toss this suggestion out

Sparkdaddy avatar Mar 13 '25 18:03 Sparkdaddy