I'm getting an error in CloudFormation using the !Join function:
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.
My Code:
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] ]
Can you help me and show me where I'm going wrong?
CodePudding user response:
Based on the comments.
The Join
statement in the question is correct. Upon further investigation, the OP found the problem in other Join
(not shown in the question), which lead to solution.