aws / aws/aws-cdk-cli

cdk migrate: Cloudformation conditions are tagged enums.

Open
#824 11 comments 3 reactions 0 assignees View on GitHub
bug effort/medium p1
Dominant language
TypeScript
Stars
105
Forks
122
Avg merge
1d 17h
Merged PRs (30d)
71

Description

### 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](https://github.com/aws/aws-cdk/files/14350008/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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.