Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Support the intrinsic function Fn::And #184

Open
lorengordon opened this issue Jul 18, 2018 · 7 comments
Open

Support the intrinsic function Fn::And #184

lorengordon opened this issue Jul 18, 2018 · 7 comments

Comments

@lorengordon
Copy link

Just a placeholder for adding support for the Fn::And intrinsic function. Currently causing cfn-lint to claim our templates are invalid.

@martysweet
Copy link
Owner

This should be pretty easy to implement, probably best to copy the doInstrinicOr and change the conditional statement within.

@martysweet
Copy link
Owner

Having a look, Fn::And is implemented, is there a certain issue that's occurring?

@lorengordon
Copy link
Author

Yeah...

Resource: Conditions > UseScheduledAction
Message: Condition did not resolve to a boolean value, got null
Documentation: http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation-guide&searchQuery=Conditions&x=0&y=0&this_doc_product=AWS+CloudFormation&this_doc_guide=User+Guide&doc_locale=en_us#facet_doc_product=AWS%20CloudFormation&facet_doc_guide=User%20Guide

where the condition looks like this (default value for both Refs is the empty string "")...

        "UseScheduledAction": {
            "Fn::And": [
                {
                    "Fn::Not": [
                        {
                            "Fn::Equals": [
                                {
                                    "Ref": "ScaleUpSchedule"
                                },
                                ""
                            ]
                        }
                    ]
                },
                {
                    "Fn::Not": [
                        {
                            "Fn::Equals": [
                                {
                                    "Ref": "ScaleDownSchedule"
                                },
                                ""
                            ]
                        }
                    ]
                }
            ]
        },

When I looked into the cfn-lint code and issues, it appeared the Fn::And was not implemented, hence the issue. Obviously being unfamiliar with the code I may have missed it or misunderstood.

@martysweet
Copy link
Owner

My mistake! The documentation is lying!

This should be a case of copying the doIntrinsicOr and changing the condition logic, then adding a couple of tests - hopefully will get a chance to look this weekend, but happy to review a pull request!

@Dynamo6
Copy link

Dynamo6 commented Mar 25, 2019

Any ETA on this yet? Looks like it's still an issue.

@martysweet
Copy link
Owner

This project is EOL in favour of https://github.com/aws-cloudformation/cfn-python-lint, however, if you wish to add doIntrinsicAnd with a couple of use cases I would be happy to push it in the next release.

@martysweet
Copy link
Owner

I made a start to it here a while ago https://github.com/martysweet/cfn-lint/pull/205/files, there is a lot of work around making conditions work correctly which is the major limiting factor to this - but happy for any contribution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants