【问题标题】:Adding different parameter values in a single resource in Cloudformation- YAML在 Cloudformation-YAML 中的单个资源中添加不同的参数值
【发布时间】:2021-11-26 10:53:14
【问题描述】:

我试图在 yaml 文件中组合两个参数值并出现错误。 一个参数的类型为逗号分隔值,另一个我正在准备使用各种参数的组合。
参数 1= 端点 1,端点 2,端点 3
param2= !Sub ${appname}.${env}.endpoint 预期输出:endpoint1,endpoint2, $param2

我需要通过这两个来在 aws 中创建一个监听器规则,并且这两个都将在用户填写所需信息时在执行期间提供。

我尝试了类似的方法:

- Field: host-header
  Values: 
    - !Ref param1
    - !Join
      - ','
      - !Sub ${appname}.${env}.endpoint

但以上失败并出现错误:

Template validation error: Template error: every Fn::Join object requires two parameters, (1) a string delimiter and (2) a list of strings to be joined or a function that returns a list of strings (such as Fn::GetAZs) to be joined.

请帮忙。

【问题讨论】:

    标签: amazon-web-services yaml amazon-cloudformation


    【解决方案1】:

    你不能这样做。第一个参数必须是文字字符串,不能是任何函数。来自docs

    对于 Fn::Join 分隔符,您不能使用任何函数。您必须指定一个字符串值。

    【讨论】:

      猜你喜欢
      • 2020-12-27
      • 1970-01-01
      • 2017-05-05
      • 2020-12-02
      • 2021-05-22
      • 2020-12-08
      • 2016-05-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多