Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(GitHubOidcProvider): Ensure AWS::IAM::OIDCProvider resource is tagged #2531

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

akash1810
Copy link
Member

What does this change?

Apply the standard Stack, Stage, App and gu:repo tags to the AWS::IAM::OIDCProvider resource created by the GitHubOidcProvider construct.

This was previously absent as we're creating AWS::IAM::OIDCProvider via a level 1 construct; AWS CDK only automatically tags level 2 constructs.

How to test

See the added unit test. The test uses the hasGuTaggedResource assertion helper.

How can we measure success?

Tagging resources makes it easier to identify their origin, and to allocate costs, etc.

Have we considered potential risks?

N/A.

Checklist

  • I have listed any breaking changes, along with a migration path 1
  • I have updated the documentation as required for the described changes 2

Footnotes

  1. Consider whether this is something that will mean changes to projects that have already been migrated, or to the CDK CLI tool. If changes are required, consider adding a checklist here and/or linking to related PRs.

  2. If you are adding a new construct or pattern, has new documentation been added? If you are amending defaults or changing behaviour, are the existing docs still valid?

…tagged

Apply the standard `Stack`, `Stage`, `App` and `gu:repo` tags to the `AWS::IAM::OIDCProvider` resource.

This was previously absent as we're creating `AWS::IAM::OIDCProvider` via a level 1 construct;
AWS CDK only automatically tags level 2 constructs.
Copy link

changeset-bot bot commented Dec 5, 2024

🦋 Changeset detected

Latest commit: 60639fd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@guardian/cdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@akash1810 akash1810 requested a review from rtyley December 5, 2024 18:27
@akash1810 akash1810 enabled auto-merge December 6, 2024 10:03
Copy link
Member

@rtyley rtyley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Very nice!

@akash1810 akash1810 merged commit c07d5c7 into main Dec 6, 2024
4 checks passed
@akash1810 akash1810 deleted the aa/GitHubOidcProvider-tags branch December 6, 2024 10:21
@rtyley
Copy link
Member

rtyley commented Dec 6, 2024

Not sure if this is operator error, but when I tried to deploy the cloudformation from guardian/content-api-firehose-client@f5e2be8 (which was using GU-CDK 61.0.1), I got this error:

image

...as I was creating the cloudformation stack, I manually added these tags to it:

image

...I guess maybe I shouldn't do that? I shouldn't put my own tags on the cloudformation stack itself?

@rtyley
Copy link
Member

rtyley commented Dec 6, 2024

I shouldn't put my own tags on the cloudformation stack itself?

Ah yes, if I don't apply my own stage & stack tags to the Cloudformation stack when creating it in UI, everything works perfectly.

@akash1810
Copy link
Member Author

Confirming this works as expected in guardian/aws-account-setup (https://github.com/guardian/aws-account-setup/pull/265):

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants