-
Notifications
You must be signed in to change notification settings - Fork 602
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
YAML anchors & key overrides #2993
Comments
However when I run the lint on the packaged template ( |
Going to think on this one. One of the issues we have is since we are parsing into a python |
@kddejong Any update on your thoughts here? I would expect that Anyways, interested in any updates you might have. Additionally, this does not allow me to lint my CFN templates for any other errors that may be present. |
I did some testing of some various yaml parsing tools to hopefully help generate some solutions. Here is a snippet of the input template I used to test: Replicas:
- &Replicas
Region: {Ref: 'AWS::Region'}
PointInTimeRecoverySpecification:
PointInTimeRecoveryEnabled: {Ref: PointInTimeRecoveryEnabled}
# [...]
- Fn::If:
- HasOhioReplica
- <<: *Replicas
Region: us-east-2
- Ref: 'AWS::NoValue' Processing with Replicas:
- &Replicas
Region: {Ref: 'AWS::Region'}
PointInTimeRecoverySpecification:
PointInTimeRecoveryEnabled: {Ref: PointInTimeRecoveryEnabled}
# [...]
- Fn::If:
- HasOhioReplica
- !!merge <<: *Replicas
Region: us-east-2
- Ref: 'AWS::NoValue' Processing with PyYAML ( Replicas:
- PointInTimeRecoverySpecification: &id002
PointInTimeRecoveryEnabled:
Ref: PointInTimeRecoveryEnabled
Region:
Ref: AWS::Region
# [...]
- Fn::If:
- HasOhioReplica
- GlobalSecondaryIndexes: *id001
PointInTimeRecoverySpecification: *id002
ReadProvisionedThroughputSettings: *id003
Region: us-east-2
Tags: *id004
- Ref: AWS::NoValue |
Is this feature request related to a new rule or cfn-lint capabilities?
rules
Describe the feature you'd like to request
I'm using YAML anchors like this:
Which results in
Describe the solution you'd like
It would be great if this case (duplicate keys) is a separate rule and can be turned off. Turning of
E0000
didn't work for me and I would probably not even want that.Additional context
No response
Is this something that you'd be interested in working on?
Would this feature include a breaking change?
The text was updated successfully, but these errors were encountered: