-
Notifications
You must be signed in to change notification settings - Fork 4k
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
AwsCustomResource: support JMESPath queries #6375
Comments
One idea could be that to prevent breaking changes we'd introduce a new method: Maybe even https://www.npmjs.com/package/jmespath would be the library to use there… … but I've just started looking at the code that defines |
Also I was looking to use AWS SDK SSM Basically my use case here is that I have many values in region A that need to be accessed in region B. I guess I could work around it by defining multiple SSM parameters and multiple instances of |
Copy: @jogold |
@aripalo This would require adding some sort of |
Yeah, that seems to be the case. I ended up solving my use case with my own custom Lambda resource that uses Boto3 crossRegionParameters.output.getAttString("/foo/bar/1") Might open source that construct later. As far as I've looked around I ended up in the same conclusion that doing the jmespath filterin with Closing this issue for now. |
Allow filtering of
Array<map>
withAwsCustomResource
'sgetData
/getDataString
methods.Currently it seems that one can only access array items by their index (e.g.
Items.0.Title.S
), but that doesn't help when you can't trust the ordering of the array.Use Case
Many AWS SDK methods return
Array<map>
structures in the response data.One example is
describeStacks
method in CloudFormation service that returns the stack outputs asArray<map>
structure.I have a use case where I have to fetch values from stacks in different regions. I already have them available as CloudFormation stack outputs.
As a workaround I have implemented my own Lambda backed custom resource that manages this, but
AwsCustomResource
gets really close to providing that functionality which is frustrating 😅 Just to clarify that theAwsCustomResource
is super cool thing already!Proposed Solution
If using AWS APIs via AWS CLI, one can query these
Array<map>
structures with JMESPath compliant strings:--query "Stacks[0].Outputs[?OutputKey=='Foo'].OutputValue" --output text
Above example from stackoverflow.com/a/41629516.
It would be nice if
getData
/getDataString
supported similar filtering possibilities with JMESPath (or similar manner) so one could do something like this:Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: