-
Notifications
You must be signed in to change notification settings - Fork 597
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
Issue with 'Key' Being a Required Property in cfn-lint v1.9.3 #3562
Comments
I think the problem is An even simpler reproducer: AWSTemplateFormatVersion: '2010-09-09'
Resources:
SecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Security Group
VpcId: 'vpc-12345678901234567'
Tags:
- !Ref 'AWS::NoValue' |
@nosnilmot, thanks. Yes, that is true. It looks like the problem is with |
Correct it has to do with how we process For instance in the scenario below we want to have the error
But for in a list of objects we want the list item removed as the following template should provide 0 errors (at least for the tags).
In both scenarios there is a required keyword but in the list side of the world we need to recognize it is not an item in the list at all. As a result of this I'm going to send the |
Additionally this change will handle all these scenarios appropriately ---
AWSTemplateFormatVersion: 2010-09-09
Parameters:
Property1:
Type: 'String'
Default: 'no'
Conditions:
Condition1: !Equals [!Ref 'Property1', 'yes']
Resources:
Resource1:
Type: 'AWS::IAM::Role'
Properties:
AssumeRolePolicyDocument: {}
Tags:
- !If
- Condition1
- Key: 'Key1'
Value: 'Value1'
- !Ref 'AWS::NoValue'
- Key: 'Key2'
Value: 'Value2'
- !Ref 'AWS::NoValue'
Resource2:
Type: 'AWS::IAM::Role'
Properties: !Ref AWS::NoValue
Resource3:
Type: 'AWS::IAM::Role'
Properties:
AssumeRolePolicyDocument: {}
Tags:
!If
- Condition1
- - Key: 'Key1'
Value: 'Value1'
- !Ref 'AWS::NoValue'
|
CloudFormation Lint Version
1.9.3
What operating system are you using?
Ubuntu
Describe the bug
I have following part of the template that latest (1.9.3) cfn-lint complains about:
I'm getting following error regarding this part:
3024 'Key' is a required property
Previous version 1.9.2 version didn't complain about it.
Expected behavior
The template should work as it is, or please clarify how this should be properly implemented.
Reproduction template
The text was updated successfully, but these errors were encountered: