Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automate API Gateway deployment via SAM deploy?

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?

like image 507
d.y Avatar asked Oct 12 '25 02:10

d.y


2 Answers

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.

like image 112
Vishwasa Navada K Avatar answered Oct 15 '25 09:10

Vishwasa Navada K


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

like image 44
Arun Kamalanathan Avatar answered Oct 15 '25 08:10

Arun Kamalanathan