简体   繁体   English

无法使用 !Sub 解析 cloudformation 模板

[英]Unable to resolve cloudformation template using !Sub

I am trying to keep apigateway DNS values in ssm parameter section.我试图在 ssm 参数部分保留 apigateway DNS 值。 The way I used the function Select it is just printing in SSM.我使用 function Select 的方式只是在 SSM 中打印。 apiEndpoint is another resources which is working fine. apiEndpoint 是另一个工作正常的资源。

I need to change something in Value section so that I can keep the DNS name in ssm parameter.我需要更改值部分中的某些内容,以便我可以在 ssm 参数中保留 DNS 名称。

  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 ]]])

You can use array form of Sub :您可以使用Sub的数组形式:

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

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

相关问题 CloudFormation - 使用 - >- 表达式和 !Sub - CloudFormation - Using - >- expression with !Sub 使用 CloudFormation 模板运行爬虫 - Run a crawler using CloudFormation template 在 CloudFormation 模板中使用现有角色 - Using Existing Role in CloudFormation Template 无法在 Cloudformation 模板中为 Cloudwatch 警报定义数学表达式 - Unable to define Math Expression for Cloudwatch Alarm in a Cloudformation Template Cloudformation 堆栈模板状态为 ROLLBACK_COMPLETE,无法更新 - Cloudformation stack template status is ROLLBACK_COMPLETE and unable to update cloudformation 模板中的条件标记 - Conditional tagging in cloudformation template CloudFormation 模板错误 Fn::Sub intrinsic functions do not specify expected arguments - CloudFormation template error Fn::Sub intrinsic functions don't specify expected arguments 如何获取 cloudformation 模板中的参数以使用 Amazon Go SDK 启动? - How to get parameters in cloudformation template to launch using Amazon Go SDK? CloudFormation 模板 - 将现有 IAM 角色用于 Lambda 函数 - CloudFormation template - Using existing IAM role in for Lambda functions 如何为使用 CloudFormation 模板创建的 AWS Lambda function 添加触发器? - How to add triggers for a AWS Lambda function created using a CloudFormation template?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM