我在使用 !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/