From 29f8105bb62fa242217fa4a5eec86834f66fcb52 Mon Sep 17 00:00:00 2001 From: Jim Eagan <84857865+hibler13@users.noreply.github.com> Date: Tue, 30 Jan 2024 13:46:14 -0800 Subject: [PATCH 1/3] Removes wording about needing to install the CDK --- .../custom-resources/index.mdx | 25 ++----------------- .../gen2/build-a-backend/storage/index.mdx | 25 +++---------------- 2 files changed, 5 insertions(+), 45 deletions(-) diff --git a/src/pages/gen2/build-a-backend/add-aws-services/custom-resources/index.mdx b/src/pages/gen2/build-a-backend/add-aws-services/custom-resources/index.mdx index d959edbe65d..6212a59b5d2 100644 --- a/src/pages/gen2/build-a-backend/add-aws-services/custom-resources/index.mdx +++ b/src/pages/gen2/build-a-backend/add-aws-services/custom-resources/index.mdx @@ -18,7 +18,7 @@ Custom resources allow you to integrate any AWS service into an Amplify backend. -With Amplify (Gen 2), you can add custom AWS resources to an Amplify app using the [AWS Cloud Development Kit (AWS CDK)](https://docs.aws.amazon.com/cdk/latest/guide/home.html). The AWS CDK is an open source software development framework that defines your cloud application resources using familiar programming languages, such as TypeScript. +With Amplify (Gen 2), you can add custom AWS resources to an Amplify app using the [AWS Cloud Development Kit (AWS CDK)](https://docs.aws.amazon.com/cdk/latest/guide/home.html), which is installed by default as part of the `create amplify` workflow. The AWS CDK is an open source software development framework that defines your cloud application resources using familiar programming languages, such as TypeScript. The AWS CDK can be used within an Amplify app to add custom resources and configurations beyond what Amplify supports out of the box. For example, a developer could use CDK to hook up a Redis cache, implement custom security rules, deploy containers on AWS Fargate, or use any other AWS service. @@ -34,28 +34,7 @@ With the Amplify code-first DX, you can add existing or custom CDK [constructs]( ## Adding an existing CDK construct -The AWS CDK comes with [many existing constructs](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-construct-library.html) that can be directly added to your Amplify backend. To get started, install the CDK library: - -```bash -npm add --save-dev aws-cdk-lib constructs -``` - - - -Depending on the Node.js package manager you are using, you may encounter warnings where it is now unable to resolve the peer dependency version `@aws-amplify/backend` has on `aws-cdk-lib`. If you encounter a warning similar to the following, re-install the version specified in the warning text: - -``` -npm WARN Could not resolve dependency: -npm WARN peer aws-cdk-lib@"~2.103.0" from @aws-amplify/backend@0.4.0 -npm WARN node_modules/@aws-amplify/backend -npm WARN dev @aws-amplify/backend@"^0.4.0" from the root project -``` - -Using the sample warning text above, you would need to install `aws-cdk-lib@2.103.0`. - - - -For example, to add an [Amazon Simple Queue Service (Amazon SQS)](https://aws.amazon.com/sqs/) queue and an [Amazon Simple Notification Service (Amazon SNS)](https://aws.amazon.com/sns/) topic to your backend, you can add the following to your `amplify/backend.ts` file. +The AWS CDK comes with [many existing constructs](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-construct-library.html) that can be directly added to your Amplify backend. For example, to add an [Amazon Simple Queue Service (Amazon SQS)](https://aws.amazon.com/sqs/) queue and an [Amazon Simple Notification Service (Amazon SNS)](https://aws.amazon.com/sns/) topic to your backend, you can add the following to your `amplify/backend.ts` file. ```ts title="amplify/backend.ts" import * as sns from 'aws-cdk-lib/aws-sns'; diff --git a/src/pages/gen2/build-a-backend/storage/index.mdx b/src/pages/gen2/build-a-backend/storage/index.mdx index 59854786f72..c5855f9dc99 100644 --- a/src/pages/gen2/build-a-backend/storage/index.mdx +++ b/src/pages/gen2/build-a-backend/storage/index.mdx @@ -13,32 +13,13 @@ export function getStaticProps(context) { -**Coming soon:** The Storage experience for Amplify (Gen 2) is still under development. You can add Amazon S3 to your Amplify (Gen 2) project with AWS CDK. +**Coming soon:** The Storage experience for Amplify (Gen 2) is still under development. You can add Amazon S3 to your Amplify (Gen 2) project with the AWS CDK. -To use Storage today, you must use the [AWS Cloud Development Kit (CDK)](https://docs.aws.amazon.com/cdk/). To get started, install the CDK library package: +To use Storage today, you must use the [AWS Cloud Development Kit (CDK)](https://docs.aws.amazon.com/cdk/), which is installed by default as part of the `create amplify` workflow. -```bash -npm add --save-dev aws-cdk-lib -``` - - - -Depending on the Node.js package manager you are using, you may encounter warnings where it is now unable to resolve the peer dependency version `@aws-amplify/backend` has on `aws-cdk-lib`. If you encounter a warning similar to the following, re-install the version specified in the warning text: - -``` -npm WARN Could not resolve dependency: -npm WARN peer aws-cdk-lib@"~2.103.0" from @aws-amplify/backend@0.4.0 -npm WARN node_modules/@aws-amplify/backend -npm WARN dev @aws-amplify/backend@"^0.4.0" from the root project -``` - -Using the sample warning text above, you would need to install `aws-cdk-lib@2.103.0`. - - - -Next, modify your project's `backend.ts` file to create an Amazon S3 bucket and grant Amplify-generated resources access to read and write: +To get started, modify your project's `backend.ts` file to create an Amazon S3 bucket and grant Amplify-generated resources access to read and write: ```ts title="amplify/backend.ts" // amplify/backend.ts From 4a6244646b0e1323a82efc6cb6d87f8aff3e6407 Mon Sep 17 00:00:00 2001 From: Jim Eagan <84857865+hibler13@users.noreply.github.com> Date: Tue, 30 Jan 2024 14:33:20 -0800 Subject: [PATCH 2/3] Add link to package name --- .../build-a-backend/add-aws-services/custom-resources/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/gen2/build-a-backend/add-aws-services/custom-resources/index.mdx b/src/pages/gen2/build-a-backend/add-aws-services/custom-resources/index.mdx index 6212a59b5d2..1248b1d7071 100644 --- a/src/pages/gen2/build-a-backend/add-aws-services/custom-resources/index.mdx +++ b/src/pages/gen2/build-a-backend/add-aws-services/custom-resources/index.mdx @@ -18,7 +18,7 @@ Custom resources allow you to integrate any AWS service into an Amplify backend. -With Amplify (Gen 2), you can add custom AWS resources to an Amplify app using the [AWS Cloud Development Kit (AWS CDK)](https://docs.aws.amazon.com/cdk/latest/guide/home.html), which is installed by default as part of the `create amplify` workflow. The AWS CDK is an open source software development framework that defines your cloud application resources using familiar programming languages, such as TypeScript. +With Amplify (Gen 2), you can add custom AWS resources to an Amplify app using the [AWS Cloud Development Kit (AWS CDK)](https://docs.aws.amazon.com/cdk/latest/guide/home.html), which is installed by default as part of the [`create-amplify`](https://www.npmjs.com/package/create-amplify) workflow. The AWS CDK is an open source software development framework that defines your cloud application resources using familiar programming languages, such as TypeScript. The AWS CDK can be used within an Amplify app to add custom resources and configurations beyond what Amplify supports out of the box. For example, a developer could use CDK to hook up a Redis cache, implement custom security rules, deploy containers on AWS Fargate, or use any other AWS service. From 945fd1f7a1bc0f605a8d7da2ca8291d6d8bb69c7 Mon Sep 17 00:00:00 2001 From: Jim Eagan <84857865+hibler13@users.noreply.github.com> Date: Tue, 30 Jan 2024 14:34:31 -0800 Subject: [PATCH 3/3] Adding link to create-amplify package name --- src/pages/gen2/build-a-backend/storage/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/gen2/build-a-backend/storage/index.mdx b/src/pages/gen2/build-a-backend/storage/index.mdx index c5855f9dc99..89142f4749c 100644 --- a/src/pages/gen2/build-a-backend/storage/index.mdx +++ b/src/pages/gen2/build-a-backend/storage/index.mdx @@ -17,7 +17,7 @@ export function getStaticProps(context) { -To use Storage today, you must use the [AWS Cloud Development Kit (CDK)](https://docs.aws.amazon.com/cdk/), which is installed by default as part of the `create amplify` workflow. +To use Storage today, you must use the [AWS Cloud Development Kit (CDK)](https://docs.aws.amazon.com/cdk/), which is installed by default as part of the [`create-amplify`](https://www.npmjs.com/package/create-amplify) workflow. To get started, modify your project's `backend.ts` file to create an Amazon S3 bucket and grant Amplify-generated resources access to read and write: