CloudFormation嵌套堆栈名称 [英] CloudFormation nested stack name

查看:59
本文介绍了CloudFormation嵌套堆栈名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在CloudFormation模板中显式设置嵌套堆栈名称,但是在

I need to set nested stack name explicitly in a CloudFormation template, but don't see such option in AWS documentation. Is there way to achieve this? I can specify stack name, when running a parent stack, but all nested stacks, got a randomly generated stack name, based on a resource name created, like:

VPC:类型:AWS :: CloudFormation :: Stack特性:TemplateURL:https://s3-eu-west-1.amazonaws.com/cf-templates-wtmg/vpc.yaml参数:EnvironmentName:!Ref AWS :: StackName

这将以 parent_stack_name-VPC-random_hash 的形式生成嵌套堆栈名称.

Which will generate nested stack name in form parent_stack_name-VPC-random_hash.

推荐答案

是.我也在寻找相同的东西,但目前无法使用.

Yes. I was looking for the same thing also but currently it's not available.

我认为您想要特定堆栈名称的原因是将其用于输出引用?

I think the reason of you wanted a specific stack name is to use it for output referral?

您能做的/我做的是:

1)对于同一父堆栈中的堆栈,您需要从嵌套堆栈中输出,然后直接从堆栈中引用,例如!GetAtt NestedStack1.Outputs.Output1

1) For those in the same parent stack, you need to output from nested stack and then refer directly from the stack like !GetAtt NestedStack1.Outputs.Output1

2)对于在父堆栈之外的那些,您将需要输出两次.一次在嵌套堆栈中,一次在父堆栈中.然后,您可以引用父堆栈的输出.

2) For those which are outside for parent stack, you will need to output twice. Once in the nested stack and once in the parent stack. Then you can refer to the parent stack output.

希望这会有所帮助.

这篇关于CloudFormation嵌套堆栈名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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