question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AutoPublishAlias with a !Ref value marked as false positive

See original GitHub issue

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:

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:closed
  • Created 5 years ago
  • Comments:21 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
keetoniancommented, Aug 28, 2019

@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.

1reaction
kddejongcommented, Aug 28, 2019

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found