Nested Fn::Join doesn't work with Fn::Split #5655
Labels
@aws-cdk/core
Related to core CDK functionality
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
If Fn::Split is used with nested Fn::Joins, then an optimization attempting to flatten the joins incorrectly assumes the value of the join is an array at synth time, when it fact it's a late-binding CloudFormation list.
I'm trying to append a new security group to a list of existing security groups that are imported via a CFN value.
Reproduction Steps
Error Log
Environment
Other
The bug occurs here:
https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/core/lib/private/cloudformation-lang.ts#L158
The value that it's trying to spread into the splice is not an array, but an object that CFN will resolve into a list:
I think that if the
isSplicableFnJoinIntrinsic
function were updated to also checkArray.isArray(obj['Fn::Join'][1])
, then it would skip the optimization in this case.This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: