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

(assertions): add hasParameters() and findParameters() API #16720

Closed
2 tasks
kaizencc opened this issue Sep 29, 2021 · 1 comment · Fixed by #18469
Closed
2 tasks

(assertions): add hasParameters() and findParameters() API #16720

kaizencc opened this issue Sep 29, 2021 · 1 comment · Fixed by #18469
Labels
@aws-cdk/assertions Related to the @aws-cdk/assertv2 package effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Comments

@kaizencc
Copy link
Contributor

There should be a way to access the Parameters of the template natively with the assertions library.

Use Case

There are quite a few lines of code in the above example so I did not quote it all. But the idea is that if you want to assert on any parameters along with the properties, you can only use Template.fromStack(stack).templateMatches() which then requires you to provide the entire template. This is excess code if the user does not need to assert that the entire template is a 1-1 match.

Proposed Solution

APIs similar to what is available for hasMapping(), hasResource(), and hasOutput(). Should also have findParameters() as well.

Other

Workaround is:

expect(Template.fromStack(stack).toJSON().Parameters).toEqual({});
  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@kaizencc kaizencc added p2 feature-request A feature should be added or improved. effort/small Small work item – less than a day of effort @aws-cdk/assertions Related to the @aws-cdk/assertv2 package labels Sep 29, 2021
@kaizencc kaizencc assigned kaizencc and unassigned kaizencc Sep 29, 2021
@mergify mergify bot closed this as completed in #18469 Jan 18, 2022
mergify bot pushed a commit that referenced this issue Jan 18, 2022
Add the ability to match parameters in the template. Closes #16720

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Feb 21, 2022
Add the ability to match parameters in the template. Closes aws#16720

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/assertions Related to the @aws-cdk/assertv2 package effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant