简体   繁体   English

有没有办法重命名 cloudformation 堆栈名称?

[英]Is there a way to rename a cloudformation stack name?

I have a cloudformation stack (which is generated from stack_master), Resources are already created but I would like to put it into serverless framework.我有一个 cloudformation 堆栈(从 stack_master 生成),资源已经创建,但我想将它放入无服务器框架中。 I have already added the resources section but It creates new stack.我已经添加了资源部分,但它创建了新堆栈。 I want the stack to update existing stack and any updates to take from there.我希望堆栈更新现有堆栈以及从那里获取的任何更新。 Thanks谢谢

Its not possible to rename a stack.无法重命名堆栈。 You have to delete it, and create new one with the name you want.你必须删除它,然后用你想要的名字创建一个新的。

For most resources, changing the logical name of a resource is equivalent to deleting that resource and replacing it with a new one.对于大多数资源,更改资源的逻辑名称等同于删除该资源并用新资源替换它。 Any other resources that depend on the renamed resource also need to be updated and might cause to be replaced.依赖重命名资源的任何其他资源也需要更新并可能导致被替换。 Other resources require you to update a property (not just the logical name) in order to initiate an update.其他资源需要您更新属性(不仅仅是逻辑名称)才能启动更新。

So Logically you have to delete the stack and create a new one as you want.所以从逻辑上讲,您必须删除堆栈并根据需要创建一个新堆栈。

You can check out this link: AWS Official Doc您可以查看此链接: AWS 官方文档

No longer the case as of 2022 - it looks as though you can retain stack resources whilst deleting the stack containing then, and import those resources into a new stack tldr;从 2022 年开始不再是这种情况——看起来您可以在删除包含 then 的堆栈的同时保留堆栈资源,并将这些资源导入到新的堆栈 tldr 中; I have not done this, just reading the docs https://aws.amazon.com/blogs/infrastructure-and-automation/keep-your-aws-resources-when-you-rename-an-aws-cloudformation-stack/我没有这样做,只是阅读文档https://aws.amazon.com/blogs/infrastructure-and-automation/keep-your-aws-resources-when-you-rename-an-aws-cloudformation-stack/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM