cdklabs / cdk-from-cfn

A cloudformation json -> cdk typescript transpiler.
Apache License 2.0
58 stars 19 forks source link

Does not support using a single value instead of list for Transform #365

Closed SimonCMoore closed 9 months ago

SimonCMoore commented 1 year ago

CDK migrate does not support using a single value instead of list in at least this case (maybe others? not checked).

In a template where the transform value is specified as a single value rather than list which is common in examples/docs e.g. https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-template-anatomy.html) i.e. this line

Transform: AWS::Serverless-2016-10-31

Results in this Error when using CDK migrate

This is an experimental feature. We make no guarantees about the outcome or stability of the functionality.
 ❌  Migrate failed for testcdkmigrate: stack generation failed due to error 'Transform: invalid type: string "AWS::Serverless-2016-10-31", expected a sequence at line 1 column 12'

Changing the template to use a list instead works as a workaround

Transform: 
  - AWS::Serverless-2016-10-31

Expectations are both formats work.

TheRealAmazonKendra commented 10 months ago

I don't believe we support transforms at this time as SAM templates weren't in the original scope of this project.