Open mrinaudo-aws opened 1 year ago
It would be excellent if this also worked on String
parameters, because it would provide for structured data as parameter values. While it would be preferable for CloudFormation to understand structured parameters natively (see e.g. https://github.com/aws-cloudformation/cfn-language-discussion/issues/46), this would be immediately helpful to group information together in a single parameter.
just FYI, this is super helpful for us at MongoDB publisher side if CFN team could adopt this GitHub issue. this would help several of our joint-customers. happy to share more details if you need! cc: @mrinaudo-aws @lantoli
Not an intrinsic function, but I built this example custom resource that returns a value from JSON data and a search argument you both specify. Feel free to try it out (you can also test it locally): https://github.com/aws-cloudformation/aws-cloudformation-templates/blob/main/CloudFormation/CustomResources/getfromjson/README.md
Community Note
Tell us about your request
What do you want us to build? An intrinsic function to retrieve a value from JSON data, given a specified key. For example, given the following example output that the
AwsCommunity::Resource::Lookup
resource type would return for a given resource type target of a lookup using!GetAtt ResourceLookup.ResourceProperties
(content has been omitted, and formatted using a two-space, newline indentation):I would like to have a new intrinsic function, e.g.,
Fn::Get
, to consume a value given its key. The value can be a string, a boolean, a list (whereas I could plug inFn::Select
for example to get a value given its index), a map, et cetera.Tell us about the problem you are trying to solve. What are you trying to do, and why is it hard?
I think that having a native way (as opposed to building/maintaining one) for the above use case or similar ones, is desirable.
Are you currently working around this issue?
Thinking of experimenting with a custom logic to fetch value(s) I'd need - for example, a custom resource/resource type.
What is the expected behavior with this new feature
I want to be able to reference an input block (in the example above, the resource properties), and a path to navigate the property tree. An initial, simplified example could just reference to the key name (as in the example below), or use a JMESPath expression to retrieve nested structures:
Additional context
-
Attachments
-