@aws/nx-plugin-mcp 1.0.0-rc.83 → 1.0.0-rc.84

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.
@@ -94,7 +94,7 @@ const harness = new MyHarness(this, 'MyHarness', {
94
94
 
95
95
  The construct also accepts:
96
96
 
97
- - `allowedTools` — the tools the Harness may use. The Harness deploys with none unless you supply them, see <a href="#configuring-tools">Configuring tools</a>.
97
+ - `allowedTools` — the tools the Harness may use. Defaults to none, see <a href="#configuring-tools">Configuring tools</a>.
98
98
  - `executionRole` — an existing IAM role to use instead of the generated role. A supplied role is used as-is: the baseline permissions are not added to it, and its ARN always feeds the Harness (the raw `executionRoleArn` string cannot be overridden).
99
99
  - `modelResourceArns` — the Bedrock model and inference-profile ARNs the generated execution role may invoke, replacing the default list.
100
100
  - `vpc`, `vpcSubnets` and `securityGroups` — run the Harness in a VPC so it can reach private resources, see <a href="#running-in-a-vpc">Running in a VPC</a>.
@@ -112,15 +112,21 @@ module "my_harness" {
112
112
  }
113
113
  ```
114
114
 
115
- The module exposes three variables:
115
+ The module exposes the following variables:
116
116
 
117
117
  - `model_id` — the Bedrock model or inference profile the Harness uses by default.
118
- - `model_resource_arns` — the Bedrock model and inference-profile ARNs the execution role may invoke, replacing the default list.
119
- - `additional_execution_role_policy_statements` — a list of IAM statement objects (`Effect`, `Action`, `Resource`, optional `Sid` and `Condition`) appended to the execution role policy.
118
+ - `allowed_tools` — the tools the Harness may use. Defaults to none, see <a href="#configuring-tools">Configuring tools</a>.
119
+ - `memory` — the Harness memory configuration, see <a href="#configuring-memory">Configuring memory</a>.
120
+ - `environment_variables`, `max_iterations`, `timeout_seconds` — the corresponding native Harness fields.
121
+ - `execution_role_arn` — an existing IAM role to use instead of the generated role. A supplied role is used as-is: neither the role nor its baseline policy is created, so `model_resource_arns` and `additional_execution_role_policy_statements` cannot be combined with it.
122
+ - `model_resource_arns` — the Bedrock model and inference-profile ARNs the generated execution role may invoke, replacing the default list.
123
+ - `additional_execution_role_policy_statements` — a list of IAM statement objects (`Effect`, `Action`, `Resource`, optional `Sid` and `Condition`) appended to the generated execution role policy.
124
+ - `enable_vpc`, `vpc_id`, `subnet_ids` — run the Harness in a VPC so it can reach private resources, see <a href="#running-in-a-vpc">Running in a VPC</a>.
125
+ - `tags` — tags applied to the resources the module creates.
120
126
 
121
- Everything else is configured on the generated `aws_bedrockagentcore_harness` resource in the module itself.
127
+ Other provider-native fields are configured by editing the generated `aws_bedrockagentcore_harness` resource in the module itself, see <a href="#customizing-your-harness">Customizing your Harness</a>.
122
128
 
123
- The module outputs `harness_id`, `harness_arn`, and `execution_role_arn`.
129
+ The module outputs `harness_id`, `harness_arn`, `execution_role_arn` and `security_group_id`.
124
130
 
125
131
  Deploy with your Terraform project's plan/apply workflow as usual — see the <Link path="guides/terraform-project">Terraform project guide</Link>.
126
132
  </Fragment>
@@ -196,7 +202,7 @@ With neither set, the script fails with an error naming both options.
196
202
  Every native Harness property of the pinned `aws-cdk-lib/aws-bedrockagentcore` module is available through the construct's props — alternate model providers, tool definitions, memory, skills, environment configuration, truncation, custom JWT authorization, and execution limits — and explicit props take precedence over the generated defaults. Alternatively, edit the generated construct in `packages/common/constructs/src/app/harnesses/<name>/<name>.ts`.
197
203
  </Fragment>
198
204
  <Fragment slot="terraform">
199
- The generated module keeps the native `aws_bedrockagentcore_harness` resource directly editable, so provider-native fields alternate model providers (`gemini_model_config`, `openai_model_config`), `tool` blocks, `memory`, `skill` blocks, environments (`environment`, `environment_variables`, `environment_artifact`), `truncation`, and `authorizer_configuration` with a `custom_jwt_authorizer` — are configured by editing `packages/common/terraform/src/app/harnesses/<name>/<name>.tf`.
205
+ The module's variables cover the fields most deployments configure — `model_id`, `allowed_tools`, `memory`, `environment_variables`, `max_iterations`, `timeout_seconds` — plus the execution role and VPC placement. Terraform has no equivalent of the CDK construct's prop spread, so the remaining provider-native fields are configured by editing the `aws_bedrockagentcore_harness` resource in `packages/common/terraform/src/app/harnesses/<name>/<name>.tf`: alternate model providers (`gemini_model_config`, `openai_model_config`), `tool` blocks, `skill` blocks, `environment_artifact`, filesystem and lifecycle configuration under `environment`, `truncation`, and `authorizer_configuration` with a `custom_jwt_authorizer`.
200
206
  </Fragment>
201
207
  </Infrastructure>
202
208
 
@@ -213,19 +219,47 @@ new MyHarness(this, 'Harness', { allowedTools: ['@builtin'] });
213
219
  ```
214
220
  </Fragment>
215
221
  <Fragment slot="terraform">
216
- ```hcl title="packages/common/terraform/src/app/harnesses/my-harness/my-harness.tf"
217
- resource "aws_bedrockagentcore_harness" "this" {
218
- # ...
222
+ ```hcl title="packages/infra/src/main.tf"
223
+ module "my_harness" {
224
+ source = "../../common/terraform/src/app/harnesses/my-harness"
219
225
  allowed_tools = ["@builtin"]
220
226
  }
221
227
  ```
222
-
223
- Add an `allowed_tools` variable to the module if you would rather set it as a module argument where you reference the module.
224
228
  </Fragment>
225
229
  </Infrastructure>
226
230
 
227
231
  Narrow `@builtin` to specific patterns such as `@builtin/file_operations` to restrict what the agent loop can do. See [Harness tools](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-tools.html) for the built-in tools you can add.
228
232
 
233
+ ### Configuring memory
234
+
235
+ The service provisions managed memory for the Harness by default, and the generated execution role is granted access to it — scoped to the memory ARN the service assigns, and only granted while the Harness uses managed memory the infrastructure created. Configure memory explicitly to tune that managed memory, point the Harness at a memory resource you own, or turn memory off:
236
+
237
+ <Infrastructure>
238
+ <Fragment slot="cdk">
239
+ ```ts
240
+ new MyHarness(this, 'MyHarness', {
241
+ memory: { managedMemoryConfiguration: { strategies: ['SUMMARIZATION'] } },
242
+ });
243
+ ```
244
+
245
+ Supplying `memory` at all replaces the default managed memory, so the construct leaves the memory grant off the execution role: add whatever the configuration needs with `addToRolePolicy`.
246
+ </Fragment>
247
+ <Fragment slot="terraform">
248
+ ```hcl
249
+ module "my_harness" {
250
+ source = "../../common/terraform/src/app/harnesses/my-harness"
251
+ memory = {
252
+ managed_memory_configuration = {
253
+ strategies = ["SUMMARIZATION"]
254
+ }
255
+ }
256
+ }
257
+ ```
258
+
259
+ Set exactly one of `managed_memory_configuration` (tune the service's managed memory), `agentcore_memory_configuration` (use a memory resource you own, by ARN) or `disabled` (no memory). Choosing `agentcore_memory_configuration` or `disabled` drops the managed-memory grant from the execution role; for your own memory resource, grant access through `additional_execution_role_policy_statements`.
260
+ </Fragment>
261
+ </Infrastructure>
262
+
229
263
  ### Running in a VPC
230
264
 
231
265
  <Infrastructure>
@@ -241,28 +275,31 @@ database.connections.allowDefaultPortFrom(harness, 'Harness to database');
241
275
  The Harness is placed in the VPC's private subnets with egress, in a security group created for it. Override either with `vpcSubnets` and `securityGroups`. Both require `vpc`, and `connections` is only available when the Harness runs in a VPC.
242
276
  </Fragment>
243
277
  <Fragment slot="terraform">
244
- Add a `network_configuration` block to the generated `aws_bedrockagentcore_harness` resource's `environment.agent_core_runtime_environment`, then reference the security group you place it in from your other resources' rules:
278
+ Set `enable_vpc` alongside `vpc_id` and `subnet_ids` to run the Harness inside a VPC, so it can reach private resources such as a database:
245
279
 
246
- ```hcl title="packages/common/terraform/src/app/harnesses/my-harness/my-harness.tf"
247
- resource "aws_security_group" "harness" {
248
- vpc_id = var.vpc_id
280
+ ```hcl
281
+ module "my_harness" {
282
+ source = "../../common/terraform/src/app/harnesses/my-harness"
283
+ enable_vpc = true
284
+ vpc_id = var.vpc_id
285
+ subnet_ids = var.private_subnet_ids
249
286
  }
287
+ ```
250
288
 
251
- resource "aws_bedrockagentcore_harness" "this" {
252
- # ...
253
- environment {
254
- agent_core_runtime_environment {
255
- network_configuration {
256
- network_mode = "VPC"
257
- network_mode_config {
258
- security_groups = [aws_security_group.harness.id]
259
- subnets = var.subnet_ids
260
- }
261
- }
262
- }
263
- }
289
+ The module creates a security group for the Harness, allowing outbound HTTPS only. Its `security_group_id` output is what resources the Harness must reach reference in their own ingress rules:
290
+
291
+ ```hcl
292
+ resource "aws_vpc_security_group_ingress_rule" "harness_to_database" {
293
+ security_group_id = aws_security_group.database.id
294
+ referenced_security_group_id = module.my_harness.security_group_id
295
+ from_port = 5432
296
+ to_port = 5432
297
+ ip_protocol = "tcp"
298
+ description = "Harness to database"
264
299
  }
265
300
  ```
301
+
302
+ `security_group_id` is null unless `enable_vpc` is true, and `vpc_id` and `subnet_ids` are both required when it is.
266
303
  </Fragment>
267
304
  </Infrastructure>
268
305
 
@@ -5,6 +5,8 @@ import Infrastructure from '@components/infrastructure.astro';
5
5
 
6
6
  Performance Insights is enabled on the Aurora writer instance by default (encrypted with the cluster's KMS key). Aurora engine logs are also exported to [CloudWatch Logs](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html) by default, configured to surface schema-level activity without leaking row data.
7
7
 
8
+ Exported log volume — and so [CloudWatch Logs ingestion cost](https://aws.amazon.com/cloudwatch/pricing/) — scales with schema changes and connections rather than query traffic, since the log types that carry full statement text are excluded. On Aurora MySQL the `CONNECT` audit event is emitted per connection, so workloads that open a connection per request produce more than ones that pool.
9
+
8
10
  Disable log export per database if not required:
9
11
 
10
12
  <Infrastructure>
@@ -3,7 +3,7 @@ title: Serverless Capacity
3
3
  ---
4
4
  import Infrastructure from '@components/infrastructure.astro';
5
5
 
6
- Control Aurora Serverless v2 scaling limits to match your workload.
6
+ Control Aurora Serverless v2 scaling limits to match your workload. Both providers default to a minimum of 0.5 ACUs and a maximum of 4.
7
7
 
8
8
  <Infrastructure>
9
9
  <Fragment slot="cdk">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws/nx-plugin-mcp",
3
- "version": "1.0.0-rc.83",
3
+ "version": "1.0.0-rc.84",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/awslabs/nx-plugin-for-aws.git",