AutoPublishAlias with a !Ref value marked as false positive
See original GitHub issuecfn-lint version: 0.11.1
I’m running into an issue with AutoPublishAlias
. When using a !Ref
as its value, I get the following error message:
E0001 Resource with id [SkillFunction] is invalid. 'AutoPublishAlias' must be a string or a Ref to a template parameter
foo.yml:1:1
Here’s the minimal template to reproduce the issue:
---
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Parameters:
Stage:
Description: Environment stage (deployment phase)
Type: String
AllowedValues:
- beta
- prod
Resources:
SkillFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: '.'
Handler: main.handler
Runtime: python3.7
Timeout: 30
MemorySize: 128
AutoPublishAlias: !Ref Stage
The error message is actually very helpful (👏 for that), but as you can see, I am using a !Ref
to a template parameter, so this should not cause a linting error.
Issue Analytics
- State:
- Created 5 years ago
- Comments:21 (11 by maintainers)
Top Results From Across the Web
AutoPublishAlias with a !Ref value marked as false positive
cfn-lint version: 0.11.1 I'm running into an issue with AutoPublishAlias. When using a !Ref as its value, I get the following error message: ......
Read more >Deploying serverless applications gradually
Step 1: Deploy your Lambda function and automatically create aliases with AutoPublishAlias . Step 2: Perform your gradual deployment with DeploymentPreference .
Read more >Serverless Applications with AWS SAM
AWS Serverless Application Models (AWS SAM) is a tool for developing, deploying, and managing your serverless applications on AWS. We'll get ...
Read more >Changelog — troposphere 4.0.1 documentation - Read the Docs
TargetType to support Ref values (#1794). Run tests against Python 3.9 (#1790). Cloudfront cache and origin policy (#1796). Fix typo AWSOject => AWSObject....
Read more >Cloudformation Dependency Issue - AutoPublishAlias in ...
2) We exchange !GetAtt for !Ref: !Ref LambdaFunction.Alias . – EpicVoyage. Jun 21 at 18:49.
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
@kddejong my apologies, I had downloaded the latest version but still had an old version on my path that was run instead. I fixed my path to use the latest version and this works.
@keetonian the template in this issue still works for me in the newest version. Can you explain more about the template you are having an issue with so I can try replicate the issue.