@aws/nx-plugin 0.121.0 → 1.0.0-rc.1
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/generators.json +47 -6
- package/package.json +1 -1
- package/src/connection/generator.js +2 -2
- package/src/connection/generator.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +11 -11
- package/src/infra/app/files/app/src/main.ts.template +2 -2
- package/src/infra/app/generator.js +9 -9
- package/src/infra/app/generator.js.map +1 -1
- package/src/infra/app/schema.d.ts +1 -1
- package/src/infra/app/schema.json +1 -1
- package/src/mcp-server/guide-pipeline.js +8 -10
- package/src/mcp-server/guide-pipeline.js.map +1 -1
- package/src/mcp-server/tools/create-workspace-command.js +1 -1
- package/src/mcp-server/tools/create-workspace-command.js.map +1 -1
- package/src/mcp-server/tools/generator-guide.js +2 -2
- package/src/mcp-server/tools/generator-guide.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +6 -8
- package/src/preset/generator.d.ts +1 -1
- package/src/preset/generator.js +4 -6
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.ts +5 -5
- package/src/preset/schema.json +4 -4
- package/src/py/agent/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/py/agent/a2a-connection/generator.js +4 -3
- package/src/py/agent/a2a-connection/generator.js.map +1 -1
- package/src/py/agent/files/deploy/Dockerfile.template +3 -3
- package/src/py/agent/generator.js +23 -23
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/generator.js +1 -1
- package/src/py/agent/mcp-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/py/agent/react-connection/generator.js +4 -4
- package/src/py/agent/react-connection/generator.js.map +1 -1
- package/src/py/agent/schema.d.ts +8 -8
- package/src/py/agent/schema.json +18 -18
- package/src/py/api/generator.d.ts +10 -0
- package/src/py/api/generator.js +25 -0
- package/src/py/api/generator.js.map +1 -0
- package/src/py/api/schema.d.ts +17 -0
- package/src/py/api/schema.json +100 -0
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/py/fast-api/generator.js +10 -10
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/react/generator.js +1 -1
- package/src/py/fast-api/react/generator.js.map +1 -1
- package/src/py/fast-api/schema.d.ts +4 -6
- package/src/py/fast-api/schema.json +15 -15
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/py/lambda-function/files/handler/__lambdaFunctionSnakeCase__.py.template +6 -6
- package/src/py/lambda-function/generator.js +9 -9
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/lambda-function/schema.d.ts +4 -4
- package/src/py/lambda-function/schema.json +7 -7
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/py/mcp-server/generator.js +11 -11
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/mcp-server/schema.d.ts +5 -9
- package/src/py/mcp-server/schema.json +15 -15
- package/src/py/project/generator.js +1 -1
- package/src/py/project/generator.js.map +1 -1
- package/src/py/project/schema.d.ts +1 -1
- package/src/py/project/schema.json +2 -2
- package/src/smithy/project/generator.js +2 -2
- package/src/smithy/project/generator.js.map +1 -1
- package/src/smithy/react-connection/generator.js +1 -1
- package/src/smithy/react-connection/generator.js.map +1 -1
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/smithy/ts/api/generator.js +8 -8
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/smithy/ts/api/schema.d.ts +4 -6
- package/src/smithy/ts/api/schema.json +15 -15
- package/src/terraform/project/generator.js +1 -1
- package/src/terraform/project/generator.js.map +1 -1
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/trpc/backend/files/src/client/index.ts.template +5 -5
- package/src/trpc/backend/files/src/handler.ts.template +2 -2
- package/src/trpc/backend/generator.js +22 -22
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.ts +4 -4
- package/src/trpc/backend/schema.json +15 -15
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/trpc/react/files/src/components/__apiNameClassName__ClientProvider.tsx.template +14 -14
- package/src/trpc/react/generator.js +6 -5
- package/src/trpc/react/generator.js.map +1 -1
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/agent/a2a-connection/generator.js +4 -3
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/files/deploy/Dockerfile.template +1 -1
- package/src/ts/agent/generator.js +22 -22
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/generator.js +1 -1
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/files/src/components/__agentNameClassName__AgentClientProvider.tsx.template +8 -8
- package/src/ts/agent/react-connection/generator.js +6 -6
- package/src/ts/agent/react-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/serve-local.js +2 -2
- package/src/ts/agent/schema.d.ts +8 -8
- package/src/ts/agent/schema.json +18 -18
- package/src/ts/api/generator.d.ts +10 -0
- package/src/ts/api/generator.js +36 -0
- package/src/ts/api/generator.js.map +1 -0
- package/src/ts/api/schema.d.ts +18 -0
- package/src/ts/api/schema.json +105 -0
- package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +1 -0
- package/src/ts/astro-docs/generator.js +1 -0
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/docs/generator.d.ts +10 -0
- package/src/ts/docs/generator.js +13 -0
- package/src/ts/docs/generator.js.map +1 -0
- package/src/ts/docs/schema.d.ts +34 -0
- package/src/ts/docs/schema.json +70 -0
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/lambda-function/files/handler/__lambdaFunctionKebabCase__.ts.template +10 -10
- package/src/ts/lambda-function/generator.js +12 -12
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lambda-function/schema.d.ts +4 -4
- package/src/ts/lambda-function/schema.json +7 -7
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/mcp-server/generator.js +12 -12
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/mcp-server/schema.d.ts +5 -9
- package/src/ts/mcp-server/schema.json +15 -15
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.spec.ts.template +1 -1
- package/src/ts/nx-plugin/generator.js +2 -2
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/rdb/files/prisma.config.ts.template +1 -1
- package/src/ts/rdb/files/scripts/docker-pull.ts.template +1 -1
- package/src/ts/rdb/files/scripts/docker-start.ts.template +3 -3
- package/src/ts/rdb/files/scripts/wait-for-db.ts.template +3 -3
- package/src/ts/rdb/files/src/create-db-user-handler.ts.template +2 -2
- package/src/ts/rdb/files/src/migration-handler.ts.template +2 -2
- package/src/ts/rdb/files/src/prisma.ts.template +2 -2
- package/src/ts/rdb/generator.js +18 -18
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/schema.d.ts +5 -5
- package/src/ts/rdb/schema.json +13 -13
- package/src/ts/rdb/trpc-connection/files/src/middleware/__rdbNameKebab__.ts.template +1 -1
- package/src/ts/react-website/agui/files/common/src/hooks/useAgui__agentNameClassName__.tsx.template +9 -9
- package/src/ts/react-website/agui/generator.d.ts +2 -2
- package/src/ts/react-website/agui/generator.js +9 -9
- package/src/ts/react-website/agui/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +25 -23
- package/src/ts/react-website/app/files/app/cloudscape/src/components/AppLayout/index.tsx.template +5 -5
- package/src/ts/react-website/app/files/app/cloudscape/src/main.tsx.template +1 -1
- package/src/ts/react-website/app/files/app/cloudscape/src/styles.css.template +1 -1
- package/src/ts/react-website/app/files/app/none/src/components/AppLayout/index.tsx.template +5 -5
- package/src/ts/react-website/app/files/app/none/src/main.tsx.template +1 -1
- package/src/ts/react-website/app/files/app/none/src/styles.css.template +2 -2
- package/src/ts/react-website/app/files/app/shadcn/src/components/AppLayout/index.tsx.template +6 -6
- package/src/ts/react-website/app/files/app/shadcn/src/main.tsx.template +1 -1
- package/src/ts/react-website/app/generator.d.ts +3 -3
- package/src/ts/react-website/app/generator.js +28 -27
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/app/schema.d.ts +6 -6
- package/src/ts/react-website/app/schema.json +13 -13
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +3 -3
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.ux-provider.spec.ts.snap +3 -3
- package/src/ts/react-website/cognito-auth/generator.js +9 -9
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/schema.d.ts +2 -2
- package/src/ts/react-website/cognito-auth/schema.json +4 -4
- package/src/ts/website/app/generator.d.ts +10 -0
- package/src/ts/website/app/generator.js +13 -0
- package/src/ts/website/app/generator.js.map +1 -0
- package/src/ts/website/app/schema.d.ts +20 -0
- package/src/ts/website/app/schema.json +97 -0
- package/src/ts/website/auth/generator.d.ts +10 -0
- package/src/ts/website/auth/generator.js +17 -0
- package/src/ts/website/auth/generator.js.map +1 -0
- package/src/ts/website/auth/schema.d.ts +12 -0
- package/src/ts/website/auth/schema.json +46 -0
- package/src/utils/agent-connection/agent-connection.js +1 -1
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +9 -9
- package/src/utils/agent-core-constructs/agent-core-constructs.js +11 -13
- 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 +13 -13
- package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +4 -4
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +5 -5
- package/src/utils/api-constructs/api-constructs.d.ts +3 -3
- package/src/utils/api-constructs/api-constructs.js +4 -6
- package/src/utils/api-constructs/api-constructs.js.map +1 -1
- package/src/utils/api-constructs/files/cdk/app/apis/http/__apiNameKebabCase__.ts.template +12 -12
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +12 -12
- package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +7 -7
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +10 -10
- package/src/utils/api-constructs/open-api-metadata.d.ts +3 -3
- package/src/utils/api-constructs/open-api-metadata.js +2 -2
- package/src/utils/api-constructs/open-api-metadata.js.map +1 -1
- package/src/utils/commands.d.ts +1 -1
- package/src/utils/commands.js +2 -2
- package/src/utils/commands.js.map +1 -1
- package/src/utils/config/__snapshots__/utils.spec.ts.snap +6 -6
- package/src/utils/config/index.d.ts +2 -2
- package/src/utils/connection/open-api/files/components/__apiNameClassName__Provider.tsx.template +7 -7
- package/src/utils/connection/open-api/react.d.ts +1 -1
- package/src/utils/connection/open-api/react.js +3 -3
- package/src/utils/containers.d.ts +5 -5
- package/src/utils/containers.js +6 -6
- package/src/utils/containers.js.map +1 -1
- package/src/utils/function-constructs/files/cdk/app/lambda-functions/{__functionNameKebabCase__.ts.template → __nameKebabCase__.ts.template} +1 -1
- package/src/utils/function-constructs/files/terraform/app/lambda-functions/{__functionNameKebabCase__/__functionNameKebabCase__.tf.template → __nameKebabCase__/__nameKebabCase__.tf.template} +7 -7
- package/src/utils/function-constructs/function-constructs.d.ts +4 -4
- package/src/utils/function-constructs/function-constructs.js +5 -7
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/iac-providers.d.ts +3 -3
- package/src/utils/iac-providers.js +1 -1
- package/src/utils/iac.d.ts +2 -2
- package/src/utils/iac.js +6 -6
- package/src/utils/iac.js.map +1 -1
- package/src/utils/identity-constructs/identity-constructs.d.ts +2 -2
- package/src/utils/identity-constructs/identity-constructs.js +3 -3
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +4 -4
- package/src/utils/rdb-constructs/rdb-constructs.d.ts +4 -4
- package/src/utils/rdb-constructs/rdb-constructs.js +4 -6
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/shared-constructs.d.ts +2 -2
- package/src/utils/shared-constructs.js +3 -3
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/website-constructs/website-constructs.d.ts +2 -2
- package/src/utils/website-constructs/website-constructs.js +4 -6
- package/src/utils/website-constructs/website-constructs.js.map +1 -1
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"x-prompt": "Enable self signup?",
|
|
38
38
|
"x-priority": "important"
|
|
39
39
|
},
|
|
40
|
-
"
|
|
40
|
+
"iac": {
|
|
41
41
|
"type": "string",
|
|
42
42
|
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
43
|
-
"enum": ["
|
|
43
|
+
"enum": ["inherit", "cdk", "terraform"],
|
|
44
44
|
"x-priority": "important",
|
|
45
|
-
"default": "
|
|
46
|
-
"x-prompt": "Which provider would you like to manage your infrastructure? (default:
|
|
45
|
+
"default": "inherit",
|
|
46
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"required": ["project"]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
6
|
+
import { TsWebsiteGeneratorSchema } from './schema';
|
|
7
|
+
import { NxGeneratorInfo } from '../../../utils/nx';
|
|
8
|
+
export declare const TS_WEBSITE_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
|
+
export declare const tsWebsiteGenerator: (tree: Tree, schema: TsWebsiteGeneratorSchema) => Promise<GeneratorCallback>;
|
|
10
|
+
export default tsWebsiteGenerator;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tsWebsiteGenerator = exports.TS_WEBSITE_GENERATOR_INFO = void 0;
|
|
4
|
+
const generator_1 = require("../../react-website/app/generator");
|
|
5
|
+
const nx_1 = require("../../../utils/nx");
|
|
6
|
+
exports.TS_WEBSITE_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
7
|
+
const tsWebsiteGenerator = async (tree, schema) => {
|
|
8
|
+
const { framework: _framework, ...rest } = schema;
|
|
9
|
+
return (0, generator_1.tsReactWebsiteGenerator)(tree, rest);
|
|
10
|
+
};
|
|
11
|
+
exports.tsWebsiteGenerator = tsWebsiteGenerator;
|
|
12
|
+
exports.default = exports.tsWebsiteGenerator;
|
|
13
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/website/app/generator.ts"],"names":[],"mappings":";;;AAMA,iEAA4E;AAC5E,0CAAsE;AAEzD,QAAA,yBAAyB,GACpC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,kBAAkB,GAAG,KAAK,EACrC,IAAU,EACV,MAAgC,EACJ,EAAE;IAC9B,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;IAClD,OAAO,IAAA,mCAAuB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC7C,CAAC,CAAC;AANW,QAAA,kBAAkB,sBAM7B;AAEF,kBAAe,0BAAkB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { IacOption } from '../../../utils/iac';
|
|
6
|
+
import { UxOption } from '../../react-website/app/generator';
|
|
7
|
+
|
|
8
|
+
export type WebsiteFramework = 'react';
|
|
9
|
+
|
|
10
|
+
export interface TsWebsiteGeneratorSchema {
|
|
11
|
+
name: string;
|
|
12
|
+
framework?: WebsiteFramework;
|
|
13
|
+
directory?: string;
|
|
14
|
+
subDirectory?: string;
|
|
15
|
+
skipInstall?: boolean;
|
|
16
|
+
tanstackRouter?: boolean;
|
|
17
|
+
tailwind?: boolean;
|
|
18
|
+
ux?: UxOption;
|
|
19
|
+
iac: IacOption;
|
|
20
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "Website",
|
|
5
|
+
"title": "Create a Website",
|
|
6
|
+
"description": "Create a website application for Nx.",
|
|
7
|
+
"examples": [
|
|
8
|
+
{
|
|
9
|
+
"command": "nx g app myapp --directory=myorg",
|
|
10
|
+
"description": "Generate `apps/myorg/myapp` and `apps/myorg/myapp-e2e`"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"type": "object",
|
|
14
|
+
"properties": {
|
|
15
|
+
"name": {
|
|
16
|
+
"description": "The name of the application.",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"$default": {
|
|
19
|
+
"$source": "argv",
|
|
20
|
+
"index": 0
|
|
21
|
+
},
|
|
22
|
+
"x-prompt": "What name would you like to use for the application?",
|
|
23
|
+
"pattern": "^[a-zA-Z][^:]*$"
|
|
24
|
+
},
|
|
25
|
+
"framework": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "The frontend framework to use.",
|
|
28
|
+
"enum": ["react"],
|
|
29
|
+
"default": "react",
|
|
30
|
+
"x-priority": "important",
|
|
31
|
+
"x-prompt": "Which frontend framework would you like to use?"
|
|
32
|
+
},
|
|
33
|
+
"directory": {
|
|
34
|
+
"description": "The directory of the new application.",
|
|
35
|
+
"type": "string",
|
|
36
|
+
"alias": "dir",
|
|
37
|
+
"x-priority": "important",
|
|
38
|
+
"default": "packages",
|
|
39
|
+
"x-prompt": "What directory would you like to store your application in?"
|
|
40
|
+
},
|
|
41
|
+
"subDirectory": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "The sub directory the project is placed in. By default this is the project name.",
|
|
44
|
+
"x-prompt": "Which sub directory do you want to create the project in? (By default this is the project name)"
|
|
45
|
+
},
|
|
46
|
+
"ux": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"description": "The preferred UX provider.",
|
|
49
|
+
"enum": ["none", "cloudscape", "shadcn"],
|
|
50
|
+
"x-priority": "important",
|
|
51
|
+
"default": "cloudscape",
|
|
52
|
+
"x-prompt": {
|
|
53
|
+
"message": "Which UX provider should we scaffold for this app?",
|
|
54
|
+
"type": "list",
|
|
55
|
+
"items": [
|
|
56
|
+
{
|
|
57
|
+
"value": "none",
|
|
58
|
+
"label": "None (plain React/Vite without a UI kit)"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"value": "cloudscape",
|
|
62
|
+
"label": "Cloudscape (AWS-first components with ready-made layouts)"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"value": "shadcn",
|
|
66
|
+
"label": "Shadcn (shared UI library under packages/common/shadcn)"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"default": "cloudscape"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"tailwind": {
|
|
73
|
+
"description": "Enable TailwindCSS for utility-first styling.",
|
|
74
|
+
"type": "boolean",
|
|
75
|
+
"default": true,
|
|
76
|
+
"x-priority": "important",
|
|
77
|
+
"x-prompt": "Would you like to enable TailwindCSS for additional styling capabilities?"
|
|
78
|
+
},
|
|
79
|
+
"tanstackRouter": {
|
|
80
|
+
"description": "Enable Tanstack router for type-safe routing.",
|
|
81
|
+
"type": "boolean",
|
|
82
|
+
"default": true,
|
|
83
|
+
"x-priority": "important",
|
|
84
|
+
"x-prompt": "Would you like to enable Tanstack Router for type-safe routing?"
|
|
85
|
+
},
|
|
86
|
+
"iac": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
89
|
+
"enum": ["inherit", "cdk", "terraform"],
|
|
90
|
+
"x-priority": "important",
|
|
91
|
+
"default": "inherit",
|
|
92
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"required": ["name"],
|
|
96
|
+
"examplesFile": "../../../docs/application-examples.md"
|
|
97
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { Tree } from '@nx/devkit';
|
|
6
|
+
import { TsWebsiteAuthGeneratorSchema } from './schema';
|
|
7
|
+
import { NxGeneratorInfo } from '../../../utils/nx';
|
|
8
|
+
export declare const TS_WEBSITE_AUTH_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
|
+
export declare function tsWebsiteAuthGenerator(tree: Tree, schema: TsWebsiteAuthGeneratorSchema): Promise<() => void>;
|
|
10
|
+
export default tsWebsiteAuthGenerator;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TS_WEBSITE_AUTH_GENERATOR_INFO = void 0;
|
|
4
|
+
exports.tsWebsiteAuthGenerator = tsWebsiteAuthGenerator;
|
|
5
|
+
const generator_1 = require("../../react-website/cognito-auth/generator");
|
|
6
|
+
const nx_1 = require("../../../utils/nx");
|
|
7
|
+
exports.TS_WEBSITE_AUTH_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
8
|
+
async function tsWebsiteAuthGenerator(tree, schema) {
|
|
9
|
+
return (0, generator_1.tsReactWebsiteAuthGenerator)(tree, {
|
|
10
|
+
project: schema.project,
|
|
11
|
+
allowSignup: schema.allowSignup,
|
|
12
|
+
cognitoDomain: schema.cognitoDomain,
|
|
13
|
+
iac: schema.iac,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
exports.default = tsWebsiteAuthGenerator;
|
|
17
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/website/auth/generator.ts"],"names":[],"mappings":";;;AAYA,wDAUC;AAhBD,0EAAyF;AACzF,0CAAsE;AAEzD,QAAA,8BAA8B,GACzC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,KAAK,UAAU,sBAAsB,CAC1C,IAAU,EACV,MAAoC;IAEpC,OAAO,IAAA,uCAA2B,EAAC,IAAI,EAAE;QACvC,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,GAAG,EAAE,MAAM,CAAC,GAAG;KAChB,CAAC,CAAC;AACL,CAAC;AAED,kBAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { IacOption } from '../../../utils/iac';
|
|
6
|
+
|
|
7
|
+
export interface TsWebsiteAuthGeneratorSchema {
|
|
8
|
+
project: string;
|
|
9
|
+
allowSignup: boolean;
|
|
10
|
+
cognitoDomain?: string;
|
|
11
|
+
iac: IacOption;
|
|
12
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "Website Auth",
|
|
5
|
+
"title": "Website Auth",
|
|
6
|
+
"description": "Adds auth to an existing website.",
|
|
7
|
+
"examples": [
|
|
8
|
+
{
|
|
9
|
+
"command": "nx g @aws/nx-plugin:ts#website#auth --project=my-website",
|
|
10
|
+
"description": "Add Cognito auth to an existing website"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"type": "object",
|
|
14
|
+
"properties": {
|
|
15
|
+
"project": {
|
|
16
|
+
"description": "The root directory of the website.",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"alias": "dir",
|
|
19
|
+
"x-priority": "important",
|
|
20
|
+
"x-prompt": "the root directory for your website.",
|
|
21
|
+
"x-dropdown": "projects"
|
|
22
|
+
},
|
|
23
|
+
"cognitoDomain": {
|
|
24
|
+
"description": "The cognito domain prefix to use. If omitted, a value is derived from the npm scope and website project name.",
|
|
25
|
+
"type": "string",
|
|
26
|
+
"x-priority": "important",
|
|
27
|
+
"x-prompt": "the cognito domain prefix to use i.e: https://{{cognitoDomain}}-123456789.auth.ap-southeast-2.amazoncognito.com (leave blank to derive from scope and project name)"
|
|
28
|
+
},
|
|
29
|
+
"allowSignup": {
|
|
30
|
+
"description": "Whether to allow self-signup",
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"default": false,
|
|
33
|
+
"x-prompt": "Enable self signup?",
|
|
34
|
+
"x-priority": "important"
|
|
35
|
+
},
|
|
36
|
+
"iac": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
39
|
+
"enum": ["inherit", "cdk", "terraform"],
|
|
40
|
+
"x-priority": "important",
|
|
41
|
+
"default": "inherit",
|
|
42
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": ["project"]
|
|
46
|
+
}
|
|
@@ -115,7 +115,7 @@ async function ensurePythonAgentConnectionProject(tree) {
|
|
|
115
115
|
await (0, generator_2.default)(tree, {
|
|
116
116
|
name: PY_AGENT_CONNECTION_NAME,
|
|
117
117
|
directory: (0, devkit_1.joinPathFragments)(PACKAGES_DIR, COMMON_DIR),
|
|
118
|
-
|
|
118
|
+
type: 'library',
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
const moduleDir = (0, devkit_1.joinPathFragments)(projectDir, moduleName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-connection.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/utils/agent-connection/agent-connection.ts"],"names":[],"mappings":";;;AAmCA,gFAMC;AAKD,gFAMC;AAKD,kFAMC;AAwBD,wFAqCC;AAOD,0DAWC;AAOD,gFAiEC;AAMD,kDAcC;AAQD,8CAqEC;;AAvTD;;;GAGG;AACH,uCAKoB;AACpB,+EAAwD;AACxD,gFAEoC;AACpC,8BAAuD;AACvD,gCAAiE;AAEjE,qDAAqD;AACrD,MAAM,EAAE,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,oBAAoB,OAAO,EAAE,CAAC;AAE9D,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAChD,MAAM,YAAY,GAAG,UAAU,CAAC;AAChC,MAAM,UAAU,GAAG,QAAQ,CAAC;AAEf,QAAA,4BAA4B,GAAG,IAAA,0BAAiB,EAC3D,YAAY,EACZ,UAAU,EACV,oBAAoB,CACrB,CAAC;AAEF,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAEpD;;GAEG;AACH,SAAgB,kCAAkC,CAAC,IAAU;IAC3D,MAAM,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AEtE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC;QAClC,oEAAoE;QACpE,MAAM,IAAA,mBAAkB,EAAC,IAAI,EAAE;YAC7B,IAAI,EAAE,wBAAwB;YAC9B,SAAS,EAAE,IAAA,0BAAiB,EAAC,YAAY,EAAE,UAAU,CAAC;YACtD,
|
|
1
|
+
{"version":3,"file":"agent-connection.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/utils/agent-connection/agent-connection.ts"],"names":[],"mappings":";;;AAmCA,gFAMC;AAKD,gFAMC;AAKD,kFAMC;AAwBD,wFAqCC;AAOD,0DAWC;AAOD,gFAiEC;AAMD,kDAcC;AAQD,8CAqEC;;AAvTD;;;GAGG;AACH,uCAKoB;AACpB,+EAAwD;AACxD,gFAEoC;AACpC,8BAAuD;AACvD,gCAAiE;AAEjE,qDAAqD;AACrD,MAAM,EAAE,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,oBAAoB,OAAO,EAAE,CAAC;AAE9D,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAChD,MAAM,YAAY,GAAG,UAAU,CAAC;AAChC,MAAM,UAAU,GAAG,QAAQ,CAAC;AAEf,QAAA,4BAA4B,GAAG,IAAA,0BAAiB,EAC3D,YAAY,EACZ,UAAU,EACV,oBAAoB,CACrB,CAAC;AAEF,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAEpD;;GAEG;AACH,SAAgB,kCAAkC,CAAC,IAAU;IAC3D,MAAM,EAAE,GAAG,EAAE,GAAG,IAAA,+BAAmB,EAAC,IAAI,EAAE;QACxC,IAAI,EAAE,wBAAwB;QAC9B,SAAS,EAAE,IAAA,0BAAiB,EAAC,YAAY,EAAE,UAAU,CAAC;KACvD,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;GAEG;AACH,SAAgB,kCAAkC,CAAC,IAAU;IAC3D,MAAM,EAAE,oBAAoB,EAAE,GAAG,IAAA,+BAAm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AAc,GAAG,MAAM,IAAA,iBAAW,EACtC,IAAI,EACJ,YAAY,EACZ,EAAE,CACA;+BACyB,UAAU;iBACxB,UAAU;EACzB,CACG,CACF,CAAC;IAEF,IAAI,cAAc,EAAE,CAAC;QACnB,kCAAkC;QAClC,MAAM,IAAA,iBAAW,EACf,IAAI,EACJ,YAAY,EACZ,EAAE,CAAC,gDAAgD,QAAQ,MAAM,CAAC,CACnE,CAAC;QACF,OAAO;IACT,CAAC;IAED,wEAAwE;IACxE,MAAM,cAAc,GAAG,MAAM,IAAA,iBAAW,EACtC,IAAI,EACJ,YAAY,EACZ,EAAE,CACA,+DAA+D,UAAU,kBAAkB,QAAQ,KAAK,CACzG,CACF,CAAC;IAEF,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,yDAAyD;QACzD,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,GAAG,UAAU,kBAAkB,QAAQ,KAAK,CAAC,CAAC;IACzE,CAAC;AACH,CAAC"}
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { Tree } from '@nx/devkit';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { Iac } from '../iac';
|
|
7
|
+
import { Containers } from '../containers';
|
|
8
8
|
type IACProvider = {
|
|
9
|
-
|
|
9
|
+
iac: Iac;
|
|
10
10
|
};
|
|
11
|
-
export type AgentCoreAuth = '
|
|
11
|
+
export type AgentCoreAuth = 'iam' | 'cognito';
|
|
12
12
|
export interface AddAgentCoreInfraProps {
|
|
13
13
|
nameClassName: string;
|
|
14
14
|
nameKebabCase: string;
|
|
@@ -16,9 +16,9 @@ export interface AddAgentCoreInfraProps {
|
|
|
16
16
|
dockerImageTag: string;
|
|
17
17
|
dockerOutputDir: string;
|
|
18
18
|
appDirectory: string;
|
|
19
|
-
serverProtocol: '
|
|
19
|
+
serverProtocol: 'mcp' | 'http' | 'a2a';
|
|
20
20
|
auth: AgentCoreAuth;
|
|
21
|
-
|
|
21
|
+
containers: Containers;
|
|
22
22
|
}
|
|
23
23
|
export interface AddMcpServerInfraProps {
|
|
24
24
|
mcpServerNameClassName: string;
|
|
@@ -27,7 +27,7 @@ export interface AddMcpServerInfraProps {
|
|
|
27
27
|
dockerImageTag: string;
|
|
28
28
|
dockerOutputDir: string;
|
|
29
29
|
auth: AgentCoreAuth;
|
|
30
|
-
|
|
30
|
+
containers: Containers;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Add an MCP server CDK construct
|
|
@@ -40,8 +40,8 @@ export interface AddAgentInfraProps {
|
|
|
40
40
|
dockerImageTag: string;
|
|
41
41
|
dockerOutputDir: string;
|
|
42
42
|
auth: AgentCoreAuth;
|
|
43
|
-
serverProtocol?: '
|
|
44
|
-
|
|
43
|
+
serverProtocol?: 'http' | 'a2a';
|
|
44
|
+
containers: Containers;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* Add an agent CDK construct
|
|
@@ -9,18 +9,16 @@ const devkit_1 = require("@nx/devkit");
|
|
|
9
9
|
const shared_constructs_constants_1 = require("../shared-constructs-constants");
|
|
10
10
|
const ast_1 = require("../ast");
|
|
11
11
|
const addAgentCoreInfra = async (tree, options) => {
|
|
12
|
-
switch (options.
|
|
13
|
-
case '
|
|
12
|
+
switch (options.iac) {
|
|
13
|
+
case 'cdk':
|
|
14
14
|
await addAgentCoreCDKInfra(tree, options);
|
|
15
15
|
break;
|
|
16
|
-
case '
|
|
16
|
+
case 'terraform':
|
|
17
17
|
addAgentCoreTerraformInfra(tree, options);
|
|
18
18
|
break;
|
|
19
19
|
}
|
|
20
20
|
// Update shared constructs/terraform project configuration to depend on this project
|
|
21
|
-
(0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, options.
|
|
22
|
-
? shared_constructs_constants_1.SHARED_CONSTRUCTS_DIR
|
|
23
|
-
: shared_constructs_constants_1.SHARED_TERRAFORM_DIR, 'project.json'), (config) => {
|
|
21
|
+
(0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, options.iac === 'cdk' ? shared_constructs_constants_1.SHARED_CONSTRUCTS_DIR : shared_constructs_constants_1.SHARED_TERRAFORM_DIR, 'project.json'), (config) => {
|
|
24
22
|
if (!config.targets) {
|
|
25
23
|
config.targets = {};
|
|
26
24
|
}
|
|
@@ -45,7 +43,7 @@ const addAgentCoreCDKInfra = async (tree, options) => {
|
|
|
45
43
|
};
|
|
46
44
|
const addAgentCoreTerraformInfra = (tree, options) => {
|
|
47
45
|
// Add the AgentCore shared module
|
|
48
|
-
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'terraform', 'core', 'agent-core'), (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, shared_constructs_constants_1.SHARED_TERRAFORM_DIR, 'src', 'core', 'agent-core'), {
|
|
46
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'terraform', 'core', 'agent-core'), (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, shared_constructs_constants_1.SHARED_TERRAFORM_DIR, 'src', 'core', 'agent-core'), { containers: options.containers }, {
|
|
49
47
|
overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting,
|
|
50
48
|
});
|
|
51
49
|
// Generate app specific agent core configuration
|
|
@@ -64,10 +62,10 @@ const addMcpServerInfra = async (tree, options) => {
|
|
|
64
62
|
dockerOutputDir: options.dockerOutputDir,
|
|
65
63
|
projectName: options.projectName,
|
|
66
64
|
appDirectory: 'mcp-servers',
|
|
67
|
-
serverProtocol: '
|
|
68
|
-
|
|
65
|
+
serverProtocol: 'mcp',
|
|
66
|
+
iac: options.iac,
|
|
69
67
|
auth: options.auth,
|
|
70
|
-
|
|
68
|
+
containers: options.containers,
|
|
71
69
|
});
|
|
72
70
|
};
|
|
73
71
|
exports.addMcpServerInfra = addMcpServerInfra;
|
|
@@ -82,10 +80,10 @@ const addAgentInfra = async (tree, options) => {
|
|
|
82
80
|
dockerImageTag: options.dockerImageTag,
|
|
83
81
|
dockerOutputDir: options.dockerOutputDir,
|
|
84
82
|
appDirectory: 'agents',
|
|
85
|
-
serverProtocol: options.serverProtocol ?? '
|
|
86
|
-
|
|
83
|
+
serverProtocol: options.serverProtocol ?? 'http',
|
|
84
|
+
iac: options.iac,
|
|
87
85
|
auth: options.auth,
|
|
88
|
-
|
|
86
|
+
containers: options.containers,
|
|
89
87
|
});
|
|
90
88
|
};
|
|
91
89
|
exports.addAgentInfra = addAgentInfra;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-core-constructs.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/utils/agent-core-constructs/agent-core-constructs.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAOoB;AACpB,gFAIwC;AACxC,gCAAuC;AAoBvC,MAAM,iBAAiB,GAAG,KAAK,EAC7B,IAAU,EACV,
|
|
1
|
+
{"version":3,"file":"agent-core-constructs.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/utils/agent-core-constructs/agent-core-constructs.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAOoB;AACpB,gFAIwC;AACxC,gCAAuC;AAoBvC,MAAM,iBAAiB,GAAG,KAAK,EAC7B,IAAU,EACV,OAA8C,EAC9C,EAAE;IACF,QAAQ,OAAO,CAAC,GAAG,EAAE,CAAC;QACpB,KAAK,KAAK;YACR,MAAM,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC1C,MAAM;QACR,KAAK,WAAW;YACd,0BAA0B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC1C,MAAM;IACV,CAAC;IAED,qFAAqF;IACrF,IAAA,mBAAU,EACR,IAAI,EACJ,IAAA,0BAAiB,EACf,0CAAY,EACZ,OAAO,C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AAe;QACxC,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,YAAY,EAAE,aAAa;QAC3B,cAAc,EAAE,KAAK;QACrB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAC,CAAC;AACL,CAAC,CAAC;AAhBW,QAAA,iBAAiB,qBAgB5B;AAaF;;GAEG;AACI,MAAM,aAAa,GAAG,KAAK,EAChC,IAAU,EACV,OAAyC,EACzC,EAAE;IACF,MAAM,iBAAiB,CAAC,IAAI,EAAE;QAC5B,aAAa,EAAE,OAAO,CAAC,kBAAkB;QACzC,aAAa,EAAE,OAAO,CAAC,kBAAkB;QACzC,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,YAAY,EAAE,QAAQ;QACtB,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,MAAM;QAChD,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAC,CAAC;AACL,CAAC,CAAC;AAhBW,QAAA,aAAa,iBAgBxB"}
|
|
@@ -9,18 +9,18 @@ import {
|
|
|
9
9
|
ProtocolType,
|
|
10
10
|
Runtime,
|
|
11
11
|
RuntimeProps,
|
|
12
|
-
<%_ if (auth === '
|
|
12
|
+
<%_ if (auth === 'cognito') { _%>
|
|
13
13
|
RuntimeAuthorizerConfiguration,
|
|
14
14
|
<%_ } _%>
|
|
15
15
|
} from 'aws-cdk-lib/aws-bedrockagentcore';
|
|
16
|
-
import { <%_ if (serverProtocol !== '
|
|
17
|
-
<%_ if (auth === '
|
|
16
|
+
import { <%_ if (serverProtocol !== 'mcp') { _%>PolicyStatement, <%_ } _%>IGrantable, IPrincipal<%_ if (auth === 'iam') { _%>, Grant<%_ } _%> } from 'aws-cdk-lib/aws-iam';
|
|
17
|
+
<%_ if (auth === 'cognito') { _%>
|
|
18
18
|
import { IUserPool, IUserPoolClient } from 'aws-cdk-lib/aws-cognito';
|
|
19
19
|
<%_ } _%>
|
|
20
20
|
import { RuntimeConfig } from '../../../core/runtime-config.js';
|
|
21
21
|
import { findWorkspaceRoot } from '../../../core/workspace.js';
|
|
22
22
|
|
|
23
|
-
<%_ if (auth === '
|
|
23
|
+
<%_ if (auth === 'iam') { _%>
|
|
24
24
|
export type <%- nameClassName %>Props = Omit<
|
|
25
25
|
RuntimeProps,
|
|
26
26
|
| 'runtimeName'
|
|
@@ -28,7 +28,7 @@ export type <%- nameClassName %>Props = Omit<
|
|
|
28
28
|
| 'agentRuntimeArtifact'
|
|
29
29
|
| 'authorizerConfiguration'
|
|
30
30
|
>;
|
|
31
|
-
<%_ } else if (auth === '
|
|
31
|
+
<%_ } else if (auth === 'cognito') { _%>
|
|
32
32
|
export type <%- nameClassName %>Props = Omit<
|
|
33
33
|
RuntimeProps,
|
|
34
34
|
| 'runtimeName'
|
|
@@ -50,7 +50,7 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
50
50
|
public readonly dockerImage: AgentRuntimeArtifact;
|
|
51
51
|
public readonly agentCoreRuntime: Runtime;
|
|
52
52
|
|
|
53
|
-
constructor(scope: Construct, id: string, props<%_ if (auth !== '
|
|
53
|
+
constructor(scope: Construct, id: string, props<%_ if (auth !== 'cognito') { _%>?<%_ } _%>: <%- nameClassName %>Props) {
|
|
54
54
|
super(scope, id);
|
|
55
55
|
|
|
56
56
|
const rc = RuntimeConfig.ensure(this);
|
|
@@ -65,7 +65,7 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
65
65
|
platform: Platform.LINUX_ARM64,
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
-
<%_ if (auth === '
|
|
68
|
+
<%_ if (auth === 'cognito') { _%>
|
|
69
69
|
const { identity, ...restProps } = props;
|
|
70
70
|
|
|
71
71
|
<%_ } _%>
|
|
@@ -74,9 +74,9 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
74
74
|
produce: () =>
|
|
75
75
|
Names.uniqueResourceName(this.agentCoreRuntime, { maxLength: 40 }),
|
|
76
76
|
}),
|
|
77
|
-
protocolConfiguration: ProtocolType.<%- serverProtocol %>,
|
|
77
|
+
protocolConfiguration: ProtocolType.<%- serverProtocol.toUpperCase() %>,
|
|
78
78
|
agentRuntimeArtifact: this.dockerImage,
|
|
79
|
-
<%_ if (auth === '
|
|
79
|
+
<%_ if (auth === 'cognito') { _%>
|
|
80
80
|
authorizerConfiguration: RuntimeAuthorizerConfiguration.usingCognito(
|
|
81
81
|
identity.userPool,
|
|
82
82
|
[identity.userPoolClient],
|
|
@@ -87,7 +87,7 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
87
87
|
<%_ } _%>
|
|
88
88
|
environmentVariables: {
|
|
89
89
|
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
90
|
-
<%_ if (auth === '
|
|
90
|
+
<%_ if (auth === 'cognito') { _%>
|
|
91
91
|
...restProps?.environmentVariables,
|
|
92
92
|
<%_ } else { _%>
|
|
93
93
|
...props?.environmentVariables,
|
|
@@ -95,7 +95,7 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
95
95
|
},
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
-
<%_ if (serverProtocol !== '
|
|
98
|
+
<%_ if (serverProtocol !== 'mcp') { _%>
|
|
99
99
|
// Grant access for the agent to invoke bedrock models
|
|
100
100
|
this.agentCoreRuntime.addToRolePolicy(
|
|
101
101
|
new PolicyStatement({
|
|
@@ -132,7 +132,7 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
132
132
|
public get connections(): Connections {
|
|
133
133
|
return this.agentCoreRuntime.connections;
|
|
134
134
|
}
|
|
135
|
-
<%_ if (auth === '
|
|
135
|
+
<%_ if (auth === 'iam') { _%>
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
138
|
* Grants IAM permissions to invoke this agent runtime.
|
|
@@ -146,7 +146,7 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
146
146
|
grantee,
|
|
147
147
|
actions: [
|
|
148
148
|
'bedrock-agentcore:InvokeAgentRuntimeWithWebSocketStream',
|
|
149
|
-
<%_ if (serverProtocol === '
|
|
149
|
+
<%_ if (serverProtocol === 'a2a') { _%>
|
|
150
150
|
'bedrock-agentcore:GetAgentCard',
|
|
151
151
|
<%_ } _%>
|
|
152
152
|
],
|
|
@@ -30,7 +30,7 @@ variable "appconfig_application_arn" {
|
|
|
30
30
|
type = string
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
<%_ if (auth === '
|
|
33
|
+
<%_ if (auth === 'cognito') { _%>
|
|
34
34
|
variable "user_pool_id" {
|
|
35
35
|
description = "ID of the user pool for cognito authentication"
|
|
36
36
|
type = string
|
|
@@ -52,8 +52,8 @@ module "agent_core_runtime" {
|
|
|
52
52
|
source = "../../../core/agent-core"
|
|
53
53
|
agent_runtime_name = "<%= nameClassName %>"
|
|
54
54
|
docker_image_tag = "<%= dockerImageTag %>"
|
|
55
|
-
server_protocol = "<%= serverProtocol %>"
|
|
56
|
-
<%_ if (auth === '
|
|
55
|
+
server_protocol = "<%= serverProtocol.toUpperCase() %>"
|
|
56
|
+
<%_ if (auth === 'cognito') { _%>
|
|
57
57
|
authorizer_configuration = {
|
|
58
58
|
custom_jwt_authorizer = {
|
|
59
59
|
discovery_url = "https://cognito-idp.${local.aws_region}.amazonaws.com/${var.user_pool_id}/.well-known/openid-configuration"
|
|
@@ -73,7 +73,7 @@ module "agent_core_runtime" {
|
|
|
73
73
|
"appconfig:GetLatestConfiguration"
|
|
74
74
|
]
|
|
75
75
|
Resource = ["${var.appconfig_application_arn}/*"]
|
|
76
|
-
}<% if (serverProtocol !== '
|
|
76
|
+
}<% if (serverProtocol !== 'mcp') { %>,
|
|
77
77
|
# Grant access for the agent to invoke bedrock models
|
|
78
78
|
{
|
|
79
79
|
Effect = "Allow"
|
|
@@ -33,7 +33,7 @@ variable "server_protocol" {
|
|
|
33
33
|
default = "HTTP"
|
|
34
34
|
validation {
|
|
35
35
|
condition = contains(["MCP", "HTTP", "A2A"], var.server_protocol)
|
|
36
|
-
error_message = "Protocol type must be either '
|
|
36
|
+
error_message = "Protocol type must be either 'mcp', 'http', or 'a2a'."
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -267,7 +267,7 @@ resource "aws_iam_role_policy_attachment" "agent_core_policy" {
|
|
|
267
267
|
|
|
268
268
|
# Data source to get container image digest
|
|
269
269
|
data "external" "docker_digest" {
|
|
270
|
-
program = ["sh", "-c", "echo '{\"digest\":\"'$(<%=
|
|
270
|
+
program = ["sh", "-c", "echo '{\"digest\":\"'$(<%= containers %> inspect ${var.docker_image_tag} --format '{{.Id}}')'\"}' "]
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
# Null resource for container image publish
|
|
@@ -281,13 +281,13 @@ resource "null_resource" "docker_publish" {
|
|
|
281
281
|
provisioner "local-exec" {
|
|
282
282
|
command = <<-EOT
|
|
283
283
|
# Get ECR login token
|
|
284
|
-
aws ecr get-login-password --region ${local.aws_region} | <%=
|
|
284
|
+
aws ecr get-login-password --region ${local.aws_region} | <%= containers %> login --username AWS --password-stdin ${self.triggers.repository_url}
|
|
285
285
|
|
|
286
286
|
# Tag the image
|
|
287
|
-
<%=
|
|
287
|
+
<%= containers %> tag ${self.triggers.docker_image_tag} ${self.triggers.repository_url}:latest
|
|
288
288
|
|
|
289
289
|
# Push the image
|
|
290
|
-
<%=
|
|
290
|
+
<%= containers %> push ${self.triggers.repository_url}:latest
|
|
291
291
|
EOT
|
|
292
292
|
}
|
|
293
293
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { Tree } from '@nx/devkit';
|
|
6
|
-
import {
|
|
6
|
+
import { Iac } from '../iac';
|
|
7
7
|
interface BackendOptions {
|
|
8
8
|
type: 'trpc' | 'fastapi' | 'smithy';
|
|
9
9
|
integrationPattern: 'isolated' | 'shared';
|
|
@@ -30,9 +30,9 @@ export interface AddApiGatewayConstructOptions {
|
|
|
30
30
|
apiNameKebabCase: string;
|
|
31
31
|
constructType: 'http' | 'rest';
|
|
32
32
|
backend: TrpcBackendOptions | FastApiBackendOptions | SmithyBackendOptions;
|
|
33
|
-
auth: '
|
|
33
|
+
auth: 'iam' | 'cognito' | 'custom';
|
|
34
34
|
}
|
|
35
35
|
export declare const addApiGatewayInfra: (tree: Tree, options: AddApiGatewayConstructOptions & {
|
|
36
|
-
|
|
36
|
+
iac: Iac;
|
|
37
37
|
}) => Promise<void>;
|
|
38
38
|
export {};
|
|
@@ -10,18 +10,16 @@ const shared_constructs_constants_1 = require("../shared-constructs-constants");
|
|
|
10
10
|
const ast_1 = require("../ast");
|
|
11
11
|
const nx_1 = require("../nx");
|
|
12
12
|
const addApiGatewayInfra = async (tree, options) => {
|
|
13
|
-
if (options.
|
|
13
|
+
if (options.iac === 'cdk') {
|
|
14
14
|
await addApiGatewayCdkConstructs(tree, options);
|
|
15
15
|
}
|
|
16
|
-
else if (options.
|
|
16
|
+
else if (options.iac === 'terraform') {
|
|
17
17
|
addApiGatewayTerraformModules(tree, options);
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
20
|
-
throw new Error(`Unsupported
|
|
20
|
+
throw new Error(`Unsupported iac ${options.iac}`);
|
|
21
21
|
}
|
|
22
|
-
(0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, options.
|
|
23
|
-
? shared_constructs_constants_1.SHARED_CONSTRUCTS_DIR
|
|
24
|
-
: shared_constructs_constants_1.SHARED_TERRAFORM_DIR, 'project.json'), (config) => {
|
|
22
|
+
(0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, options.iac === 'cdk' ? shared_constructs_constants_1.SHARED_CONSTRUCTS_DIR : shared_constructs_constants_1.SHARED_TERRAFORM_DIR, 'project.json'), (config) => {
|
|
25
23
|
(0, nx_1.addDependencyToTargetIfNotPresent)(config, 'build', `${options.apiProjectName}:build`);
|
|
26
24
|
return config;
|
|
27
25
|
});
|