Skip to content

cdk migrate: Cloudformation conditions are tagged enums. #29181

Open
@v4de

Description

@v4de

Describe the bug

I am trying to convert our cloudformation templates to cdk by using the new experimental cdk migrate. I have run into an issue when referencing one of our templates and expect others to be the same. I have attached the template ecs.service.template in the reproduction steps and provided some additional context on how it is used.

Expected Behavior

I expect a cdk project to be created and conditions to be created based on !and, !equals, !not, !or, etc. I also expected a way to pass parameters via the context, and for references to the stack parameters to use get.context.

Current Behavior

When running cdk migrate I run into this error that I can not seem to find any information about.

cdk migrate --stack-name ecs-service --language typescript --from-path ecs.service.template
This command is an experimental feature.
 ❌  Migrate failed for `ecs-service`: stack generation failed due to error 'Conditions.cCapacityProviderCompute[1][0]: untagged and internally tagged enums do not support enum input at line 334 column 14'

stack generation failed due to error 'Conditions.cCapacityProviderCompute[1][0]: untagged and internally tagged enums do not support enum input at line 334 column 14'

Reproduction Steps

  1. Create a local copy of file in directory of your choice: ecs.service.template.txt
  2. Remove .txt
  3. From directory with the template file run cdk migrate --stack-name ecs-service --language typescript --from-path ecs.service.template

Possible Solution

No response

Additional Information/Context

At my company we create one cloudformation template and then reuse the same template and pass a ecs.service.parameters json file that we populate during our deployment process in our CD tool (Azure DevOps). So we only use one template file that is reused in many pipelines to create different resources and different conditions are used to enable/disable certain configurations. One of the main benefits of moving to CDK for us is the ability to pass a list of containers for ECS from the pipeline, without having to maintain multiple template files.

CDK CLI Version

2.128.0 (build d995261)

Framework Version

No response

Node.js Version

v20.10.0

OS

Windows 10 Enterprise 10.0.19044

Language

TypeScript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-cloudformationRelated to AWS CloudFormationbugThis issue is a bug.cliIssues related to the CDK CLIeffort/mediumMedium work item – several days of effortp1toolkit/migrateRelated to cdk migrate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions