How to Force Redeployment of AWS API Gateway using AWS CloudFormation
If you have an AWS API Gateway resource, and need it to force a redeployment using CloudFormation, then you can use the TIMESTAMP
trick.
Example AWS CloudFormation Extract
template.yaml
extract:
|
|
As we can see, on line 15 above, we use the __TIMESTAMP__
string in the APIGatewayDeployment
stage.
Example CI/CD Bash Extract
Now we simply make sure to update the template.yaml
file with our CI run, replacing the occurence of __TIMESTAMP__
with the TIMESTAMP
variable generated: