Skip to content

Implement ambiguity detection #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
otaviomacedo opened this issue Feb 25, 2025 · 0 comments
Closed

Implement ambiguity detection #135

otaviomacedo opened this issue Feb 25, 2025 · 0 comments
Assignees

Comments

@otaviomacedo
Copy link
Contributor

In case it's not possible to establish a 1:1 mapping between resources, show the ambiguous pairs, in the following format:

    ┌───┬──────────────────────┐
    │   │ Resource             │
    ├───┼──────────────────────┤
    │ - │ Stack.Queue1A4198146 │
    │   │ Stack.Queue2B0BA5D32 │
    ├───┼──────────────────────┤
    │ + │ Stack.Queue3C7606C37 │
    │   │ Stack.Queue4D681F510 │
    └───┴──────────────────────┘

github-merge-queue bot pushed a commit that referenced this issue Apr 11, 2025
Add a `refactor` command. For now, it only works in dry run mode
(`-dry-run` in the command line, or `dryRun: true` to the toolkit). It
computes the mappings based on the difference between the deployed
stacks and the cloud assembly stacks, and shows them in a table.
Example:

```
$ cdk refactor --dry-run --unstable=refactor

The following resources were moved or renamed:
┌───────────────────────┬────────────────────────────────────────┬───────────────────────────────────────┐
│ Resource Type         │ Old Construct Path                     │ New Construct Path                    │
├───────────────────────┼────────────────────────────────────────┼───────────────────────────────────────┤
│ AWS::IAM::Role        │ Consumer/Function/ServiceRole/Resource │ Consumer/NewName/ServiceRole/Resource │
├───────────────────────┼────────────────────────────────────────┼───────────────────────────────────────┤
│ AWS::Lambda::Function │ Consumer/Function/Resource             │ Consumer/NewName/Resource             │
└───────────────────────┴────────────────────────────────────────┴───────────────────────────────────────┘
```

Note that we are launching this feature under unstable mode, which
requires the user to acknowledge that by passing the
`--unstable=refactor` flag.

Closes #132,
#133,
#141,
#134 and
#135.

---
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache-2.0 license
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant