@aws/nx-plugin-mcp 1.0.0-rc.33 → 1.0.0-rc.35

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.
Files changed (35) hide show
  1. package/bin/aws-nx-mcp.js +27 -0
  2. package/docs/guides/connection/py-agent-rdb.mdx +178 -0
  3. package/docs/guides/connection/py-fast-api-rdb.mdx +184 -0
  4. package/docs/guides/connection/py-mcp-server-rdb.mdx +187 -0
  5. package/docs/guides/connection/smithy-rdb.mdx +1 -1
  6. package/docs/guides/connection/trpc-rdb.mdx +1 -1
  7. package/docs/guides/connection/ts-agent-rdb.mdx +63 -18
  8. package/docs/guides/connection/ts-mcp-server-rdb.mdx +63 -13
  9. package/docs/guides/connection.mdx +28 -1
  10. package/docs/guides/py-dynamodb.mdx +1 -1
  11. package/docs/guides/py-rdb.mdx +250 -0
  12. package/docs/guides/ts-rdb.mdx +48 -483
  13. package/docs/snippets/connection/py-lambda-rdb-ssl-requirements.mdx +7 -0
  14. package/docs/snippets/connection/rdb-api-infrastructure.mdx +50 -19
  15. package/docs/snippets/dynamodb/deploying-table.mdx +0 -5
  16. package/docs/snippets/rdb/architecture.mdx +38 -0
  17. package/docs/snippets/rdb/cluster-instances.mdx +31 -0
  18. package/docs/snippets/rdb/deletion-protection.mdx +34 -0
  19. package/docs/snippets/rdb/deploying.mdx +187 -0
  20. package/docs/snippets/rdb/encryption-key-rotation.mdx +30 -0
  21. package/docs/snippets/rdb/engine-version.mdx +63 -0
  22. package/docs/snippets/rdb/infrastructure.mdx +35 -0
  23. package/docs/snippets/rdb/logging.mdx +32 -0
  24. package/docs/snippets/rdb/rds-proxy.mdx +50 -0
  25. package/docs/snippets/rdb/removal-policy.mdx +57 -0
  26. package/docs/snippets/rdb/serverless-capacity.mdx +32 -0
  27. package/generators.json +27 -0
  28. package/package.json +1 -1
  29. package/src/py/rdb/agent-connection/schema.json +27 -0
  30. package/src/py/rdb/fast-api-connection/schema.json +23 -0
  31. package/src/py/rdb/mcp-server-connection/schema.json +27 -0
  32. package/src/py/rdb/schema.json +77 -0
  33. package/src/ts/rdb/schema.json +1 -1
  34. /package/docs/snippets/connection/{lambda-rdb-ssl-requirements.mdx → ts-lambda-rdb-ssl-requirements.mdx} +0 -0
  35. /package/docs/snippets/connection/{mcp-server-rdb-ssl-requirements.mdx → ts-mcp-server-rdb-ssl-requirements.mdx} +0 -0
@@ -48,13 +48,9 @@ The generator modifies two files in your agent's source directory:
48
48
 
49
49
  Additionally, the agent's `<agent-name>-dev` target is updated to depend on the database's `dev` target.
50
50
 
51
- ## How It Works
51
+ ## Using the Database in Agent Tools
52
52
 
53
- The Prisma client is instantiated inside `getAgent()`. Since the `ts#agent` generator configures a single Agent per session, the client is also reused for the lifetime of the session.
54
-
55
- ### Agent Definition
56
-
57
- `getAgent` is updated to import and call the Prisma getter at the top of its body:
53
+ The Prisma client is instantiated inside `getAgent()`. Since the `ts#agent` generator configures a single Agent per session, the client is also reused for the lifetime of the session:
58
54
 
59
55
  ```ts title="packages/my-service/src/my-agent/agent.ts" {1,4}
60
56
  import { getPrisma as getMyDb } from ':my-scope/my-db';
@@ -66,7 +62,6 @@ export const getAgent = async () => {
66
62
  };
67
63
  ```
68
64
 
69
-
70
65
  ## Multiple Databases
71
66
 
72
67
  Running the generator again with a different target adds the second database alongside the first:
@@ -91,10 +86,21 @@ The generated agent construct implements `IGrantable` and `IConnectable`, so you
91
86
  <Fragment slot="cdk">
92
87
 
93
88
  ```ts title="packages/infra/src/stacks/application-stack.ts"
89
+ import { SecurityGroup } from 'aws-cdk-lib/aws-ec2';
90
+ import { RuntimeNetworkConfiguration } from 'aws-cdk-lib/aws-bedrockagentcore';
94
91
  import { MyDatabase } from ':my-scope/common-constructs';
95
92
 
96
93
  const db = new MyDatabase(this, 'Db', { vpc, ... });
97
- const myAgent = new MyAgent(this, 'MyAgent', { vpc, ... });
94
+
95
+ const myAgent = new MyAgent(this, 'MyAgent', {
96
+ networkConfiguration: RuntimeNetworkConfiguration.usingVpc(this, {
97
+ vpc,
98
+ vpcSubnets: { subnetType: SubnetType.PRIVATE_WITH_EGRESS },
99
+ securityGroups: [
100
+ new SecurityGroup(this, 'MyAgentSecurityGroup', { vpc, allowAllOutbound: true }),
101
+ ],
102
+ }),
103
+ });
98
104
 
99
105
  db.allowDefaultPortFrom(myAgent);
100
106
  db.grantConnect(myAgent);
@@ -102,30 +108,69 @@ db.grantConnect(myAgent);
102
108
 
103
109
  `allowDefaultPortFrom` opens the security group rule so the agent runtime can reach the database port. `grantConnect` grants IAM `rds-db:connect` permission to the agent's execution role.
104
110
 
111
+
105
112
  </Fragment>
106
113
  <Fragment slot="terraform">
107
114
 
108
- Pass the database module outputs into your agent module so it can reach the database and read its runtime configuration:
115
+ Run the agent inside the same VPC as the database, grant it `rds-db:connect` via `additional_iam_policy_statements`, and open the network path with a pair of security group rules. The `aws_vpc.main` and `aws_subnet` resources are defined in the database deployment guide:
109
116
 
110
117
  ```hcl title="packages/infra/src/main.tf"
111
118
  module "my_database" {
112
119
  source = "../../common/terraform/src/app/dbs/my-database"
113
- vpc_id = module.vpc.vpc_id
114
- database_subnet_ids = module.vpc.private_isolated_subnet_ids
120
+ vpc_id = aws_vpc.main.id
121
+ database_subnet_ids = aws_subnet.database[*].id
122
+ lambda_subnet_ids = aws_subnet.private[*].id
115
123
  }
116
124
 
117
125
  module "my_agent" {
118
- source = "../../common/terraform/src/app/agents/my-agent"
126
+ source = "../../common/terraform/src/app/agents/my-agent"
127
+ enable_vpc = true
128
+ vpc_id = aws_vpc.main.id
129
+ subnet_ids = aws_subnet.private[*].id
130
+
131
+ appconfig_application_id = module.runtime_config_appconfig.application_id
132
+ appconfig_application_arn = module.runtime_config_appconfig.application_arn
133
+
134
+ additional_iam_policy_statements = [
135
+ {
136
+ Effect = "Allow"
137
+ Action = ["rds-db:connect"]
138
+ Resource = [
139
+ "arn:aws:rds-db:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:dbuser:${module.my_database.connect_resource_id}/${module.my_database.database_runtime_user}"
140
+ ]
141
+ }
142
+ ]
143
+ }
119
144
 
120
- appconfig_application_id = module.my_database.appconfig_application_id
121
- database_cluster_resource_id = module.my_database.cluster_resource_id
122
- database_runtime_user = module.my_database.database_runtime_user
123
- database_security_group_id = module.my_database.security_group_id
124
- database_port = module.my_database.cluster_port
145
+ resource "aws_vpc_security_group_ingress_rule" "agent_to_database" {
146
+ description = "Allow the agent runtime to connect to the database"
147
+ security_group_id = module.my_database.security_group_id
148
+ referenced_security_group_id = module.my_agent.security_group_id
149
+ from_port = module.my_database.cluster_port
150
+ to_port = module.my_database.cluster_port
151
+ ip_protocol = "tcp"
152
+ }
153
+
154
+ resource "aws_vpc_security_group_egress_rule" "agent_to_database" {
155
+ description = "Allow outbound traffic from the agent runtime to the database"
156
+ security_group_id = module.my_agent.security_group_id
157
+ referenced_security_group_id = module.my_database.security_group_id
158
+ from_port = module.my_database.cluster_port
159
+ to_port = module.my_database.cluster_port
160
+ ip_protocol = "tcp"
125
161
  }
126
162
  ```
127
163
 
128
- Ensure the agent's execution role has `rds-db:connect` permission and that its security group can reach the database security group on the database port.
164
+ `appconfig_application_id`/`appconfig_application_arn` come from the shared <Link path="guides/runtime-config">runtime configuration</Link> AppConfig application declared once in your root module, not from the database module. Include the `database` namespace when instantiating it so the database module's runtime configuration entry is deployed:
165
+
166
+ ```hcl title="packages/infra/src/main.tf"
167
+ module "runtime_config_appconfig" {
168
+ source = "../../common/terraform/src/core/runtime-config/appconfig"
169
+
170
+ application_name = "my-app-runtime-config"
171
+ namespaces = ["connection", "agentcore", "database"]
172
+ }
173
+ ```
129
174
 
130
175
  </Fragment>
131
176
  </Infrastructure>
@@ -48,7 +48,7 @@ The generator modifies two files in your MCP server's source directory:
48
48
 
49
49
  Additionally, the `<mcp-server-name>-dev` target is updated to depend on the database's `dev` target.
50
50
 
51
- ## How It Works
51
+ ## Using the Database in MCP Tools
52
52
 
53
53
  The Prisma client is fetched inside `createServer` and available to all tools and resources registered there:
54
54
 
@@ -85,10 +85,21 @@ The generated MCP server construct implements `IGrantable` and `IConnectable`, s
85
85
  <Fragment slot="cdk">
86
86
 
87
87
  ```ts title="packages/infra/src/stacks/application-stack.ts"
88
+ import { SecurityGroup } from 'aws-cdk-lib/aws-ec2';
89
+ import { RuntimeNetworkConfiguration } from 'aws-cdk-lib/aws-bedrockagentcore';
88
90
  import { MyDatabase } from ':my-scope/common-constructs';
89
91
 
90
92
  const db = new MyDatabase(this, 'Db', { vpc, ... });
91
- const myMcpServer = new MyMcpServer(this, 'MyMcpServer', { vpc, ... });
93
+
94
+ const myMcpServer = new MyMcpServer(this, 'MyMcpServer', {
95
+ networkConfiguration: RuntimeNetworkConfiguration.usingVpc(this, {
96
+ vpc,
97
+ vpcSubnets: { subnetType: SubnetType.PRIVATE_WITH_EGRESS },
98
+ securityGroups: [
99
+ new SecurityGroup(this, 'MyMcpServerSecurityGroup', { vpc, allowAllOutbound: true }),
100
+ ],
101
+ }),
102
+ });
92
103
 
93
104
  db.allowDefaultPortFrom(myMcpServer);
94
105
  db.grantConnect(myMcpServer);
@@ -96,37 +107,76 @@ db.grantConnect(myMcpServer);
96
107
 
97
108
  `allowDefaultPortFrom` opens the security group rule so the MCP server runtime can reach the database port. `grantConnect` grants IAM `rds-db:connect` permission to the server's execution role.
98
109
 
110
+
99
111
  </Fragment>
100
112
  <Fragment slot="terraform">
101
113
 
102
- Pass the database module outputs into your MCP server module so it can reach the database and read its runtime configuration:
114
+ Run the MCP server inside the same VPC as the database, grant it `rds-db:connect` via `additional_iam_policy_statements`, and open the network path with a pair of security group rules. The `aws_vpc.main` and `aws_subnet` resources are defined in the database deployment guide:
103
115
 
