Closed dulac closed 6 years ago
You're right. Currently Fn::Join implementation is not the same as CloudFormation's implementation - I'm not sure what was going through my mind when I wrote that!
Instead of joining the strings together, it should use the delimiter to join all of the elements of the array.
I'll write some tests and a fix for this now.
I’ve really been enjoying using Goformation! I found a bug recently though that I’m not sure how to fix (I'm still learning Golang), but I tracked down the reason, and figured you might immediately know how to fix.
Summary: The Fn::Join is not joining values together. I've traced this down to find that it is not reading the array inside the array. I believe the "goformation/intrinsics/fnjoin.go" file needs to be updated to loop the inner array. Let me know if you’d like me to put this in Github Issues
# TROUBLESHOOTING WALKTHROUGH
Example CF snippet from the example template in the repo:
If you try to unmarshall, and output the function.Role, it gives you nothing:
Let's remove the ImportValue function:
If you try to unmarshall this again, and output the function.Role as before, it gives you just "-":
So then for fun, I removed the inner array, and this worked:
The output is:
However, this syntax is in invalid.
I'm pretty sure the "goformation/intrinsics/fnjoin.go" file needs to loop the inner array.
Thanks!