【问题标题】:Unable to resolve cloudformation template using !Sub无法使用 !Sub 解析 cloudformation 模板
【发布时间】:2022-04-03 09:11:45
【问题描述】:

我正在尝试将 apigateway DNS 值保留在 ssm 参数部分。我使用功能 Select it 的方式只是在 SSM 中打印。 apiEndpoint 是另一个运行良好的资源。

我需要更改值部分中的某些内容,以便我可以将 DNS 名称保留在 ssm 参数中。

  APIGWEndpointSSM:
    Type: AWS::SSM::Parameter
    Properties :
      Description : vpc endpoint for the nextgen apigateway.
      Name : /vpc/apigwvpcendpoint
      Type : String
      Value : https://!Sub(!Select [1, !Split [":", !Select [ 0, !GetAtt apiEndpoint.DnsEntries ]]])

【问题讨论】:

    标签: amazon-web-services amazon-cloudformation aws-cloudformation-custom-resource


    【解决方案1】:

    您可以使用Sub的数组形式:

    Name: !Sub
      - "https://${dns}"
      - { dns: !Select [1, !Split [":", !Select [ 0, !GetAtt apiEndpoint.DnsEntries]]] }
    

    【讨论】:

      猜你喜欢
      • 2021-03-20
      • 2018-11-27
      • 1970-01-01
      • 2022-12-17
      • 2018-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-08
      相关资源
      最近更新 更多