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

test: add simplified tag assertion #2280

Merged
merged 1 commit into from
Apr 23, 2024
Merged

test: add simplified tag assertion #2280

merged 1 commit into from
Apr 23, 2024

Conversation

jacobwinch
Copy link
Contributor

@jacobwinch jacobwinch commented Apr 17, 2024

This PR implements a suggestion from #2276 (comment).

I don't think AWS provides a way to do this, so I've added a helper function to combine resource property matching and array matching in order to get this working.

I think this makes the tests added in #2276 easier to follow and hopefully it will make it easier for others to check tag correctness in the future too.

Copy link

changeset-bot bot commented Apr 17, 2024

⚠️ No Changeset found

Latest commit: 44d1094

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

},
],
GuTemplate.fromStack(stack).hasResourceWithTag("AWS::RDS::DBInstance", {
Key: "devx-backup-enabled",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've manually checked that setting the wrong tag value (or mistyping the key) here causes the test to fail.

@jacobwinch jacobwinch marked this pull request as ready for review April 17, 2024 11:06
@jacobwinch jacobwinch enabled auto-merge (squash) April 23, 2024 08:28
@jacobwinch jacobwinch merged commit 11bb3bd into main Apr 23, 2024
2 checks passed
@jacobwinch jacobwinch deleted the jw-tag-helper branch April 23, 2024 08:30
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