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.

sam should only deploy a new version if code or relevant config has changed

See original GitHub issue

Description:

I have a function described in template.yaml. I have AutoPublishAlias w/ Provisioned Concurrency enabled. I deploy and stack and it creates and completes. I add a cloudwatch alarm to template.yaml. I deploy and the changeset says it’s going to deploy a version of the lambda, even though nothing changed for the code or config. I deploy and it creates the new version of the lambda and adds the alarm. I remove the alarm from template.yaml, and deploy and it yet again wants to deploy a new version of the lambda, while also removing the alarm.

Expected result:

If the code or config for the lambda doesn’t change, no new version should be deployed. Just make changes to the other resources in template.yaml as needed.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: macOS Big Sur 11.3.1
  2. sam --version:S AM CLI, version 1.23
  3. AWS region: us-west-2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aahungcommented, May 20, 2021

Maybe sam could prompt the user to move source code to a separate directory, as a best practice.

Thanks for the suggestion. We are also exploring other options like excluding certain directories and files in CodeUri, like template.yaml in your case.

I am closing this for now. Please let us know if you experience further issues.

0reactions
github-actions[bot]commented, May 20, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sam should only deploy a new version if code or relevant config has ...
CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM - sam should only deploy a new version if code...
Read more >
sam deploy - AWS Serverless Application Model
Deploys an AWS SAM application. By default when you use this command, the AWS SAM CLI assumes that your current working directory is...
Read more >
Updates to sam package and deploy in SAM CLI >= 0.33.1
A look at changes to sam package and deploy in SAM CLI 0.33.1 and other updates since parts I, II and III of...
Read more >
How to setup a Serverless application with AWS SAM and ...
AWS Serverless Application Model (SAM) is used to quickly create Serverless applications with support for;. local development that emulates AWS ...
Read more >
terraform-aws-modules/lambda/aws
Typically, Lambda Function resource updates when source code changes. If publish = true is specified a new Lambda Function version will also be ......
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