awslabs / goformation

GoFormation is a Go library for working with CloudFormation templates.
Apache License 2.0
841 stars 197 forks source link

Intrinsic Function Long form to short form after new update #551

Closed bruceliqin closed 1 year ago

bruceliqin commented 1 year ago

Parsing the below template functions normally until the recent update to the new GoLang Version: !Join [!Ref Param1, "Val2"] -> Fn::Join: [Ref: Param1 Val2]

After the new update, it fails to parse the Ref Intrinsic function and outputs the below: Fn::Join:[Param1 Val2]

rubenfonseca commented 1 year ago

@bruceliqin thank you so much for reporting this. We're a little pressed on time, so one thing that could help us immensely would be to provide us with a snippet of code where you parse a sample template that clearly shows the failing case.

Would you be able to help us with this?

scottiedog45 commented 1 year ago

If someone picks this up, there is some example code on a possibly related issue I posted

bruceliqin commented 1 year ago

I am using the below code as I would like to preserve the intrinsic functions:

var test map[string]interface{}
opts := &intrinsics.ProcessorOptions{
    NoProcess: true,
}
output, _ := intrinsics.ProcessYAML(testData, opts)
bruceliqin commented 1 year ago

I am expecting

!Join [!Ref Param1, "Val2"] -> Fn::Join: [Ref: Param1 Val2]

But instead I get Fn::Join:[Param1 Val2]

bruceliqin commented 1 year ago

Hello, wanted to see if there is any updates on this issue

rubenfonseca commented 1 year ago

Can you please try version 7.8.1 that we just released to see if it fixes the problem?