104
116
  ```hcl title="packages/infra/src/main.tf"
105
117
  module "my_database" {
106
118
  source = "../../common/terraform/src/app/dbs/my-database"
107
- vpc_id = module.vpc.vpc_id
108
- database_subnet_ids = module.vpc.private_isolated_subnet_ids
119
+ vpc_id = aws_vpc.main.id
120
+ database_subnet_ids = aws_subnet.database[*].id
121
+ lambda_subnet_ids = aws_subnet.private[*].id
109
122
  }
110
123
 
111
124
  module "my_mcp_server" {
112
- source = "../../common/terraform/src/app/mcp-servers/my-mcp-server"
125
+ source = "../../common/terraform/src/app/mcp-servers/my-mcp-server"
126
+ enable_vpc = true
127
+ vpc_id = aws_vpc.main.id
128
+ subnet_ids = aws_subnet.private[*].id
129
+
130
+ appconfig_application_id = module.runtime_config_appconfig.application_id
131
+ appconfig_application_arn = module.runtime_config_appconfig.application_arn
132
+
133
+ additional_iam_policy_statements = [
134
+ {
135
+ Effect = "Allow"
136
+ Action = ["rds-db:connect"]
137
+ Resource = [
138
+ "arn:aws:rds-db:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:dbuser:${module.my_database.connect_resource_id}/${module.my_database.database_runtime_user}"
139
+ ]
140
+ }
141
+ ]
142
+ }
143
+
144
+ resource "aws_vpc_security_group_ingress_rule" "mcp_server_to_database" {
145
+ description = "Allow the MCP server runtime to connect to the database"
146
+ security_group_id = module.my_database.security_group_id
147
+ referenced_security_group_id = module.my_mcp_server.security_group_id
148
+ from_port = module.my_database.cluster_port
149
+ to_port = module.my_database.cluster_port
150
+ ip_protocol = "tcp"
151
+ }
113
152
 
114
- appconfig_application_id = module.my_database.appconfig_application_id
115
- database_cluster_resource_id = module.my_database.cluster_resource_id
116
- database_runtime_user = module.my_database.database_runtime_user
117
- database_security_group_id = module.my_database.security_group_id
118
- database_port = module.my_database.cluster_port
153
+ resource "aws_vpc_security_group_egress_rule" "mcp_server_to_database" {
154
+ description = "Allow outbound traffic from the MCP server runtime to the database"
155
+ security_group_id = module.my_mcp_server.security_group_id
156
+ referenced_security_group_id = module.my_database.security_group_id
157
+ from_port = module.my_database.cluster_port
158
+ to_port = module.my_database.cluster_port
159
+ ip_protocol = "tcp"
119
160
  }
120
161
  ```
121
162
 
122
- Ensure the MCP server's execution role has `rds-db:connect` permission and that its security group can reach the database security group on the database port.
163
+ `appconfig_application_id`/`appconfig_application_arn` come from the shared <Link path="guides/runtime-config">runtime configuration</Link> AppConfig application declared once in your root module, not from the database module. Include the `database` namespace when instantiating it so the database module's runtime configuration entry is deployed:
164
+
165
+ ```hcl title="packages/infra/src/main.tf"
166
+ module "runtime_config_appconfig" {
167
+ source = "../../common/terraform/src/core/runtime-config/appconfig"
168
+
169
+ application_name = "my-app-runtime-config"
170
+ namespaces = ["connection", "agentcore", "database"]
171
+ }
172
+ ```
123
173
 
124
174
  </Fragment>
125
175
  </Infrastructure>
126
176
 
127
177
  ### SSL Requirements When Connecting Without RDS Proxy
128
178
 
129
- <Snippet name="connection/mcp-server-rdb-ssl-requirements" parentHeading="SSL Requirements When Connecting Without RDS Proxy" />
179
+ <Snippet name="connection/ts-mcp-server-rdb-ssl-requirements" parentHeading="SSL Requirements When Connecting Without RDS Proxy" />
130
180
 
131
181
  ## Local Development
132
182
 
@@ -125,11 +125,38 @@ The Connection generator supports the following connections:
125
125
  target="aurora"
126
126
  />
127
127
  <ConnectionCard
128
- title="MCP Server to Relational Database"
128
+ title="TypeScript MCP Server to Relational Database"
129
129
  description="Connect a TypeScript MCP Server to an Aurora relational database"
130
130
  href={`/nx-plugin-for-aws/${Astro.currentLocale || 'en'}/guides/connection/ts-mcp-server-rdb`}
