Skip to content
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

E1030 error on Fn::Length while comparing with a number using Fn::Equals #3458

Closed
sgrilux opened this issue Jul 3, 2024 · 0 comments · Fixed by #3461
Closed

E1030 error on Fn::Length while comparing with a number using Fn::Equals #3458

sgrilux opened this issue Jul 3, 2024 · 0 comments · Fixed by #3461

Comments

@sgrilux
Copy link

sgrilux commented Jul 3, 2024

CloudFormation Lint Version

1.5.0

What operating system are you using?

Mac, Linux

Describe the bug

I am trying to add a condition where it compare if a CommaDelimitedList parameters had two elements.

Conditions:  
   TwoVpcConfig: !Equals [ Fn::Length: !Ref VpcCIDRs, 2 ]

and I get the following error:

[cfn-lint] E1030: {'Fn::Length': {'Ref': 'VpcCIDRs'}} is not of type 'string'

However this errors started few days ago with an update of cfn-lint.

AWS Documentation states that Equals should accept any type of value and CommaDelimitedList is actually and array so Fn::Equals and Fn::Length should not complain.

If I ignore E1030 from cfn-lint the template deploys correctly with no issue.

Expected behavior

It should not complain

Reproduction template

AWSTemplateFormatVersion: 2010-09-09
Transform: 'AWS::LanguageExtensions'
...
Parameters:
  VpcCIDRs:
    Type: CommaDelimitedList

Conditions:  
   TwoVpcConfig: !Equals [ Fn::Length: !Ref VpcCIDRs, 2 ]
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant