amazon-web-services - AWS CloudFormation 错误 : ! 连接对象需要两个参数:(1) 字符串分隔符和 (2) 要连接的字符串列表

标签 amazon-web-services aws-cloudformation

我在使用 !Join 函数时在 CloudFormation 中遇到错误:

模板错误:每个 Fn::Join 对象都需要两个参数,(1) 字符串分隔符和 (2) 要连接的字符串列表或返回字符串列表的函数(例如 Fn: :GetAZs) 加入。

我的代码:

  RDSSubnetGroup:
    Type: AWS::RDS::DBSubnetGroup
    Condition: CreationRDS
    Properties:
       DBSubnetGroupDescription: !Ref RDSName
       SubnetIds: !Ref SubnetIds
  
  RDSAuroraServerless:
    Type: AWS::RDS::DBCluster
    Condition: CreationRDS
    Properties:
      Engine: aurora-mysql
      EngineMode: serverless
      EngineVersion: !Ref EngineVersion
      DatabaseName: !Ref RDSName
      MasterUsername: admin
      MasterUserPassword: !Ref MasterUserPassword
      DBClusterIdentifier: !Ref RDSName
      ScalingConfiguration:
        MinCapacity: 1
        MaxCapacity: 2
        SecondsUntilAutoPause: 300
      BackupRetentionPeriod: 7
      DeletionProtection: false
      VpcSecurityGroupIds:
        - !Ref SecurityGroup
      DBSubnetGroupName: !Ref RDSSubnetGroup

Outputs:
  JDBCOutput:
    Condition: CreationRDS
    Value: 
      !Join [ '', [!GetAtt RDSAuroraServerless.Endpoint.Address, /, !Ref RDSName] ]

你能帮助我并告诉我哪里出错了吗?

最佳答案

基于评论。

问题中的Join语句正确。经过进一步调查,OP 在 other Join 中发现了问题(问题中未显示),从而找到了解决方案。

关于amazon-web-services - AWS CloudFormation 错误 : ! 连接对象需要两个参数:(1) 字符串分隔符和 (2) 要连接的字符串列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69353964/

相关文章:

.net - 是否有可以使用 AWS V4 签名签署请求的 .NET 库?

java - AWS cloudwatch 用于实时监控应用程序

amazon-web-services - Amazon RedShift复制命令

amazon-web-services - 发布 .NET Core 中内置的 AWS Lambda 函数时出错

node.js - 将 Cloudformation 模板中自定义资源支持的 lambda 从 6.10 更新到 8.10,不再发送请求

ansible - CDK 是否执行编排?除了配置之外

amazon-s3 - 有什么方法可以从 amazon s3 提供私有(private)静态文件

serverless-framework - 使用 CloudFormation 创建身份池

amazon-web-services - sam.yml 文件中的多个 Lambda 函数

amazon-web-services - 云形成路线53 :GetHostedZone User is not authorized to access this resource