131
131
  source="mcp"
132
+ sourceBadge="typescript"
133
+ target="aurora"
134
+ />
135
+ <ConnectionCard
136
+ title="FastAPI to Python Relational Database"
137
+ description="Connect a FastAPI to a Python Aurora relational database"
138
+ href={`/nx-plugin-for-aws/${Astro.currentLocale || 'en'}/guides/connection/py-fast-api-rdb`}
139
+ source="fastapi"
140
+ target="aurora"
141
+ targetBadge="python"
142
+ />
143
+ <ConnectionCard
144
+ title="Python Agent to Python Relational Database"
145
+ description="Connect a Python Agent to a Python Aurora relational database"
146
+ href={`/nx-plugin-for-aws/${Astro.currentLocale || 'en'}/guides/connection/py-agent-rdb`}
147
+ source="strands"
148
+ sourceBadge="python"
132
149
  target="aurora"
150
+ targetBadge="python"
151
+ />
152
+ <ConnectionCard
153
+ title="Python MCP Server to Python Relational Database"
154
+ description="Connect a Python MCP Server to a Python Aurora relational database"
155
+ href={`/nx-plugin-for-aws/${Astro.currentLocale || 'en'}/guides/connection/py-mcp-server-rdb`}
156
+ source="mcp"
157
+ sourceBadge="python"
158
+ target="aurora"
159
+ targetBadge="python"
133
160
  />
134
161
  <ConnectionCard
135
162
  title="tRPC API to TypeScript DynamoDB"
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: py#dynamodb
2
+ title: Python DynamoDB
3
3
  description: Create a Python DynamoDB project
4
4
  generator: py#dynamodb
5
5
  ---
@@ -0,0 +1,250 @@
1
+ ---
2
+ title: Python Relational Database
3
+ description: Create a Python relational database project
4
+ generator: py#rdb
5
+ ---
6
+
7
+ import { FileTree, CardGrid, Tabs, TabItem } from '@astrojs/starlight/components';
8
+ import Astro from '@astrojs/react';
9
+ import ConnectionCard from '@components/connection-card.astro';
10
+ import Infrastructure from '@components/infrastructure.astro';
11
+ import Link from '@components/link.astro';
12
+ import RunGenerator from '@components/run-generator.astro';
13
+ import GeneratorParameters from '@components/generator-parameters.astro';
14
+ import NxCommands from '@components/nx-commands.astro';
15
+ import Snippet from '@components/snippet.astro';
16
+
17
+ This generator creates a new Python relational database project backed by [Amazon Aurora](https://aws.amazon.com/rds/aurora/) (PostgreSQL or MySQL), [SQLModel](https://sqlmodel.tiangolo.com/) for data modelling, and [Alembic](https://alembic.sqlalchemy.org/) for schema migrations. It generates the application code and infrastructure needed to provision and manage a database using AWS CDK or Terraform, with declarative schema definition, automatic migration deployment, and a database client.
18
+
19
+ ## Usage
20
+
21
+ ### Generate a Relational Database
22
+
23
+ <RunGenerator generator="py#rdb" />
24
+
25
+ ### Options
26
+
27
+ <GeneratorParameters generator="py#rdb" />
28
+
29
+ ## Generator Output
30
+
31
+ The generator creates the following project structure in the `<directory>/<name>` directory:
32
+
33
+ <FileTree>
34
+ - \<name>
35
+ - \_\_init\_\_.py Package exports (`get_engine`, `session_context`)
36
+ - connection.py Database engine and session factory with IAM authentication
37
+ - utils.py Runtime config and local development helpers
38
+ - migration_handler.py Lambda handler that runs Alembic migrations during deployment
39
+ - create_db_user_handler.py Lambda handler that creates the application database user during deployment
40
+ - models
41
+ - example.py Example SQLModel table definition
42
+ - migrations
43
+ - versions Alembic-generated migration scripts
44
+ - env.py Alembic environment (connects to the database)
45
+ - script.py.mako Alembic migration script template
46
+ - alembic.ini Alembic configuration
47
+ - config.json Local development connection details and runtime config key
48
+ - Dockerfile.migration Container image for the migration handler
49
+ - Dockerfile.create-db-user Container image for the create-db-user handler
50
+ - project.json Project configuration and build targets
51
+ </FileTree>
52
+
53
+ Local development scripts are shared across all database projects and generated into `packages/common/scripts/`:
54
+
55
+ <FileTree>
56
+ - packages/common/scripts/src/rdb
57
+ - pull-image.ts Pulls the database container image
58
+ - start-container.ts Starts a local database container
59
+ - wait-for-postgres-db.ts Waits for the local database to be ready (PostgreSQL)
60
+ - wait-for-mysql-db.ts Waits for the local database to be ready (MySQL)
61
+ </FileTree>
62
+
63
+ ### Infrastructure
64
+
65
+ <Snippet name="rdb/infrastructure" />
66
+
67
+ #### Architecture
68
+
69
+ <Snippet name="rdb/architecture" />
70
+
71
+ ## Local Development
72
+
73
+ ### Data Modelling
74
+
75
+ The generated project uses [SQLModel](https://sqlmodel.tiangolo.com/) to define your database schema. The workflow is model-first: add or update SQLModel table classes under your database project's `<name>/models/` directory, then generate a migration from those model changes.
76
+
77
+ Example model:
78
+
79
+ ```python title="packages/my_db/my_db/models/example.py"
80
+ from sqlalchemy import Column, String
81
+ from sqlmodel import Field, SQLModel
82
+
83
+
84
+ class ExampleModel(SQLModel, table=True):
85
+ id: int | None = Field(default=None, primary_key=True)
86
+ name: str = Field(sa_column=Column(String(255), nullable=False))
87
+ description: str | None = Field(default=None, sa_column=Column(String(255), nullable=True))
88
+ ```
89
+
90
+ Import your models in `<name>/models/__init__.py` so Alembic can discover them during autogeneration.
91
+
92
+ ### Creating Migrations
93
+
94
+ After adding or updating models, use Alembic to generate and apply migration scripts. The generated `alembic` target automatically starts a local database container before running:
95
+
96
+ <NxCommands commands={['run <project>:alembic revision --autogenerate -m "describe your change"']} />
97
+
98
+ This generates a new migration script under `migrations/versions/`. Review the generated script before applying it.
99
+
100
+ Apply the migration to your local database:
101
+
102
+ <NxCommands commands={['run <project>:migrate']} />
103
+
104
+ When you deploy the AWS stack, the generated infrastructure automatically applies the generated migrations to the deployed database.
105
+
106
+ ### Applying Existing Migrations
107
+
108
+ When you pull migration files created by other developers, apply them to your local database:
109
+
110
+ <NxCommands commands={['run <project>:migrate']} />
111
+
112
+ ### Running Alembic Commands
113
+
114
+ The generated `alembic` target exposes the Alembic CLI, so you can run any Alembic command against the local database. See the [Alembic command reference](https://alembic.sqlalchemy.org/en/latest/ops.html) for available commands.
115
+
116
+ <NxCommands commands={['run <project>:alembic <alembic-command>']} />
117
+
118
+ ### Stopping the Local Database
119
+
120
+ Stopping `dev` (e.g. with `Ctrl+C`) automatically removes the local database container, but preserves the named volume so your data persists across restarts.
121
+
122
+ :::caution[Windows]
123
+ Due to limitations with signal handling on Windows, the container is not automatically removed when `dev` is stopped. You will need to remove it manually:
124
+
125
+ ```bash
126
+ <engine> rm -f <scope>-<db-name>
127
+ ```
128
+
129
+ Replace `<engine>` with your container engine (`docker` or `finch`), `<scope>` with your Nx workspace scope (e.g. `proj`), and `<db-name>` with your database project name (e.g. `my-db`).
130
+ :::
131
+
132
+ ## Connecting to the Database
133
+
134
+ Import `session_context` from your database package and use it as an async context manager to obtain an `AsyncSession`:
135
+
136
+ ```python
137
+ from sqlmodel import select
138
+
139
+ from my_scope.my_db import session_context
140
+ from my_scope.my_db.models.example import ExampleModel
141
+
142
+ async def example():
143
+ async with session_context() as session:
144
+ results = (await session.execute(select(ExampleModel))).all()
145
+ ```
146
+
147
+ The database client automatically:
148
+ - Retrieves database configuration from AWS AppConfig using `RUNTIME_CONFIG_APP_ID` environment variable
149
+ - Generates temporary authentication tokens via `boto3` RDS Signer for IAM authentication
150
+ - Establishes TLS connections using `ssl.create_default_context()`
151
+
152
+ ## Deploying your Database
153
+
154
+ <Snippet name="rdb/deploying" parentHeading="Deploying your Database" />
155
+
156
+ ### RDS Proxy Configuration
157
+
158
+ <Snippet name="rdb/rds-proxy" parentHeading="RDS Proxy Configuration" />
159
+
160
+ #### SSL Requirements When Connecting Without RDS Proxy
161
+
162
+ The Amazon RDS CA bundle must be in the runtime's system trust store.
163
+
164
+ ##### Container Runtimes
165
+
166
+ <Tabs>
167
+ <TabItem label="Amazon Linux">
168
+
169
+ ```dockerfile
170
+ ADD https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem /etc/pki/ca-trust/source/anchors/global-bundle.pem
171
+ RUN update-ca-trust
172
+ ```
173
+
174
+ </TabItem>
175
+ <TabItem label="Debian">
176
+
177
+ ```dockerfile
178
+ ADD https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem /usr/local/share/ca-certificates/rds-global-bundle.crt
179
+ RUN update-ca-certificates
180
+ ```
181
+
182
+ </TabItem>
183
+ </Tabs>
184
+
185
+ ##### Zip Lambda Functions
186
+
187
+ For zip-deployed Lambda functions (such as a <Link path="guides/fastapi">`py#api` FastAPI</Link>), the Amazon Linux 2023 Lambda execution environment's built-in CA trust store includes the Amazon Root CAs used by RDS.
188
+
189
+ When using RDS Proxy, you do not need to configure the RDS CA bundle in the runtime that connects to the database.
190
+
191
+ ### Cluster Instances
192
+
193
+ <Snippet name="rdb/cluster-instances" />
194
+
195
+ ### Serverless Capacity
196
+
197
+ <Snippet name="rdb/serverless-capacity" />
198
+
199
+ ### Engine Version
200
+
201
+ <Snippet name="rdb/engine-version" />
202
+
203
+ ### Deletion Protection
204
+
205
+ <Snippet name="rdb/deletion-protection" />
206
+
207
+ ### Removal Policy
208
+
209
+ <Snippet name="rdb/removal-policy" />
210
+
211
+ ### Logging and Monitoring
212
+
213
+ <Snippet name="rdb/logging" />
214
+
215
+ ### Encryption Key Rotation
216
+
217
+ <Snippet name="rdb/encryption-key-rotation" />
218
+
219
+ ## Connections
220
+
221
+ Use the <Link path="guides/connection">`connection`</Link> generator to integrate this project with others in your workspace. The following connections involve this project:
222
+
223
+ <CardGrid>
224
+ <ConnectionCard
225
+ title="Python Agent to Relational Database"
226
+ description="Connect a Python Agent to an Aurora relational database"
227
+ href={`/nx-plugin-for-aws/${Astro.currentLocale || 'en'}/guides/connection/py-agent-rdb`}
228
+ source="strands"
229
+ sourceBadge="python"
230
+ target="aurora"
231
+ targetBadge="python"
232
+ />
233
+ <ConnectionCard
234
+ title="FastAPI to Relational Database"
235
+ description="Connect a FastAPI to an Aurora relational database"
236
+ href={`/nx-plugin-for-aws/${Astro.currentLocale || 'en'}/guides/connection/py-fast-api-rdb`}
237
+ source="fastapi"
238
+ target="aurora"
239
+ targetBadge="python"
240
+ />
241
+ <ConnectionCard
242
+ title="Python MCP Server to Relational Database"
243
+ description="Connect a Python MCP Server to an Aurora relational database"
244
+ href={`/nx-plugin-for-aws/${Astro.currentLocale || 'en'}/guides/connection/py-mcp-server-rdb`}
245
+ source="mcp"
246
+ sourceBadge="python"
247
+ target="aurora"
248
+ targetBadge="python"
249
+ />
250
+ </CardGrid>