@aws/nx-plugin 1.0.0-rc.32 → 1.0.0-rc.34
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/LICENSE-THIRD-PARTY +75 -86
- package/generators.json +27 -0
- package/package.json +10 -10
- package/src/connection/generator.js +12 -1
- package/src/connection/generator.js.map +1 -1
- package/src/connection/supported-connections.d.ts +10 -1
- package/src/connection/supported-connections.js +13 -0
- package/src/connection/supported-connections.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +21 -21
- package/src/infra/app/files/app/src/main.ts.template +1 -1
- package/src/infra/app/files/app/src/stages/application-stage.ts.template +1 -1
- package/src/infra/app/generator.js +3 -1
- package/src/infra/app/generator.js.map +1 -1
- package/src/open-api/ts-client/__snapshots__/generator.complex-types.spec.ts.snap +12 -12
- package/src/open-api/ts-client/__snapshots__/generator.composite-types.spec.ts.snap +74 -10
- package/src/open-api/ts-client/__snapshots__/generator.content-type.spec.ts.snap +22 -4
- package/src/open-api/ts-client/__snapshots__/generator.duplicate-types.spec.ts.snap +53 -8
- package/src/open-api/ts-client/__snapshots__/generator.edge-cases.spec.ts.snap +32 -4
- package/src/open-api/ts-client/__snapshots__/generator.fast-api-gaps.spec.ts.snap +736 -0
- package/src/open-api/ts-client/__snapshots__/generator.fast-api.spec.ts.snap +86 -11
- package/src/open-api/ts-client/__snapshots__/generator.multipart.spec.ts.snap +21 -3
- package/src/open-api/ts-client/__snapshots__/generator.primitive-types.spec.ts.snap +2 -2
- package/src/open-api/ts-client/__snapshots__/generator.request.spec.ts.snap +6 -6
- package/src/open-api/ts-client/__snapshots__/generator.reserved-keywords.spec.ts.snap +2 -2
- package/src/open-api/ts-client/__snapshots__/generator.spec-compliance.spec.ts.snap +1883 -0
- package/src/open-api/ts-client/__snapshots__/generator.tags.spec.ts.snap +4 -4
- package/src/open-api/ts-client/files/client.gen.ts.template +196 -13
- package/src/open-api/ts-client/files/types.gen.ts.template +2 -0
- package/src/open-api/ts-client/generator.js +27 -2
- package/src/open-api/ts-client/generator.js.map +1 -1
- package/src/open-api/ts-hooks/files/options-proxy.gen.ts.template +2 -2
- package/src/open-api/ts-hooks/generator.js +5 -1
- package/src/open-api/ts-hooks/generator.js.map +1 -1
- package/src/open-api/utils/codegen-data/languages.js +6 -0
- package/src/open-api/utils/codegen-data/languages.js.map +1 -1
- package/src/open-api/utils/codegen-data/types.d.ts +16 -1
- package/src/open-api/utils/codegen-data/types.js.map +1 -1
- package/src/open-api/utils/codegen-data.js +71 -0
- package/src/open-api/utils/codegen-data.js.map +1 -1
- package/src/open-api/utils/normalise.js +53 -8
- package/src/open-api/utils/normalise.js.map +1 -1
- package/src/open-api/utils/parser.js +48 -15
- package/src/open-api/utils/parser.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +5 -3
- package/src/preset/generator.d.ts +1 -1
- package/src/preset/generator.js +5 -2
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.js.map +1 -1
- package/src/preset/schema.d.ts +2 -0
- package/src/preset/schema.json +6 -0
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +7 -7
- package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +8 -8
- package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +89 -3
- package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +12 -12
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +91 -5
- package/src/py/rdb/__snapshots__/generator.spec.ts.snap +2038 -0
- package/src/py/rdb/agent-connection/__snapshots__/generator.spec.ts.snap +104 -0
- package/src/py/rdb/agent-connection/generator.d.ts +10 -0
- package/src/py/rdb/agent-connection/generator.js +46 -0
- package/src/py/rdb/agent-connection/generator.js.map +1 -0
- package/src/py/rdb/agent-connection/schema.d.js +8 -0
- package/src/py/rdb/agent-connection/schema.d.js.map +1 -0
- package/src/py/rdb/agent-connection/schema.d.ts +15 -0
- package/src/py/rdb/agent-connection/schema.json +27 -0
- package/src/py/rdb/fast-api-connection/__snapshots__/generator.spec.ts.snap +44 -0
- package/src/py/rdb/fast-api-connection/files/__apiModuleName__/dependencies/__rdbNameSnake__.py.template +14 -0
- package/src/py/rdb/fast-api-connection/generator.d.ts +10 -0
- package/src/py/rdb/fast-api-connection/generator.js +54 -0
- package/src/py/rdb/fast-api-connection/generator.js.map +1 -0
- package/src/py/rdb/fast-api-connection/schema.d.js +8 -0
- package/src/py/rdb/fast-api-connection/schema.d.js.map +1 -0
- package/src/py/rdb/fast-api-connection/schema.d.ts +13 -0
- package/src/py/rdb/fast-api-connection/schema.json +23 -0
- package/src/py/rdb/files/Dockerfile.create-db-user.template +10 -0
- package/src/py/rdb/files/Dockerfile.migration.template +10 -0
- package/src/py/rdb/files/__name__/__init__.py.template +3 -0
- package/src/py/rdb/files/__name__/connection.py.template +55 -0
- package/src/py/rdb/files/__name__/create_db_user_handler.py.template +97 -0
- package/src/py/rdb/files/__name__/migration_handler.py.template +36 -0
- package/src/py/rdb/files/__name__/models/__init__.py.template +3 -0
- package/src/py/rdb/files/__name__/models/example.py.template +8 -0
- package/src/py/rdb/files/__name__/utils.py.template +104 -0
- package/src/py/rdb/files/alembic.ini.template +38 -0
- package/src/py/rdb/files/config.json.template +14 -0
- package/src/py/rdb/files/migrations/env.py.template +80 -0
- package/src/py/rdb/files/migrations/script.py.mako.template +28 -0
- package/src/py/rdb/generator.d.ts +6 -0
- package/src/py/rdb/generator.js +263 -0
- package/src/py/rdb/generator.js.map +1 -0
- package/src/py/rdb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +101 -0
- package/src/py/rdb/mcp-server-connection/generator.d.ts +10 -0
- package/src/py/rdb/mcp-server-connection/generator.js +46 -0
- package/src/py/rdb/mcp-server-connection/generator.js.map +1 -0
- package/src/py/rdb/mcp-server-connection/schema.d.js +8 -0
- package/src/py/rdb/mcp-server-connection/schema.d.js.map +1 -0
- package/src/py/rdb/mcp-server-connection/schema.d.ts +15 -0
- package/src/py/rdb/mcp-server-connection/schema.json +27 -0
- package/src/py/rdb/schema.d.js +6 -0
- package/src/py/rdb/schema.d.js.map +1 -0
- package/src/py/rdb/schema.d.ts +16 -0
- package/src/py/rdb/schema.json +77 -0
- package/src/py/rdb/utils.d.ts +6 -0
- package/src/py/rdb/utils.js +16 -0
- package/src/py/rdb/utils.js.map +1 -0
- package/src/sdk/py.d.ts +2 -0
- package/src/sdk/py.js +1 -0
- package/src/sdk/py.js.map +1 -1
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +7 -7
- package/src/smithy/ts/api/files/handler.ts.template +2 -2
- package/src/smithy/ts/api/files/local-server.ts.template +2 -2
- package/src/smithy/ts/api/files/operations/echo.ts.template +2 -2
- package/src/smithy/ts/api/files/service.ts.template +3 -3
- package/src/smithy/ts/api/generator.js +3 -1
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +12 -12
- package/src/trpc/backend/files/src/client/index.ts.template +1 -1
- package/src/trpc/backend/files/src/handler.ts.template +1 -1
- package/src/trpc/backend/files/src/index.ts.template +5 -5
- package/src/trpc/backend/files/src/init.ts.template +1 -1
- package/src/trpc/backend/files/src/local-server.ts.template +1 -1
- package/src/trpc/backend/files/src/middleware/index.ts.template +7 -7
- package/src/trpc/backend/files/src/procedures/echo.ts.template +2 -2
- package/src/trpc/backend/files/src/router.ts.template +2 -2
- package/src/trpc/backend/files/src/schema/index.ts.template +1 -1
- package/src/trpc/backend/generator.js +3 -1
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +89 -3
- package/src/ts/agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client-strands.ts.template +2 -2
- package/src/ts/agent/a2a-connection/generator.js +3 -1
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/files/a2a/index.ts.template +1 -1
- package/src/ts/agent/files/ag-ui/index.ts.template +1 -1
- package/src/ts/agent/files/http/client.ts.template +2 -2
- package/src/ts/agent/files/http/index.ts.template +2 -2
- package/src/ts/agent/files/http/router.ts.template +3 -3
- package/src/ts/agent/gateway-connection/files/agent-connection/app/__gatewayKebabCase__-client-strands.ts.template +2 -2
- package/src/ts/agent/gateway-connection/generator.js +3 -1
- package/src/ts/agent/gateway-connection/generator.js.map +1 -1
- package/src/ts/agent/generator.js +5 -2
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client-strands.ts.template +2 -2
- package/src/ts/agent/mcp-connection/generator.js +3 -1
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/astro-docs/files/translation/scripts/translate.ts.template +3 -2
- package/src/ts/astro-docs/generator.js +2 -0
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/dynamodb/files/src/client.ts.template +5 -2
- package/src/ts/dynamodb/files/src/entities/example.ts.template +1 -1
- package/src/ts/dynamodb/files/src/entities/index.ts.template +1 -1
- package/src/ts/dynamodb/files/src/index.ts.template +2 -2
- package/src/ts/dynamodb/generator.js +3 -1
- package/src/ts/dynamodb/generator.js.map +1 -1
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/lib/generator.js +7 -1
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/ts-project-utils.js +19 -4
- package/src/ts/lib/ts-project-utils.js.map +1 -1
- package/src/ts/lib/types.d.ts +6 -0
- package/src/ts/lib/types.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +94 -8
- package/src/ts/mcp-server/generator.js +3 -2
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/nx-generator/files/local/generator.ts.template +2 -2
- package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.ts.template +2 -2
- package/src/ts/nx-generator/generator.js +5 -2
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/nx-plugin/files/mcp-server/server.ts.template +5 -5
- package/src/ts/nx-plugin/files/mcp-server/tools/create-workspace-command.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/tools/general-guidance.ts.template +1 -1
- package/src/ts/nx-plugin/files/mcp-server/tools/generator-guide.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/tools/list-generators.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/utils.ts.template +3 -3
- package/src/ts/nx-plugin/generator.js +3 -1
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/nx-plugin/utils.js +7 -4
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +149 -177
- package/src/ts/rdb/files/src/create-db-user-handler.ts.template +2 -2
- package/src/ts/rdb/files/src/index.ts.template +1 -1
- package/src/ts/rdb/files/src/migration-handler.ts.template +1 -1
- package/src/ts/rdb/files/src/prisma.ts.template +7 -4
- package/src/ts/rdb/generator.js +7 -4
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/schema.json +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +45 -45
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +2 -2
- package/src/utils/agent-chat/agent-chat.js +3 -1
- package/src/utils/agent-chat/agent-chat.js.map +1 -1
- package/src/utils/agent-chat/files/a2a/chat.ts.template +1 -1
- package/src/utils/agent-chat/files/ag-ui/chat.ts.template +1 -1
- package/src/utils/agent-chat/files/http-py/chat.ts.template +2 -2
- package/src/utils/agent-chat/files/http-ts/chat.ts.template +1 -1
- package/src/utils/agent-connection/agent-connection.js +4 -1
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-a2a/agentcore-a2a-client-config.ts.template +2 -2
- package/src/utils/agent-connection/files/core-auth/agentcore-fetch.ts.template +1 -1
- package/src/utils/agent-connection/files/core-gateway/agentcore-gateway-mcp-transport.ts.template +2 -2
- package/src/utils/agent-connection/files/core-mcp/agentcore-mcp-transport.ts.template +2 -2
- package/src/utils/agent-connection/files/core-shared/agentcore-transport.ts.template +1 -1
- package/src/utils/agent-connection/files/core-strands/a2a/agentcore-a2a-client-strands.ts.template +1 -1
- package/src/utils/agent-connection/files/core-strands/base/with-session-id-strands.ts.template +1 -1
- package/src/utils/agent-connection/files/core-strands/gateway/agentcore-gateway-mcp-client-strands.ts.template +1 -1
- package/src/utils/agent-connection/files/core-strands/mcp/agentcore-mcp-client-strands.ts.template +1 -1
- package/src/utils/agent-core-constructs/agent-core-constructs.js +10 -3
- package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
- package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +3 -3
- package/src/utils/agent-core-constructs/files/cdk/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.ts.template +4 -4
- package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/agentcore-gateway.ts.template +1 -1
- package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +27 -0
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +60 -1
- package/src/utils/api-constructs/api-constructs.js +8 -2
- package/src/utils/api-constructs/api-constructs.js.map +1 -1
- package/src/utils/api-constructs/files/cdk/app/apis/http/__apiNameKebabCase__.ts.template +8 -8
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +8 -8
- package/src/utils/api-constructs/files/cdk/core/api/http/http-api.ts.template +3 -3
- package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account/index.js.template +32 -20
- package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account.ts.template +1 -1
- package/src/utils/api-constructs/files/cdk/core/api/rest/rest-api.ts.template +4 -4
- package/src/utils/api-constructs/files/cdk/core/api/trpc/trpc-utils.ts.template +1 -1
- package/src/utils/ast.js +16 -0
- package/src/utils/ast.js.map +1 -1
- package/src/utils/commands.d.ts +1 -1
- package/src/utils/commands.js +4 -1
- package/src/utils/commands.js.map +1 -1
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js +9 -2
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -1
- package/src/utils/dynamodb-constructs/files/cdk/app/dynamodb/__nameKebabCase__.ts.template +3 -3
- package/src/utils/dynamodb-constructs/files/cdk/core/dynamodb.ts.template +1 -1
- package/src/utils/files/common/constructs/src/core/index.ts.template +4 -4
- package/src/utils/files/common/constructs/src/index.ts.template +2 -2
- package/src/utils/files/common/infra-config/src/index.ts.template +3 -3
- package/src/utils/files/common/infra-config/src/resolve-stage.ts.template +2 -2
- package/src/utils/files/common/infra-config/src/stages.config.ts.template +1 -1
- package/src/utils/files/common/scripts/src/infra/infra-deploy.ts.template +1 -1
- package/src/utils/files/common/scripts/src/infra/infra-destroy.ts.template +1 -1
- package/src/utils/files/common/scripts/src/infra/stage-credentials/run.ts.template +3 -3
- package/src/utils/files/common/shadcn/src/index.ts.template +2 -2
- package/src/utils/function-constructs/files/cdk/app/lambda-functions/__nameKebabCase__.ts.template +1 -1
- package/src/utils/function-constructs/function-constructs.js +3 -1
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +2 -2
- package/src/utils/identity-constructs/identity-constructs.js +5 -1
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/module-format.d.ts +28 -0
- package/src/utils/module-format.js +28 -0
- package/src/utils/module-format.js.map +1 -0
- package/src/utils/rdb-constructs/files/cdk/app/dbs/__nameKebabCase__.ts.template +61 -17
- package/src/utils/rdb-constructs/files/cdk/core/rdb/aurora.ts.template +68 -78
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +88 -8
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +5 -32
- package/src/utils/rdb-constructs/rdb-constructs.d.ts +11 -1
- package/src/utils/rdb-constructs/rdb-constructs.js +9 -2
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/shared-constructs.js +12 -22
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/shared-infra-config.js +3 -1
- package/src/utils/shared-infra-config.js.map +1 -1
- package/src/utils/shared-infra-scripts.js +3 -1
- package/src/utils/shared-infra-scripts.js.map +1 -1
- package/src/utils/shared-rdb-scripts.js +5 -1
- package/src/utils/shared-rdb-scripts.js.map +1 -1
- package/src/utils/shared-shadcn.js +3 -1
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/test.d.ts +2 -0
- package/src/utils/test.js +7 -1
- package/src/utils/test.js.map +1 -1
- package/src/utils/versions.d.ts +73 -69
- package/src/utils/versions.js +71 -67
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/cdk/app/static-websites/__websiteNameKebabCase__.ts.template +2 -2
- package/src/utils/website-constructs/files/cdk/core/static-website.ts.template +2 -2
- package/src/utils/website-constructs/website-constructs.js +9 -2
- package/src/utils/website-constructs/website-constructs.js.map +1 -1
- package/src/utils/files/terraform/scripts/reset-runtime-config.ts.template +0 -25
|
@@ -23,6 +23,25 @@ variable "tags" {
|
|
|
23
23
|
default = {}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
# VPC Configuration (optional)
|
|
27
|
+
variable "enable_vpc" {
|
|
28
|
+
description = "Run the agent core runtime inside a VPC. Set alongside vpc_id/subnet_ids."
|
|
29
|
+
type = bool
|
|
30
|
+
default = false
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
variable "vpc_id" {
|
|
34
|
+
description = "VPC ID to run the agent core runtime in. Required when enable_vpc is true."
|
|
35
|
+
type = string
|
|
36
|
+
default = null
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
variable "subnet_ids" {
|
|
40
|
+
description = "Subnet IDs to run the agent core runtime in. Required when enable_vpc is true."
|
|
41
|
+
type = list(string)
|
|
42
|
+
default = null
|
|
43
|
+
}
|
|
44
|
+
|
|
26
45
|
variable "appconfig_application_id" {
|
|
27
46
|
description = "ID of the shared runtime-config AppConfig application (from \`core/runtime-config/appconfig.application_id\`). The agent reads its runtime configuration from this application."
|
|
28
47
|
type = string
|
|
@@ -38,6 +57,9 @@ module "agent_core_runtime" {
|
|
|
38
57
|
agent_runtime_name = "TerraformSnapshotAgent"
|
|
39
58
|
docker_image_tag = "proj-terraform-snapshot-agent:latest"
|
|
40
59
|
server_protocol = "HTTP"
|
|
60
|
+
enable_vpc = var.enable_vpc
|
|
61
|
+
vpc_id = var.vpc_id
|
|
62
|
+
subnet_ids = var.subnet_ids
|
|
41
63
|
|
|
42
64
|
env = merge({
|
|
43
65
|
RUNTIME_CONFIG_APP_ID = var.appconfig_application_id
|
|
@@ -92,6 +114,11 @@ output "appconfig_application_id" {
|
|
|
92
114
|
description = "AppConfig Application ID for runtime config (passthrough of the shared \`appconfig_application_id\` input)."
|
|
93
115
|
value = var.appconfig_application_id
|
|
94
116
|
}
|
|
117
|
+
|
|
118
|
+
output "security_group_id" {
|
|
119
|
+
description = "Security group ID of the agent core runtime, for use in ingress rules on resources it must reach (e.g. a database). Null unless enable_vpc is true."
|
|
120
|
+
value = module.agent_core_runtime.security_group_id
|
|
121
|
+
}
|
|
95
122
|
"
|
|
96
123
|
`;
|
|
97
124
|
|
|
@@ -102,7 +129,7 @@ exports[`py#agent generator > should match snapshot for Terraform generated file
|
|
|
102
129
|
required_providers {
|
|
103
130
|
aws = {
|
|
104
131
|
source = "hashicorp/aws"
|
|
105
|
-
version = "6.
|
|
132
|
+
version = "6.54.0"
|
|
106
133
|
}
|
|
107
134
|
null = {
|
|
108
135
|
source = "hashicorp/null"
|
|
@@ -168,6 +195,30 @@ variable "additional_iam_policy_statements" {
|
|
|
168
195
|
default = []
|
|
169
196
|
}
|
|
170
197
|
|
|
198
|
+
# VPC Configuration (optional)
|
|
199
|
+
variable "enable_vpc" {
|
|
200
|
+
description = "Run the agent core runtime inside a VPC. Set alongside vpc_id/subnet_ids."
|
|
201
|
+
type = bool
|
|
202
|
+
default = false
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
variable "vpc_id" {
|
|
206
|
+
description = "VPC ID to run the agent core runtime in. Required when enable_vpc is true."
|
|
207
|
+
type = string
|
|
208
|
+
default = null
|
|
209
|
+
|
|
210
|
+
validation {
|
|
211
|
+
condition = !var.enable_vpc || (var.vpc_id != null && var.subnet_ids != null)
|
|
212
|
+
error_message = "vpc_id and subnet_ids must be set when enable_vpc is true."
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
variable "subnet_ids" {
|
|
217
|
+
description = "Subnet IDs to run the agent core runtime in. Required when enable_vpc is true."
|
|
218
|
+
type = list(string)
|
|
219
|
+
default = null
|
|
220
|
+
}
|
|
221
|
+
|
|
171
222
|
variable "tags" {
|
|
172
223
|
description = "Tags to apply to resources"
|
|
173
224
|
type = map(string)
|
|
@@ -403,6 +454,28 @@ resource "null_resource" "docker_publish" {
|
|
|
403
454
|
depends_on = [aws_ecr_repository_policy.agent_core_ecr_policy]
|
|
404
455
|
}
|
|
405
456
|
|
|
457
|
+
# Security group for the agent core runtime, used when running inside a VPC
|
|
458
|
+
resource "aws_security_group" "agent_core_runtime" {
|
|
459
|
+
count = var.enable_vpc ? 1 : 0
|
|
460
|
+
|
|
461
|
+
#checkov:skip=CKV2_AWS_5:Attached to the runtime via network_configuration; Checkov cannot resolve this reference
|
|
462
|
+
name_prefix = "\${var.agent_runtime_name}-runtime-"
|
|
463
|
+
description = "Security group for the \${var.agent_runtime_name} agent core runtime"
|
|
464
|
+
vpc_id = var.vpc_id
|
|
465
|
+
tags = var.tags
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
resource "aws_vpc_security_group_egress_rule" "agent_core_runtime_https" {
|
|
469
|
+
count = var.enable_vpc ? 1 : 0
|
|
470
|
+
|
|
471
|
+
security_group_id = aws_security_group.agent_core_runtime[0].id
|
|
472
|
+
cidr_ipv4 = "0.0.0.0/0"
|
|
473
|
+
from_port = 443
|
|
474
|
+
to_port = 443
|
|
475
|
+
ip_protocol = "tcp"
|
|
476
|
+
description = "Allow outbound HTTPS to AWS service endpoints"
|
|
477
|
+
}
|
|
478
|
+
|
|
406
479
|
# Bedrock AgentCore Agent Runtime
|
|
407
480
|
resource "aws_bedrockagentcore_agent_runtime" "agent_runtime" {
|
|
408
481
|
agent_runtime_name = "\${var.agent_runtime_name}_\${random_id.unique_suffix.hex}"
|
|
@@ -429,7 +502,15 @@ resource "aws_bedrockagentcore_agent_runtime" "agent_runtime" {
|
|
|
429
502
|
}
|
|
430
503
|
|
|
431
504
|
network_configuration {
|
|
432
|
-
network_mode = "PUBLIC"
|
|
505
|
+
network_mode = var.enable_vpc ? "VPC" : "PUBLIC"
|
|
506
|
+
|
|
507
|
+
dynamic "network_mode_config" {
|
|
508
|
+
for_each = var.enable_vpc ? [1] : []
|
|
509
|
+
content {
|
|
510
|
+
security_groups = [aws_security_group.agent_core_runtime[0].id]
|
|
511
|
+
subnets = var.subnet_ids
|
|
512
|
+
}
|
|
513
|
+
}
|
|
433
514
|
}
|
|
434
515
|
|
|
435
516
|
protocol_configuration {
|
|
@@ -456,7 +537,7 @@ resource "null_resource" "runtime_ready" {
|
|
|
456
537
|
|
|
457
538
|
provisioner "local-exec" {
|
|
458
539
|
command = <<-EOT
|
|
459
|
-
uv run --with boto3==1.43.
|
|
540
|
+
uv run --with boto3==1.43.46 python -c "
|
|
460
541
|
import boto3
|
|
461
542
|
import json
|
|
462
543
|
import os
|
|
@@ -531,5 +612,10 @@ output "agent_runtime_version" {
|
|
|
531
612
|
description = "Version of the Bedrock Agent Core runtime"
|
|
532
613
|
value = aws_bedrockagentcore_agent_runtime.agent_runtime.agent_runtime_version
|
|
533
614
|
}
|
|
615
|
+
|
|
616
|
+
output "security_group_id" {
|
|
617
|
+
description = "Security group ID of the agent core runtime, for use in ingress rules on resources it must reach (e.g. a database). Null unless enable_vpc is true."
|
|
618
|
+
value = var.enable_vpc ? aws_security_group.agent_core_runtime[0].id : null
|
|
619
|
+
}
|
|
534
620
|
"
|
|
535
621
|
`;
|
|
@@ -35,7 +35,7 @@ exports[`py#dynamodb generator > should generate terraform modules when iac is t
|
|
|
35
35
|
required_providers {
|
|
36
36
|
aws = {
|
|
37
37
|
source = "hashicorp/aws"
|
|
38
|
-
version = "6.
|
|
38
|
+
version = "6.54.0"
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -192,7 +192,7 @@ exports[`py#dynamodb generator > should generate terraform modules when iac is t
|
|
|
192
192
|
required_providers {
|
|
193
193
|
aws = {
|
|
194
194
|
source = "hashicorp/aws"
|
|
195
|
-
version = "6.
|
|
195
|
+
version = "6.54.0"
|
|
196
196
|
}
|
|
197
197
|
random = {
|
|
198
198
|
source = "hashicorp/random"
|
|
@@ -11,7 +11,7 @@ terraform {
|
|
|
11
11
|
required_providers {
|
|
12
12
|
aws = {
|
|
13
13
|
source = "hashicorp/aws"
|
|
14
|
-
version = "6.
|
|
14
|
+
version = "6.54.0"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -258,7 +258,7 @@ output "api_log_group_arn" {
|
|
|
258
258
|
required_providers {
|
|
259
259
|
aws = {
|
|
260
260
|
source = "hashicorp/aws"
|
|
261
|
-
version = "6.
|
|
261
|
+
version = "6.54.0"
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
}
|
|
@@ -743,7 +743,7 @@ terraform {
|
|
|
743
743
|
required_providers {
|
|
744
744
|
aws = {
|
|
745
745
|
source = "hashicorp/aws"
|
|
746
|
-
version = "6.
|
|
746
|
+
version = "6.54.0"
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
749
|
}
|
|
@@ -990,7 +990,7 @@ output "api_log_group_arn" {
|
|
|
990
990
|
required_providers {
|
|
991
991
|
aws = {
|
|
992
992
|
source = "hashicorp/aws"
|
|
993
|
-
version = "6.
|
|
993
|
+
version = "6.54.0"
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
996
|
}
|
|
@@ -1547,7 +1547,7 @@ terraform {
|
|
|
1547
1547
|
required_providers {
|
|
1548
1548
|
aws = {
|
|
1549
1549
|
source = "hashicorp/aws"
|
|
1550
|
-
version = "6.
|
|
1550
|
+
version = "6.54.0"
|
|
1551
1551
|
}
|
|
1552
1552
|
}
|
|
1553
1553
|
}
|
|
@@ -1794,7 +1794,7 @@ output "api_log_group_arn" {
|
|
|
1794
1794
|
required_providers {
|
|
1795
1795
|
aws = {
|
|
1796
1796
|
source = "hashicorp/aws"
|
|
1797
|
-
version = "6.
|
|
1797
|
+
version = "6.54.0"
|
|
1798
1798
|
}
|
|
1799
1799
|
}
|
|
1800
1800
|
}
|
|
@@ -2256,7 +2256,7 @@ terraform {
|
|
|
2256
2256
|
required_providers {
|
|
2257
2257
|
aws = {
|
|
2258
2258
|
source = "hashicorp/aws"
|
|
2259
|
-
version = "6.
|
|
2259
|
+
version = "6.54.0"
|
|
2260
2260
|
}
|
|
2261
2261
|
random = {
|
|
2262
2262
|
source = "hashicorp/random"
|
|
@@ -2512,7 +2512,7 @@ output "waf_web_acl_arn" {
|
|
|
2512
2512
|
required_providers {
|
|
2513
2513
|
aws = {
|
|
2514
2514
|
source = "hashicorp/aws"
|
|
2515
|
-
version = "6.
|
|
2515
|
+
version = "6.54.0"
|
|
2516
2516
|
}
|
|
2517
2517
|
}
|
|
2518
2518
|
}
|
|
@@ -3234,7 +3234,7 @@ terraform {
|
|
|
3234
3234
|
required_providers {
|
|
3235
3235
|
aws = {
|
|
3236
3236
|
source = "hashicorp/aws"
|
|
3237
|
-
version = "6.
|
|
3237
|
+
version = "6.54.0"
|
|
3238
3238
|
}
|
|
3239
3239
|
random = {
|
|
3240
3240
|
source = "hashicorp/random"
|
|
@@ -3490,7 +3490,7 @@ output "waf_web_acl_arn" {
|
|
|
3490
3490
|
required_providers {
|
|
3491
3491
|
aws = {
|
|
3492
3492
|
source = "hashicorp/aws"
|
|
3493
|
-
version = "6.
|
|
3493
|
+
version = "6.54.0"
|
|
3494
3494
|
}
|
|
3495
3495
|
}
|
|
3496
3496
|
}
|
|
@@ -4201,7 +4201,7 @@ terraform {
|
|
|
4201
4201
|
required_providers {
|
|
4202
4202
|
aws = {
|
|
4203
4203
|
source = "hashicorp/aws"
|
|
4204
|
-
version = "6.
|
|
4204
|
+
version = "6.54.0"
|
|
4205
4205
|
}
|
|
4206
4206
|
random = {
|
|
4207
4207
|
source = "hashicorp/random"
|
|
@@ -4457,7 +4457,7 @@ output "waf_web_acl_arn" {
|
|
|
4457
4457
|
required_providers {
|
|
4458
4458
|
aws = {
|
|
4459
4459
|
source = "hashicorp/aws"
|
|
4460
|
-
version = "6.
|
|
4460
|
+
version = "6.54.0"
|
|
4461
4461
|
}
|
|
4462
4462
|
}
|
|
4463
4463
|
}
|
|
@@ -70,7 +70,7 @@ exports[`lambda-handler project generator > terraform iac > should generate terr
|
|
|
70
70
|
required_providers {
|
|
71
71
|
aws = {
|
|
72
72
|
source = "hashicorp/aws"
|
|
73
|
-
version = "6.
|
|
73
|
+
version = "6.54.0"
|
|
74
74
|
}
|
|
75
75
|
archive = {
|
|
76
76
|
source = "hashicorp/archive"
|
|
@@ -251,7 +251,7 @@ exports[`lambda-handler project generator > terraform iac > should match snapsho
|
|
|
251
251
|
required_providers {
|
|
252
252
|
aws = {
|
|
253
253
|
source = "hashicorp/aws"
|
|
254
|
-
version = "6.
|
|
254
|
+
version = "6.54.0"
|
|
255
255
|
}
|
|
256
256
|
archive = {
|
|
257
257
|
source = "hashicorp/archive"
|
|
@@ -135,7 +135,7 @@ exports[`py#mcp-server generator > should match snapshot for Terraform generated
|
|
|
135
135
|
required_providers {
|
|
136
136
|
aws = {
|
|
137
137
|
source = "hashicorp/aws"
|
|
138
|
-
version = "6.
|
|
138
|
+
version = "6.54.0"
|
|
139
139
|
}
|
|
140
140
|
null = {
|
|
141
141
|
source = "hashicorp/null"
|
|
@@ -201,6 +201,30 @@ variable "additional_iam_policy_statements" {
|
|
|
201
201
|
default = []
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
+
# VPC Configuration (optional)
|
|
205
|
+
variable "enable_vpc" {
|
|
206
|
+
description = "Run the agent core runtime inside a VPC. Set alongside vpc_id/subnet_ids."
|
|
207
|
+
type = bool
|
|
208
|
+
default = false
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
variable "vpc_id" {
|
|
212
|
+
description = "VPC ID to run the agent core runtime in. Required when enable_vpc is true."
|
|
213
|
+
type = string
|
|
214
|
+
default = null
|
|
215
|
+
|
|
216
|
+
validation {
|
|
217
|
+
condition = !var.enable_vpc || (var.vpc_id != null && var.subnet_ids != null)
|
|
218
|
+
error_message = "vpc_id and subnet_ids must be set when enable_vpc is true."
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
variable "subnet_ids" {
|
|
223
|
+
description = "Subnet IDs to run the agent core runtime in. Required when enable_vpc is true."
|
|
224
|
+
type = list(string)
|
|
225
|
+
default = null
|
|
226
|
+
}
|
|
227
|
+
|
|
204
228
|
variable "tags" {
|
|
205
229
|
description = "Tags to apply to resources"
|
|
206
230
|
type = map(string)
|
|
@@ -436,6 +460,28 @@ resource "null_resource" "docker_publish" {
|
|
|
436
460
|
depends_on = [aws_ecr_repository_policy.agent_core_ecr_policy]
|
|
437
461
|
}
|
|
438
462
|
|
|
463
|
+
# Security group for the agent core runtime, used when running inside a VPC
|
|
464
|
+
resource "aws_security_group" "agent_core_runtime" {
|
|
465
|
+
count = var.enable_vpc ? 1 : 0
|
|
466
|
+
|
|
467
|
+
#checkov:skip=CKV2_AWS_5:Attached to the runtime via network_configuration; Checkov cannot resolve this reference
|
|
468
|
+
name_prefix = "\${var.agent_runtime_name}-runtime-"
|
|
469
|
+
description = "Security group for the \${var.agent_runtime_name} agent core runtime"
|
|
470
|
+
vpc_id = var.vpc_id
|
|
471
|
+
tags = var.tags
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
resource "aws_vpc_security_group_egress_rule" "agent_core_runtime_https" {
|
|
475
|
+
count = var.enable_vpc ? 1 : 0
|
|
476
|
+
|
|
477
|
+
security_group_id = aws_security_group.agent_core_runtime[0].id
|
|
478
|
+
cidr_ipv4 = "0.0.0.0/0"
|
|
479
|
+
from_port = 443
|
|
480
|
+
to_port = 443
|
|
481
|
+
ip_protocol = "tcp"
|
|
482
|
+
description = "Allow outbound HTTPS to AWS service endpoints"
|
|
483
|
+
}
|
|
484
|
+
|
|
439
485
|
# Bedrock AgentCore Agent Runtime
|
|
440
486
|
resource "aws_bedrockagentcore_agent_runtime" "agent_runtime" {
|
|
441
487
|
agent_runtime_name = "\${var.agent_runtime_name}_\${random_id.unique_suffix.hex}"
|
|
@@ -462,7 +508,15 @@ resource "aws_bedrockagentcore_agent_runtime" "agent_runtime" {
|
|
|
462
508
|
}
|
|
463
509
|
|
|
464
510
|
network_configuration {
|
|
465
|
-
network_mode = "PUBLIC"
|
|
511
|
+
network_mode = var.enable_vpc ? "VPC" : "PUBLIC"
|
|
512
|
+
|
|
513
|
+
dynamic "network_mode_config" {
|
|
514
|
+
for_each = var.enable_vpc ? [1] : []
|
|
515
|
+
content {
|
|
516
|
+
security_groups = [aws_security_group.agent_core_runtime[0].id]
|
|
517
|
+
subnets = var.subnet_ids
|
|
518
|
+
}
|
|
519
|
+
}
|
|
466
520
|
}
|
|
467
521
|
|
|
468
522
|
protocol_configuration {
|
|
@@ -489,7 +543,7 @@ resource "null_resource" "runtime_ready" {
|
|
|
489
543
|
|
|
490
544
|
provisioner "local-exec" {
|
|
491
545
|
command = <<-EOT
|
|
492
|
-
uv run --with boto3==1.43.
|
|
546
|
+
uv run --with boto3==1.43.46 python -c "
|
|
493
547
|
import boto3
|
|
494
548
|
import json
|
|
495
549
|
import os
|
|
@@ -564,6 +618,11 @@ output "agent_runtime_version" {
|
|
|
564
618
|
description = "Version of the Bedrock Agent Core runtime"
|
|
565
619
|
value = aws_bedrockagentcore_agent_runtime.agent_runtime.agent_runtime_version
|
|
566
620
|
}
|
|
621
|
+
|
|
622
|
+
output "security_group_id" {
|
|
623
|
+
description = "Security group ID of the agent core runtime, for use in ingress rules on resources it must reach (e.g. a database). Null unless enable_vpc is true."
|
|
624
|
+
value = var.enable_vpc ? aws_security_group.agent_core_runtime[0].id : null
|
|
625
|
+
}
|
|
567
626
|
"
|
|
568
627
|
`;
|
|
569
628
|
|
|
@@ -590,6 +649,25 @@ variable "tags" {
|
|
|
590
649
|
default = {}
|
|
591
650
|
}
|
|
592
651
|
|
|
652
|
+
# VPC Configuration (optional)
|
|
653
|
+
variable "enable_vpc" {
|
|
654
|
+
description = "Run the agent core runtime inside a VPC. Set alongside vpc_id/subnet_ids."
|
|
655
|
+
type = bool
|
|
656
|
+
default = false
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
variable "vpc_id" {
|
|
660
|
+
description = "VPC ID to run the agent core runtime in. Required when enable_vpc is true."
|
|
661
|
+
type = string
|
|
662
|
+
default = null
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
variable "subnet_ids" {
|
|
666
|
+
description = "Subnet IDs to run the agent core runtime in. Required when enable_vpc is true."
|
|
667
|
+
type = list(string)
|
|
668
|
+
default = null
|
|
669
|
+
}
|
|
670
|
+
|
|
593
671
|
variable "appconfig_application_id" {
|
|
594
672
|
description = "ID of the shared runtime-config AppConfig application (from \`core/runtime-config/appconfig.application_id\`). The agent reads its runtime configuration from this application."
|
|
595
673
|
type = string
|
|
@@ -605,6 +683,9 @@ module "agent_core_runtime" {
|
|
|
605
683
|
agent_runtime_name = "TerraformSnapshotServer"
|
|
606
684
|
docker_image_tag = "proj-terraform-snapshot-server:latest"
|
|
607
685
|
server_protocol = "MCP"
|
|
686
|
+
enable_vpc = var.enable_vpc
|
|
687
|
+
vpc_id = var.vpc_id
|
|
688
|
+
subnet_ids = var.subnet_ids
|
|
608
689
|
|
|
609
690
|
env = merge({
|
|
610
691
|
RUNTIME_CONFIG_APP_ID = var.appconfig_application_id
|
|
@@ -647,6 +728,11 @@ output "appconfig_application_id" {
|
|
|
647
728
|
description = "AppConfig Application ID for runtime config (passthrough of the shared \`appconfig_application_id\` input)."
|
|
648
729
|
value = var.appconfig_application_id
|
|
649
730
|
}
|
|
731
|
+
|
|
732
|
+
output "security_group_id" {
|
|
733
|
+
description = "Security group ID of the agent core runtime, for use in ingress rules on resources it must reach (e.g. a database). Null unless enable_vpc is true."
|
|
734
|
+
value = module.agent_core_runtime.security_group_id
|
|
735
|
+
}
|
|
650
736
|
"
|
|
651
737
|
`;
|
|
652
738
|
|
|
@@ -718,8 +804,8 @@ version = "0.1.0"
|
|
|
718
804
|
dependencies = [
|
|
719
805
|
"aws-lambda-powertools==3.31.0",
|
|
720
806
|
"mcp==1.28.1",
|
|
721
|
-
"uvicorn==0.
|
|
722
|
-
"boto3==1.43.
|
|
807
|
+
"uvicorn==0.51.0",
|
|
808
|
+
"boto3==1.43.46",
|
|
723
809
|
"aws-opentelemetry-distro==0.18.0"
|
|
724
810
|
]
|
|
725
811
|
|