-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat: add AlwaysDeploy
to AWS::Serverless::Api
#2935
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hoffa
changed the title
feat:
feat: add Feb 24, 2023
AlwaysDeploy
APIAlwaysDeploy
to AWS::Serverless::Api
5 tasks
aahung
reviewed
Feb 28, 2023
xazhao
reviewed
Feb 28, 2023
Co-authored-by: Xia Zhao <[email protected]>
How about |
I haven't seen a similar issue reported for it. |
GavinZZ
reviewed
Feb 28, 2023
GavinZZ
reviewed
Feb 28, 2023
xazhao
approved these changes
Feb 28, 2023
GavinZZ
approved these changes
Feb 28, 2023
aahung
approved these changes
Feb 28, 2023
GavinZZ
pushed a commit
to GavinZZ/serverless-application-model
that referenced
this pull request
Mar 2, 2023
Co-authored-by: Xia Zhao <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available
#660
And the ones deduplicated into the above:
minimumCompressionSize
doesn't trigger API deployment. #1447Description of changes
Add new property
AlwaysDeploy
(disabled by default) toAWS::Serverless::Api
that always creates new deployment.Using the time instead of something deterministic (e.g. hash of template and parameters) in case something outside of SAM's visibility changes (e.g. S3 object).
Description of how you validated changes
Based on template from #2888, save as
template.yaml
:Deploy:
../serverless-application-model/bin/sam-translate.py --template-file template.yaml && sam deploy --region us-west-2 --resolve-s3 --capabilities CAPABILITY_IAM --stack-name test-always-deploy --template transformed-template.yaml
curl
endpoint:Now change the Lambda:
sed -i.bak 's/Hello, foo!/Hello, bar!/g' template.yaml
Redeploy:
../serverless-application-model/bin/sam-translate.py --template-file template.yaml && sam deploy --region us-west-2 --resolve-s3 --capabilities CAPABILITY_IAM --stack-name test-always-deploy --template transformed-template.yaml
But the endpoint still shows the old output:
Now, testing the fix, change
template.yaml
as such:And redeploy:
../serverless-application-model/bin/sam-translate.py --template-file template.yaml && sam deploy --region us-west-2 --resolve-s3 --capabilities CAPABILITY_IAM --stack-name test-always-deploy --template transformed-template.yaml
And
curl
the endpoint again (sometimes takes a few seconds to change), and we get the proper output:Checklist
Examples?
Please reach out in the comments if you want to add an example. Examples will be
added to
sam init
through aws/aws-sam-cli-app-templates.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.