@aws/nx-plugin-mcp 1.0.0-rc.62 → 1.0.0-rc.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/aws-nx-mcp.js +1 -0
- package/docs/get_started/quick-start.mdx +7 -7
- package/docs/get_started/tutorials/dungeon-game/4.mdx +3 -1
- package/docs/guides/typescript-infrastructure.mdx +24 -12
- package/docs/snippets/prerequisites.mdx +1 -7
- package/docs/snippets/recommended-prerequisites.mdx +10 -0
- package/package.json +1 -1
package/bin/aws-nx-mcp.js
CHANGED
|
@@ -53898,6 +53898,7 @@ ${PACKAGE_MANAGERS.map((pm) => buildNxCommand("<options>", pm)).join(" - \n")}
|
|
|
53898
53898
|
- Generate all projects into the \`packages/\` directory
|
|
53899
53899
|
- After making changes to your projects, fix linting issues, then run a full build
|
|
53900
53900
|
- When it's time to start testing a project, suggest to the user that infrastructure is deployed to AWS. For websites, if a runtime-config.json is needed, use the load-runtime-config target after a deployment to point a local website at a sandbox stack.
|
|
53901
|
+
- For CDK infrastructure projects, deploy the sandbox stage with the \`deploy-sandbox\` target (eg \`nx deploy-sandbox infra\`) rather than passing a stage pattern to \`deploy\` — it already targets the sandbox stage declared in \`main.ts\`.
|
|
53901
53902
|
|
|
53902
53903
|
## Batching Generators
|
|
53903
53904
|
|
|
@@ -66,25 +66,25 @@ Otherwise, follow the steps below to run each generator yourself.
|
|
|
66
66
|
|
|
67
67
|
### Add a tRPC API
|
|
68
68
|
|
|
69
|
-
<RunGenerator generator="ts#api" requiredParameters={{ name: 'demo-api', framework: 'trpc', auth: 'iam' }} />
|
|
69
|
+
<RunGenerator generator="ts#api" requiredParameters={{ name: 'demo-api', framework: 'trpc', auth: 'iam' }} noInteractive />
|
|
70
70
|
|
|
71
71
|
This will create the API inside the `packages/demo-api` folder.
|
|
72
72
|
|
|
73
73
|
### Add a React Website
|
|
74
74
|
|
|
75
|
-
<RunGenerator generator="ts#website" requiredParameters={{ name: 'demo-website' }} />
|
|
75
|
+
<RunGenerator generator="ts#website" requiredParameters={{ name: 'demo-website' }} noInteractive />
|
|
76
76
|
|
|
77
77
|
This scaffolds a new React website in `packages/demo-website`.
|
|
78
78
|
|
|
79
79
|
### Add Cognito Authentication
|
|
80
80
|
|
|
81
|
-
<RunGenerator generator="ts#website#auth" requiredParameters={{ project: '@my-project/demo-website', cognitoDomain: 'my-demo' }} />
|
|
81
|
+
<RunGenerator generator="ts#website#auth" requiredParameters={{ project: '@my-project/demo-website', cognitoDomain: 'my-demo' }} noInteractive />
|
|
82
82
|
|
|
83
83
|
This sets up the necessary infrastructure and React code to add Cognito Authentication to your website.
|
|
84
84
|
|
|
85
85
|
### Connect Frontend to Backend
|
|
86
86
|
|
|
87
|
-
<RunGenerator generator="connection" requiredParameters={{ sourceProject: '@my-project/demo-website', targetProject: '@my-project/demo-api' }} />
|
|
87
|
+
<RunGenerator generator="connection" requiredParameters={{ sourceProject: '@my-project/demo-website', targetProject: '@my-project/demo-api' }} noInteractive />
|
|
88
88
|
|
|
89
89
|
This configures the necessary providers to ensure your website can call your tRPC API.
|
|
90
90
|
|
|
@@ -94,12 +94,12 @@ Add the infrastructure project based on your chosen IAC provider.
|
|
|
94
94
|
|
|
95
95
|
<Infrastructure>
|
|
96
96
|
<Fragment slot="cdk">
|
|
97
|
-
<RunGenerator generator="ts#infra" requiredParameters={{ name: 'infra' }} />
|
|
97
|
+
<RunGenerator generator="ts#infra" requiredParameters={{ name: 'infra' }} noInteractive />
|
|
98
98
|
|
|
99
99
|
This configures a CDK App which you can use to deploy your infrastructure on AWS.
|
|
100
100
|
</Fragment>
|
|
101
101
|
<Fragment slot="terraform">
|
|
102
|
-
<RunGenerator generator="terraform#project" requiredParameters={{ name: 'infra' }} />
|
|
102
|
+
<RunGenerator generator="terraform#project" requiredParameters={{ name: 'infra' }} noInteractive />
|
|
103
103
|
|
|
104
104
|
This configures a Terraform project which you can use to deploy your infrastructure on AWS.
|
|
105
105
|
</Fragment>
|
|
@@ -247,7 +247,7 @@ Deploy your project:
|
|
|
247
247
|
|
|
248
248
|
<Infrastructure>
|
|
249
249
|
<Fragment slot="cdk">
|
|
250
|
-
<NxCommands commands={['deploy infra
|
|
250
|
+
<NxCommands commands={['deploy-sandbox infra']} />
|
|
251
251
|
</Fragment>
|
|
252
252
|
<Fragment slot="terraform">
|
|
253
253
|
<NxCommands commands={['apply infra']} />
|
|
@@ -107,7 +107,7 @@ Your game is complete and you've tested every piece locally. Now let's deploy it
|
|
|
107
107
|
|
|
108
108
|
### Deploy your application
|
|
109
109
|
|
|
110
|
-
<NxCommands commands={['deploy infra
|
|
110
|
+
<NxCommands commands={['deploy-sandbox infra']} />
|
|
111
111
|
|
|
112
112
|
:::caution[Bootstrap Required]
|
|
113
113
|
If this is the first CDK deployment in your AWS account/region, bootstrap it first:
|
|
@@ -115,6 +115,8 @@ If this is the first CDK deployment in your AWS account/region, bootstrap it fir
|
|
|
115
115
|
<NxCommands commands={['bootstrap infra']} />
|
|
116
116
|
:::
|
|
117
117
|
|
|
118
|
+
The `deploy-sandbox` target deploys the sandbox stage defined in `packages/infra/src/main.ts`.
|
|
119
|
+
|
|
118
120
|
Your first deployment will take around 6 minutes to complete as it waits for all resources to fully stabilize. Subsequent deployments are faster. To speed up iteration during development you can opt into [CloudFormation express mode](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-express-mode.html) by passing the `--express` flag, which completes each resource operation as soon as its configuration is applied rather than waiting for full stabilization.
|
|
119
121
|
|
|
120
122
|
Once the deployment completes, you will see outputs similar to the following:
|
|
@@ -96,10 +96,14 @@ new ApplicationStage(app, 'my-app-sandbox', {
|
|
|
96
96
|
region: process.env.CDK_DEFAULT_REGION,
|
|
97
97
|
},
|
|
98
98
|
});
|
|
99
|
+
|
|
100
|
+
// Define other instances of stages, such as beta and prod, below
|
|
99
101
|
```
|
|
100
102
|
|
|
101
103
|
The `env` property tells CDK which AWS account and region to deploy to. `CDK_DEFAULT_ACCOUNT` and `CDK_DEFAULT_REGION` are resolved automatically by the CDK CLI from your active AWS credentials. See the [CDK environments documentation](https://docs.aws.amazon.com/cdk/v2/guide/environments.html) for more details.
|
|
102
104
|
|
|
105
|
+
The sandbox stage is the one the <Link path="guides/typescript-infrastructure#deploying-your-sandbox-stage">`deploy-sandbox` target</Link> deploys.
|
|
106
|
+
|
|
103
107
|
If you generated with `stageConfig`, the `main.ts` reads account and region from a centralized config file instead, falling back to environment variables when no config is set:
|
|
104
108
|
|
|
105
109
|
```ts title="src/main.ts (with stageConfig)"
|
|
@@ -371,33 +375,41 @@ For more details, please refer to the [CDK bootstrapping documentation](https://
|
|
|
371
375
|
|
|
372
376
|
## Deploying to AWS
|
|
373
377
|
|
|
374
|
-
|
|
378
|
+
Your project has three deploy targets, each suited to a different situation:
|
|
375
379
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
380
|
+
| Target | Use it for |
|
|
381
|
+
| ---------------- | -------------------------------------------------------------------------------- |
|
|
382
|
+
| `deploy-sandbox` | Deploying your own sandbox stage during development. No stage argument needed. |
|
|
383
|
+
| `deploy` | Deploying any stage, by naming the stage or stacks you want. |
|
|
384
|
+
| `deploy-ci` | Deploying from a CI/CD pipeline, using a pre-synthesized cloud assembly. |
|
|
379
385
|
|
|
380
386
|
First, make sure you have AWS credentials configured. If you generated with `stageConfig` and have configured stage credentials in `packages/common/infra-config/src/stages.config.ts`, the deploy command will automatically resolve and apply the correct credentials for the target stage. Otherwise, ensure your AWS credentials are set in your environment (e.g., via `AWS_PROFILE` or environment variables). See the [AWS credentials documentation](https://docs.aws.amazon.com/sdkref/latest/guide/access.html) for the available options.
|
|
381
387
|
|
|
382
|
-
|
|
388
|
+
### Deploying your Sandbox Stage
|
|
383
389
|
|
|
384
|
-
|
|
390
|
+
The `deploy-sandbox` target deploys the sandbox stage that `main.ts` declares, so you don't need to remember its stage name:
|
|
391
|
+
|
|
392
|
+
<NxCommands commands={['deploy-sandbox <my-infra>']} />
|
|
393
|
+
|
|
394
|
+
This is the quickest way to get your own copy of the application running in AWS while you develop.
|
|
385
395
|
|
|
386
396
|
:::tip[Express Mode for Faster Deployments]
|
|
387
|
-
The
|
|
397
|
+
The deploy targets wait for full resource stabilization by default, favouring consistency over speed. To speed up iteration during development, opt into [CloudFormation express mode](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-express-mode.html) by passing CDK's `--express` flag:
|
|
388
398
|
|
|
389
|
-
<NxCommands commands={['deploy <my-infra>
|
|
399
|
+
<NxCommands commands={['deploy-sandbox <my-infra> --express']} />
|
|
390
400
|
|
|
391
401
|
Express mode finishes once resource configuration is confirmed applied rather than waiting for full stabilization, with propagation continuing in the background, for significantly faster iteration cycles. It is intended for development and iteration.
|
|
392
402
|
:::
|
|
393
403
|
|
|
394
|
-
|
|
395
|
-
|
|
404
|
+
### Deploying a Specific Stage
|
|
405
|
+
|
|
406
|
+
The `deploy` target deploys whichever stage or stacks you name. Use it for stages other than your sandbox, or to deploy a single stack:
|
|
396
407
|
|
|
397
|
-
|
|
408
|
+
<NxCommands commands={['deploy <my-infra> <my-infra>-sandbox/*']} />
|
|
409
|
+
|
|
410
|
+
You can specify any stage so long as it is defined in `main.ts`. To deploy an individual stack, give the full stack name:
|
|
398
411
|
|
|
399
412
|
<NxCommands commands={['deploy <my-infra> <my-infra>-sandbox/Application']} />
|
|
400
|
-
:::
|
|
401
413
|
|
|
402
414
|
## Deploying to AWS in a CI/CD Pipeline
|
|
403
415
|
|
|
@@ -10,13 +10,7 @@ import Snippet from '@components/snippet.astro';
|
|
|
10
10
|
|
|
11
11
|
### Recommended
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
- verify by running `pnpm --version`, `yarn --version`, `bun --version` or `npm --version`
|
|
15
|
-
- [AWS Credentials](https://docs.aws.amazon.com/sdkref/latest/guide/access.html) configured to your target AWS account are required to deploy your application (as well as for some local development workflows).
|
|
16
|
-
- [Docker](https://www.docker.com/) or [Finch >= 1.6.0](https://runfinch.com/) is required for some generators. For Docker, [multi-platform builds](https://docs.docker.com/build/building/multi-platform/) must be set up; Finch supports [multi-platform builds](https://runfinch.com/docs/getting-started/building-images/#building-a-multi-architecture-container-image) out of the box.
|
|
17
|
-
- [Terraform >= 1.12](https://developer.hashicorp.com/terraform/install) is required if you choose to use this for infrastructure as code instead of CDK
|
|
18
|
-
- verify by running `terraform --version`
|
|
19
|
-
- If you are using [VSCode](https://code.visualstudio.com/), we recommend installing the [Nx Console VSCode Plugin](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console).
|
|
13
|
+
<Snippet name="recommended-prerequisites" parentHeading="Recommended" />
|
|
20
14
|
|
|
21
15
|
:::tip[AI Assistant Setup]
|
|
22
16
|
If you use an AI Assistant such as Kiro, Kiro CLI, Cursor, Claude Code or Cline, you may also wish to <Link path="/get_started/building-with-ai">install the Nx Plugin for AWS MCP server.</Link>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Recommended Prerequisites
|
|
3
|
+
---
|
|
4
|
+
- [PNPM >= 11](https://pnpm.io/installation#using-npm) (you can also use [Yarn >= 4](https://yarnpkg.com/getting-started/install), [Bun >= 1](https://bun.sh/docs/installation), or [NPM >= 10](https://nodejs.org/en/learn/getting-started/an-introduction-to-the-npm-package-manager) if you prefer)
|
|
5
|
+
- verify by running `pnpm --version`, `yarn --version`, `bun --version` or `npm --version`
|
|
6
|
+
- [AWS Credentials](https://docs.aws.amazon.com/sdkref/latest/guide/access.html) configured to your target AWS account are required to deploy your application (as well as for some local development workflows).
|
|
7
|
+
- [Docker](https://www.docker.com/) or [Finch >= 1.6.0](https://runfinch.com/) is required for some generators. For Docker, [multi-platform builds](https://docs.docker.com/build/building/multi-platform/) must be set up; Finch supports [multi-platform builds](https://runfinch.com/docs/getting-started/building-images/#building-a-multi-architecture-container-image) out of the box.
|
|
8
|
+
- [Terraform >= 1.12](https://developer.hashicorp.com/terraform/install) is required if you choose to use this for infrastructure as code instead of CDK
|
|
9
|
+
- verify by running `terraform --version`
|
|
10
|
+
- If you are using [VSCode](https://code.visualstudio.com/), we recommend installing the [Nx Console VSCode Plugin](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console).
|