cdk.FnJoin synth bug
See original GitHub issueI’m introducing an output for CloudFormation stack as follow:
new cdk.Output(this, "ApiEndpoint", {
value: new cdk.FnJoin("", ["https://","dummy.ref",".execute-api.",this.env.region,".amazonaws.com/","stage_name"]),
description: "Endpoint for this stage of the api"
})
What I expect from the command
cdk synth
is that a code like the following is created inside the CloudFormation template:
Outputs:
ApiEndpoint:
Description: 'Endpoint for this stage of the api'
Value:
'Fn::Join':
- ""
-
- 'https://'
- dummy.ref
- .execute-api.
- eu-central-1
- .amazonaws.com/
- stage_name
Export:
Name: 'PvideoSmartCF:ApiEndpoint'
Instead the generated code is like:
Outputs:
ApiEndpoint:
Description: 'Endpoint for this stage of the api'
Value:
'Fn::Join':
- ""
-
-
- 'https://'
- dummy.ref
- .execute-api.
- eu-central-1
- .amazonaws.com/
- stage_name
Export:
Name: 'PvideoSmartCF:ApiEndpoint'
Which result in an error during the deployment:
failed: ValidationError: 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. 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.
Do anyone know how to solve this problem, or if it is a a bug or I am doing something wrong?
Thank you fro the support.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
Thank you this solved the problem
FnJoin
accepts a variadic argument, so you would want to use it like so:Alternatively, you can use the sugar
FnConcat
: