@aws/nx-plugin-mcp 1.0.0-rc.85 → 1.0.0-rc.87
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 -1
- package/docs/get_started/tutorials/dungeon-game/1.mdx +1 -1
- package/docs/get_started/tutorials/dungeon-game/wrap-up.mdx +1 -1
- package/docs/get_started/upgrading.mdx +6 -0
- package/docs/guides/py-rdb.mdx +4 -0
- package/docs/guides/ts-rdb.mdx +4 -0
- package/docs/guides/typescript-infrastructure.mdx +26 -2
- package/docs/snippets/rdb/admin-credentials.mdx +42 -0
- package/docs/snippets/rdb/architecture.mdx +1 -0
- package/package.json +1 -1
package/bin/aws-nx-mcp.js
CHANGED
|
@@ -54023,7 +54023,7 @@ ${PACKAGE_MANAGERS.map((pm) => buildNxCommand("<options>", pm)).join(" - \n")}
|
|
|
54023
54023
|
- Generate all projects into the \`packages/\` directory
|
|
54024
54024
|
- After making changes to your projects, fix linting issues, then run a full build
|
|
54025
54025
|
- 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.
|
|
54026
|
-
- 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\`.
|
|
54026
|
+
- 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\`. Likewise \`destroy-sandbox\` tears that stage back down.
|
|
54027
54027
|
|
|
54028
54028
|
## Batching Generators
|
|
54029
54029
|
|
|
@@ -269,7 +269,7 @@ export class GameApi<
|
|
|
269
269
|
pattern: 'isolated',
|
|
270
270
|
operations: routerToOperations(appRouter),
|
|
271
271
|
defaultIntegrationOptions: {
|
|
272
|
-
runtime: Runtime.
|
|
272
|
+
runtime: Runtime.NODEJS_24_X,
|
|
273
273
|
handler: 'index.handler',
|
|
274
274
|
code: Code.fromAsset(
|
|
275
275
|
url.fileURLToPath(
|
|
@@ -34,7 +34,7 @@ We recommend you try your hand at extending the codebase with the following capa
|
|
|
34
34
|
|
|
35
35
|
1. To destroy the AWS resources that were created, run the following command:
|
|
36
36
|
|
|
37
|
-
<NxCommands commands={['destroy infra
|
|
37
|
+
<NxCommands commands={['destroy-sandbox infra']} />
|
|
38
38
|
|
|
39
39
|
This will prompt you for a list of stacks to delete which should comprise of the `dungeon-adventure-infra-sandbox/Application/GameUI/waf` and `dungeon-adventure-infra-sandbox/Application`.
|
|
40
40
|
|
|
@@ -117,6 +117,12 @@ Finally, verify everything still builds, then delete `migrations.json` and commi
|
|
|
117
117
|
|
|
118
118
|
<PackageManagerShortCommand commands={['build']} />
|
|
119
119
|
|
|
120
|
+
<Aside type="caution" title="Some infrastructure changes are not migrated">
|
|
121
|
+
Migrations don't cover every change to the infrastructure we vend. Where updating an already-deployed stack would fail or destroy data, no migration is provided — your workspace keeps deploying the resources it deploys today, while a newly generated workspace gets the newer shape.
|
|
122
|
+
|
|
123
|
+
To pick those changes up, compare your infrastructure against what today's generators produce and apply the parts you want by hand, taking care over the deployment path for your existing resources.
|
|
124
|
+
</Aside>
|
|
125
|
+
|
|
120
126
|
## Upgrading with an AI agent
|
|
121
127
|
|
|
122
128
|
The whole flow can be driven by an AI coding agent end to end — nothing blocks on an interactive terminal. When `nx migrate --run-migrations` runs from inside an agent, Nx detects this, skips the agentic consent prompt, and instead of spawning a nested agent it **defers** each prompt migration back to the agent driving the run:
|
package/docs/guides/py-rdb.mdx
CHANGED
|
@@ -231,6 +231,10 @@ When using RDS Proxy, you do not need to configure the RDS CA bundle in the runt
|
|
|
231
231
|
|
|
232
232
|
<Snippet name="rdb/encryption-key-rotation" />
|
|
233
233
|
|
|
234
|
+
### Admin Credentials
|
|
235
|
+
|
|
236
|
+
<Snippet name="rdb/admin-credentials" />
|
|
237
|
+
|
|
234
238
|
## Connections
|
|
235
239
|
|
|
236
240
|
Use the <Link path="guides/connection">`connection`</Link> generator to integrate this project with others in your workspace. The following connections involve this project:
|
package/docs/guides/ts-rdb.mdx
CHANGED
|
@@ -311,6 +311,10 @@ For more details, see the AWS Lambda [SSL/TLS requirements for Amazon RDS connec
|
|
|
311
311
|
|
|
312
312
|
<Snippet name="rdb/encryption-key-rotation" />
|
|
313
313
|
|
|
314
|
+
### Admin Credentials
|
|
315
|
+
|
|
316
|
+
<Snippet name="rdb/admin-credentials" />
|
|
317
|
+
|
|
314
318
|
## Limitations
|
|
315
319
|
|
|
316
320
|
<OptionFilter when={{ engine: 'mysql' }}>
|
|
@@ -102,7 +102,7 @@ new ApplicationStage(app, 'my-app-sandbox', {
|
|
|
102
102
|
|
|
103
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.
|
|
104
104
|
|
|
105
|
-
The sandbox stage is the one the <Link path="guides/typescript-infrastructure#deploying-your-sandbox-stage">`deploy-sandbox
|
|
105
|
+
The sandbox stage is the one the <Link path="guides/typescript-infrastructure#deploying-your-sandbox-stage">`deploy-sandbox`</Link> and <Link path="guides/typescript-infrastructure#tearing-down-your-sandbox-stage">`destroy-sandbox`</Link> targets act on.
|
|
106
106
|
|
|
107
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:
|
|
108
108
|
|
|
@@ -421,10 +421,34 @@ This target differs slightly from the regular `deploy` target in that it deploys
|
|
|
421
421
|
|
|
422
422
|
## Tearing Down AWS Infrastructure
|
|
423
423
|
|
|
424
|
-
|
|
424
|
+
Your project has three destroy targets, mirroring the deploy ones:
|
|
425
|
+
|
|
426
|
+
| Target | Use it for |
|
|
427
|
+
| ----------------- | ------------------------------------------------------------------------- |
|
|
428
|
+
| `destroy-sandbox` | Tearing down your own sandbox stage. No stage argument needed. |
|
|
429
|
+
| `destroy` | Tearing down any stage, by naming the stage or stacks you want. |
|
|
430
|
+
| `destroy-ci` | Tearing down from a CI/CD pipeline, using a pre-synthesized cloud assembly. |
|
|
431
|
+
|
|
432
|
+
### Tearing Down your Sandbox Stage
|
|
433
|
+
|
|
434
|
+
The `destroy-sandbox` target tears down the sandbox stage that `main.ts` declares, so you don't need to remember its stage name:
|
|
435
|
+
|
|
436
|
+
<NxCommands commands={['destroy-sandbox <my-infra>']} />
|
|
437
|
+
|
|
438
|
+
Destroying is irreversible, so CDK asks you to confirm the stacks it is about to delete. Pass `--force` to skip that confirmation, which is what you want when there is no terminal attached (in a script, say):
|
|
439
|
+
|
|
440
|
+
<NxCommands commands={['destroy-sandbox <my-infra> --force']} />
|
|
441
|
+
|
|
442
|
+
### Tearing Down a Specific Stage
|
|
443
|
+
|
|
444
|
+
The `destroy` target tears down whichever stage or stacks you name:
|
|
425
445
|
|
|
426
446
|
<NxCommands commands={['destroy <my-infra> <my-infra>-sandbox/*']} />
|
|
427
447
|
|
|
448
|
+
To tear down an individual stack, give the full stack name:
|
|
449
|
+
|
|
450
|
+
<NxCommands commands={['destroy <my-infra> <my-infra>-sandbox/Application']} />
|
|
451
|
+
|
|
428
452
|
## More Information
|
|
429
453
|
|
|
430
454
|
For more information about CDK, please refer to the [CDK Developer Guide](https://docs.aws.amazon.com/cdk/v2/guide/core_concepts.html) and [API Reference](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-construct-library.html).
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Admin Credentials
|
|
3
|
+
---
|
|
4
|
+
import Infrastructure from '@components/infrastructure.astro';
|
|
5
|
+
|
|
6
|
+
The Aurora admin (master) user's password is generated and rotated by Aurora itself in AWS Secrets Manager, using [RDS-managed master user passwords](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-secrets-manager.html). Your infrastructure code never receives the password, so it cannot leak into a CloudFormation template or Terraform state file. Aurora rotates the secret every 7 days without any rotation function to deploy or maintain.
|
|
7
|
+
|
|
8
|
+
The secret is encrypted with the same customer-managed KMS key as the cluster.
|
|
9
|
+
|
|
10
|
+
Your application never uses these credentials. It connects as a least-privilege database user using IAM authentication — only the migration and create-db-user handlers read the admin secret, and each is granted access to just that secret and its KMS key.
|
|
11
|
+
|
|
12
|
+
<Infrastructure>
|
|
13
|
+
<Fragment slot="cdk">
|
|
14
|
+
|
|
15
|
+
The admin secret is exposed as `secret.secretArn` on the underlying cluster, and `grantSecretRead` grants a consumer read access to it:
|
|
16
|
+
|
|
17
|
+
```ts title="packages/infra/src/stacks/application-stack.ts"
|
|
18
|
+
import { MyDatabase } from '@my-scope/common-constructs';
|
|
19
|
+
|
|
20
|
+
const db = new MyDatabase(this, 'Db', { ... });
|
|
21
|
+
|
|
22
|
+
db.grantSecretRead(myFunction);
|
|
23
|
+
```
|
|
24
|
+
</Fragment>
|
|
25
|
+
<Fragment slot="terraform">
|
|
26
|
+
|
|
27
|
+
The admin secret's ARN is exposed as the `secret_arn` output, alongside the `kms_key_arn` needed to decrypt it:
|
|
28
|
+
|
|
29
|
+
```hcl title="packages/infra/src/main.tf"
|
|
30
|
+
module "my_database" {
|
|
31
|
+
source = "../../common/terraform/src/app/dbs/my-database"
|
|
32
|
+
...
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
output "database_secret_arn" {
|
|
36
|
+
value = module.my_database.secret_arn
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
An RDS-managed secret holds a JSON object with `username` and `password` only — no connection details. Take the host, port and database name from the module's `writer_endpoint`, `cluster_port` and `database_name` outputs.
|
|
41
|
+
</Fragment>
|
|
42
|
+
</Infrastructure>
|