gpt4 book ai didi

aws-cloudformation - 输出云形成列表

转载 作者:行者123 更新时间:2023-12-04 17:15:53 24 4
gpt4 key购买 nike

我有一个参数:

  ClusterSubnets:
Description: Subnets where cluster will reside.
Typically private. Use mutiples, each in a different AZ for HA.
ConstraintDescription: comma separated list of valid Subnet IDs
Type: List<AWS::EC2::Subnet::Id>

我正在尝试输出:

  ClusterSubnets:
Description: Subnets used by cluster
Value: !Ref ClusterSubnets
Export:
Name: !Sub "${AWS::StackName}-ClusterSubnets"

但我收到此错误:模板格式错误:每个输出成员的值字段必须计算为字符串。

如何导出列表?

最佳答案

您需要将列表的元素连接成一个字符串。尝试这样的事情:

ClusterSubnets:
Description: Subnets used by cluster
Value: !Join
- ','
- !Ref ClusterSubnets
Export:
Name: !Sub "${AWS::StackName}-ClusterSubnets"

这是相关的AWS documentation .

关于aws-cloudformation - 输出云形成列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47578171/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com