-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fn::FindInMap support Fn conditions #79
Comments
Feel free to adjust/make more generic than supporting condition functions. I can think of some possible use cases for |
@cmckni3 while this may not quite exactly what you want. you can do this the other way round
also if country is Cfn parameter, you can set DefaultValue as "default" |
@jk21 I am aware and ended up with something similar. In my case, I would have preferred to not specify a default/use |
In my use case this did not work for me Cloudformation does not validate the template if the item does not exist in map even if you intend to use the "default" value. I want to take some conditional action based on account ID if the account condition is true use the value in the map for that account if false use the default. Even through the condition is evaluated properly the CF validator wants you to have a mapping for the account.
|
@cmckni3 Thank you very much for your feedback! Since this repository is focused on resource coverage, I'm transferring this issue over to a new GitHub repository dedicated to CloudFormation template language issues. |
Thank you for your feedback! |
Currently
Fn::FindInMap
function only supportsFn::FindInMap
andRef
.2. Scope of request
e) other coverage-related issue with the resource/attribute/option
3. Expected behavior
Should be able use condition functions such as
Fn::If
. This can help specify a default key in the map. CurrentlyFn::If
is not supported so trying to use a default key in a map results in an error stating the key was not found in the mapping.4. Suggest specific test cases
5. Helpful Links to speed up research and evaluation
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-findinmap.html#w2ab1c25c28c26c13
https://stackoverflow.com/questions/35904204/default-value-on-mappings-aws-cloudformation
6. Category (required) - Will help with tagging and be easier to find by other users to +1
Use the categories as displayed in the AWS Management Console (simplified):
The text was updated successfully, but these errors were encountered: