AWS::Serverless::Function ignores resource-based metadata
See original GitHub issue*cfn-lint version: 0.25.0
Hi, I have the following cfn template (just a sample, I can’t provide my organization’s template) named sample-template.yaml
:
# Metadata: # nodeJS8.10 EOL warning
# cfn-lint:
# config:
# ignore_checks:
# - W2531
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Resources:
Lambda:
Metadata: # nodeJS8.10 EOL warning
cfn-lint:
config:
ignore_checks:
- W2531
Type: 'AWS::Serverless::Function'
Properties:
Handler: "index.handler"
Runtime: "nodejs8.10"
When I run cfn-lint sample-template.yaml
, I receive the following warning:
~/Documents/workspace/temp|
⇒ cfn-lint sample-template.yaml
W2531 EOL runtime (nodejs8.10) specified. Runtime is EOL since 2019-12-
31 and updating will be disabled at 2020-02-03, please consider to upda
te to nodejs10.x
sample-template.yaml:9:3
~/Documents/workspace/temp|
⇒
When I un-comment the root-level Metadata, then the warning is gone:
Metadata: # nodeJS8.10 EOL warning
cfn-lint:
config:
ignore_checks:
- W2531
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Resources:
Lambda:
Metadata: # nodeJS8.10 EOL warning
cfn-lint:
config:
ignore_checks:
- W2531
Type: 'AWS::Serverless::Function'
Properties:
Handler: "index.handler"
Runtime: "nodejs8.10"
~/Documents/workspace/temp|
⇒ cfn-lint sample-template.yaml
~/Documents/workspace/temp|
⇒
I have no other files in my dir:
~/Documents/workspace/temp|
⇒ tree .
.
└── sample-template.yaml
0 directories, 1 file
~/Documents/workspace/temp|
⇒
It seems as though for W2531
, cfn-lint does not process resource-based metadata, but it does process root-based metadata. I believe this is a bug.
I can provide more info on request.
Thank you!
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
AWS::Serverless::Function ignores resource-based metadata ...
It seems as though for W2531 , cfn-lint does not process resource-based metadata, but it does process root-based metadata. I believe this is...
Read more >Function - AWS Serverless Application Model
Building your application with necessary Metadata entries takes precedence over ImageUri , so if you specify both then ImageUri is ignored. Type: String....
Read more >sam build - AWS Serverless Application Model
For serverless function resources that have the Image package type, use the Metadata resource attribute to configure Docker image settings that are required ......
Read more >Conditions - AWS CloudFormation
Conditions are evaluated based on predefined pseudo parameters or input parameter ... Resources that are associated with a false condition are ignored.
Read more >sam deploy - AWS Serverless Application Model
To deploy an AWS SAM application, use the sam deploy command from the AWS SAM CLI.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, thanks for the update.
It makes sense that some metadata may be lost since we’re dealing with an
AWS::Serverless::Function
resource. And I’m also not sure how to go about including metadata since the resource is passed to aws-sam-translator. Resolving this will probably take time and careful consideration.I made a quick PR to include info in the README about this here: #1297. Let me know if you feel that’s appropriate.
Thanks for the help and clarification 😃 since there’s already an existing issue, feel free to close this one.
Looks like there’s an existing issue for it. Added a comment there.