如何使用 Cloudformation 强制重新部署我的 API 网关 [英] How do I force redeployment of my API Gateway using Cloudformation

查看:24
本文介绍了如何使用 Cloudformation 强制重新部署我的 API 网关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 AWS CloudFormation 创建 API 网关.我有一个 AWS::ApiGateway::Deployment 资源,它在我创建堆栈时效果很好.但是,如果我更新我的堆栈(例如,更改 AWS::ApiGateway::Method),则不会再次部署 API.我必须在 API Gateway 中手动部署 API.

I'm using AWS CloudFormation to create an API gateway. I have a AWS::ApiGateway::Deployment resource, which works great when I create my stack. However, if I update my stack (with a change in the AWS::ApiGateway::Method, for example), the API does not get deployed again. I have to manually deploy the API in API Gateway.

有谁知道如何在堆栈更新时自动部署网关?

Anyone know how I can automatically deploy the gateway when the stack is updated?

推荐答案

我在描述中添加了日期/时间戳,以便在每次更新模板时强制重新部署.这对我来说很容易,因为我使用对流层并且似乎可以解决问题.或者,您可以传入日期/时间戳作为参数.

I put a date/timestamp in my description to force a redeploy every time the templates are updated. This is pretty easy for me since I use Troposphere and seems to do the trick. Alternatively you could pass in a date/timestamp as a parameter.

这篇关于如何使用 Cloudformation 强制重新部署我的 API 网关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