cdklabs / cdk-from-cfn

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

CDK migrate #363

Closed aws-sam-bot closed 1 year ago

aws-sam-bot 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.

aws-sam-bot commented 1 year ago

Oops will reopen under correct user