Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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(assertions): output and mapping assertions do not accept logical id #16329
fix(assertions): output and mapping assertions do not accept logical id #16329
Changes from 6 commits
46ea434
0dc220f
a86aea8
8f9b74e
5969171
b3cd361
9b3d40e
36d1f10
a209bd3
c8cc425
5c670cd
9f3c090
e3f8018
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably also change
findOutputs()
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like for
findOutputs
, we should be less stringent about theoutputName
and still allow for users to search for somevalue
among all outputs like so:With that in mind, do you think we should:
a) still require an
outputName
infindOutputs
(what I read that you are suggesting in the above comment)b) make
outputName
optionalc) figure out some way to return the
outputName
so the user has the full picture.If it were up to me I think that
c)
is the best option though it would require us to make a change tomatchSection()
so we return thelogicalId
along with the rest of the output. What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like your suggestion of making
outputName
optional and returning thelogicalId
. How about we split this into two changes? In this PR, implement (b) and in a subsequent PR, implement (c) but for allfind*()
APIs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like making
outputName
optional is problematic in its own right. We getpublic findOutputs(outputName?: string, props?: string)
which doesn't really work because of the two optional parameters. The user experience for not wanting to specify anoutputName
would befindOutputs(undefined, MyProps)
. I feel like that is unacceptable, but I'm open to input.Otherwise, the three options I can think of are overloading the method (but typescript barely supports this and I have no reference that this happens anywhere in the CDK) or refactoring to a method signature of
findOutputs(options: findOptions)
. I am also sympathetic towards having all thefind
andhas
methods similar in signature, so perhaps it is time to start thinking about all of these methods taking in afindXXXOptions
orhasXXXOptions
instead.My last option is the one I like best and the one I am currently implementing. I think we should require
outputName
and clearly document that a particular token ('*'
) represents all outputs. Then, the user experience for not wanting to specify an outputName would befindOutputs('*', MyProps)
which I think makes more sense thanundefined
.