Skip to content

Commit 0e6cb4e

Browse files
authored
Edits to Gen 2 project structure page (#6840)
* Edits to Gen 2 project structure page * Removed the aws-cdk-lib command and warning message * Updated CDK wording
1 parent c573afb commit 0e6cb4e

File tree

1 file changed

+7
-28
lines changed
  • src/pages/gen2/reference/project-structure

1 file changed

+7
-28
lines changed

src/pages/gen2/reference/project-structure/index.mdx

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const meta = {
22
title: 'Project structure',
3-
description: 'Learn more about the Amplify project structure.'
3+
description: 'Learn more about how Amplify projects are structured.'
44
};
55

66
export function getStaticProps(context) {
@@ -11,9 +11,9 @@ export function getStaticProps(context) {
1111
};
1212
}
1313

14-
Amplify (Gen 2) backends are defined using TypeScript, and enable you to collocate resources depending on their function. For example, you can author a [Post Confirmation trigger for Amazon Cognito](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-post-confirmation.html) right next to your auth's resource file.
14+
Amplify (Gen 2) backends are defined using TypeScript, and enable you to collocate resources depending on their function. For example, you can author a [post confirmation trigger for Amazon Cognito](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-post-confirmation.html) right next to your auth's resource file.
1515

16-
First, after creating your first Amplify project with `npm create amplify@latest`, it will contain the scaffolding for Data and Authentication resources:
16+
When you create your first Amplify project using `npm create amplify@latest`, it will automatically set up the scaffolding for Data and Authentication resources:
1717

1818
```text
1919
├── amplify/
@@ -30,7 +30,7 @@ First, after creating your first Amplify project with `npm create amplify@latest
3030
└── tsconfig.json
3131
```
3232

33-
As your project grows and your backend is built out, the structure of your project may look like the following:
33+
As your project grows and you build out your backend, the structure of your project may look like the following:
3434

3535
```text
3636
├── amplify/
@@ -88,7 +88,7 @@ export const auth = defineAuth({
8888
});
8989
```
9090

91-
After defining backend resources they are set on the backend:
91+
After the resources are defined, they are set up on the backend:
9292

9393
```ts title="amplify/backend.ts"
9494
import { defineBackend } from '@aws-amplify/backend';
@@ -101,28 +101,7 @@ defineBackend({
101101
});
102102
```
103103

104-
Backends can be extended using the [AWS Cloud Development Kit (CDK)](https://docs.aws.amazon.com/cdk/v2/guide/home.html). By leveraging CDK you can build using any AWS service, such as an Amazon S3 bucket that authenticated users have read and write access to. You can get started by installing AWS CDK:
105-
106-
```bash
107-
npm add --save-dev aws-cdk-lib
108-
```
109-
110-
<Callout warning>
111-
112-
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:
113-
114-
```
115-
npm WARN Could not resolve dependency:
116-
npm WARN peer aws-cdk-lib@"~2.103.0" from @aws-amplify/[email protected]
117-
npm WARN node_modules/@aws-amplify/backend
118-
npm WARN dev @aws-amplify/backend@"^0.4.0" from the root project
119-
```
120-
121-
Using the sample warning text above, you would need to install `[email protected]`.
122-
123-
</Callout>
124-
125-
Then add CDK to your backend:
104+
You can extend backends by using the [AWS Cloud Development Kit (AWS CDK)](https://docs.aws.amazon.com/cdk/v2/guide/home.html), which is installed by default as part of the `create amplify` workflow. With the CDK, you can build using any AWS service, such as an Amazon S3 bucket that authenticated users have read and write access to. To get started with the CDK, add it to your backend:
126105

127106
```ts title="amplify/backend.ts"
128107
import * as s3 from 'aws-cdk-lib/aws-s3';
@@ -150,7 +129,7 @@ const unauthRole = backend.auth.resources.unauthenticatedUserIamRole;
150129
bucket.grantRead(unauthRole);
151130
```
152131

153-
## Next Steps
132+
## Next steps
154133

155134
- [Learn the concepts](/gen2/how-amplify-works/concepts)
156135
- [Learn how to add AWS services to your backend](/gen2/build-a-backend/add-aws-services)

0 commit comments

Comments
 (0)