4

When I changed AWS::ApiGateway::Method properties by AWS SAM template and deployed it. but I noticed that change was not reflected until I deploy API manually from AWS management console. I think it is because I didn't change the resource of AWS::ApiGateway::Deployment and AWS::ApiGateway::Stage on the template.(The deployment history of AWS::ApiGateway::Stage was not updated.)

How can I reflect the change when I trigger sam deploy?

1
  • Related to: stackoverflow.com/questions/41423439/… As suggested in one of the answers there, a possible workaround is to (manually or automatically) run aws apigateway create-deployment after sam deploy. Commented Jun 23, 2023 at 12:03

2 Answers 2

4

If you are still looking for a solution for this, SAM has recently(March 2023) introduced a property under AWS::Serverless::Api called AlwaysDeploy which forces API to be deployed even when there is no changes to API whenever there is sam deploy.

Reference:

  1. AWS::Serverless::Api Documentation
  2. PR to SAM on Github

Note that this will only work if you have your sam cli up to date (>v1.78.0) in your local machine or CI/CD where you will be running sam build.

Sign up to request clarification or add additional context in comments.

Comments

1

No, you have to manually deploy the api from the console :) it's a limitation at the moment.

6 Comments

Thank you for your quick response and noted.
I have not tried this approach, looks like if you change the logical name of the deployment resource, it will trigger the deployment it seems, have a crack at it if you want, medium.com/@ngchiwang/…
Thanks. I understand the approach to always recreate the stage resource by putting timestamp. wow. I'll try it.
but I noticed I always need to put timestamp when I modify the setting related to API gateway. have to remember to change...
Ya it's not the best solution
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.