-
Notifications
You must be signed in to change notification settings - Fork 1.1k
chore: aws cdk v2 migration troubleshooting #4990
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
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
f4164b2
chore: added cdkv2 troubleshooting
5c0b962
chore: minor fixes
05d1538
chore: removes images
78b22c4
chore: address comments
561b3c0
chore: address comments
002802e
Update src/pages/cli/project/troubleshooting.mdx
edwardfoyle a889ea0
fix: addressed comments
50cc3bd
chore: fix conflicts
7d7d555
chore: merge branch 'main' into cdkv2Migration
dd419c2
chore: fix conflicts again
365198f
chore: added a note
7588bb9
chore: address more comments
16d14f9
chore: address more comments
6847b1e
fix: added callout
c7c2e48
fix: added spaces
akshbhu e39639a
Update src/pages/cli/migration/aws-cdk-migration.mdx
josefaidt dea5fd9
Update src/pages/cli/migration/aws-cdk-migration.mdx
josefaidt f338e84
Update src/pages/cli/migration/aws-cdk-migration.mdx
josefaidt cd37793
Update src/pages/cli/migration/aws-cdk-migration.mdx
josefaidt b7ffecc
Update src/pages/cli/migration/aws-cdk-migration.mdx
josefaidt ce355b3
Update src/pages/cli/migration/aws-cdk-migration.mdx
josefaidt 87b8e9c
Update src/pages/cli/migration/aws-cdk-migration.mdx
josefaidt 2905396
Update src/pages/cli/migration/aws-cdk-migration.mdx
josefaidt 0c351df
Update src/pages/cli/migration/aws-cdk-migration.mdx
josefaidt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
export const meta = { | ||
title: `AWS CDK v1 to v2 migration`, | ||
description: ``, | ||
}; | ||
|
||
<Callout> | ||
AWS CDK version should match the CDK version that cli-extensibility-helper package uses as a dependency in `amplify/backend/custom/customResourceName/package.json`. | ||
|
||
|
||
You can verify the `aws-cdk-lib` version that [`@aws-amplify/cli-extensibility-helper`](https://www.npmjs.com/package/@aws-amplify/cli-extensibility-helper?activeTab=explore) uses in the `amplify/backend/package.json` file. | ||
|
||
</Callout> | ||
|
||
[AWS Cloud Development Kit (CDK) version 1](https://docs.aws.amazon.com/cdk/v1/guide/home.html) that Amplify CLI uses under the hood has entered maintenance on June 1, 2022 with end of support date scheduled on June 1, 2023. | ||
Amplify CLI v11 and above uses CDK v2 to help you move away from deprecated CDK as well as unblock new features that won’t be added to version 1 of CDK. | ||
To learn more about AWS CDK Migration, visit [Migrating to V2](https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html) | ||
## When to migrate | ||
During deployment, Amplify CLI searches for AWS CDK v1 dependencies in your project and if found, Amplify CLI prints a warning to migrate to AWS CDK v2. | ||
|
||
```console | ||
We detect you are using CDK v1 with custom stacks and overrides. AWS CDK v1 has entered maintenance mode on June 1, 2022 | ||
|
||
Impacted files. | ||
- amplify/backend/package.json | ||
Upgrade '@aws-amplify/cli-extensibility-helper' to latest version ^3.0.0 | ||
|
||
- amplify/backend/custom/<resource-name1>/package.json | ||
- amplify/backend/custom/<resource-name2>/package.json | ||
|
||
Follow this guide here: https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html | ||
``` | ||
|
||
## How do I migrate? | ||
|
||
If an Amplify project using `amplify override <category>` or `amplify add custom` was deployed with an Amplify CLI version prior to 11.0.0, then you need to follow the steps below to migrate: | ||
1. For projects using `amplify overrides <category>`: | ||
Upgrade `@aws-amplify/cli-extensibility-helper` to version `^3.0.0` in `amplify/backend/package.json` | ||
2. For projects using `amplify add custom`: | ||
Update `package.json` for `custom` categories in `amplify/backend/custom/<custom-resource-name>/package.json` as shown below: | ||
|
||
 | ||
And update `amplify/backend/custom/<custom-resource-name>/cdk-stack.ts` for `custom` categories as shown below: | ||
|
||
 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, I now realize this is in a fenced code block and is likely the output from the CLI