@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-constructs.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/utils/api-constructs/api-constructs.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAOoB;AACpB,gFAIwC;AACxC,gCAAuC;AAEvC,8BAA0D;AAmCnD,MAAM,kBAAkB,GAAG,KAAK,EACrC,IAAU,EACV,
|
|
1
|
+
{"version":3,"file":"api-constructs.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/utils/api-constructs/api-constructs.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAOoB;AACpB,gFAIwC;AACxC,gCAAuC;AAEvC,8BAA0D;AAmCnD,MAAM,kBAAkB,GAAG,KAAK,EACrC,IAAU,EACV,OAAqD,EACrD,EAAE;IACF,IAAI,OAAO,CAAC,GAAG,KAAK,KAAK,EAAE,CAAC;QAC1B,MAAM,0BAA0B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;SAAM,IAAI,OAAO,CAAC,GAA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EAAE,kDAAoB,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,EAC3E,OAAO,EACP;QACE,iBAAiB,EAAE,0BAAiB,CAAC,YAAY;KAClD,CACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -18,23 +18,23 @@ import {
|
|
|
18
18
|
CorsHttpMethod,
|
|
19
19
|
CfnApi,
|
|
20
20
|
} from 'aws-cdk-lib/aws-apigatewayv2';
|
|
21
|
-
<%_ if (['
|
|
21
|
+
<%_ if (['iam', 'cognito', 'custom'].includes(auth)) { _%>
|
|
22
22
|
import {
|
|
23
|
-
<%_ if (auth === '
|
|
23
|
+
<%_ if (auth === 'iam') { _%>
|
|
24
24
|
HttpIamAuthorizer,
|
|
25
|
-
<%_ } else if (auth === '
|
|
25
|
+
<%_ } else if (auth === 'cognito') { _%>
|
|
26
26
|
HttpUserPoolAuthorizer,
|
|
27
|
-
<%_ } else if (auth === '
|
|
27
|
+
<%_ } else if (auth === 'custom') { _%>
|
|
28
28
|
HttpLambdaAuthorizer,
|
|
29
29
|
HttpLambdaResponseType,
|
|
30
30
|
<%_ } _%>
|
|
31
31
|
} from 'aws-cdk-lib/aws-apigatewayv2-authorizers';
|
|
32
32
|
<%_ } _%>
|
|
33
33
|
import { HttpLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
|
|
34
|
-
<%_ if (auth === '
|
|
34
|
+
<%_ if (auth === 'cognito') { _%>
|
|
35
35
|
import { IUserPool, IUserPoolClient } from 'aws-cdk-lib/aws-cognito';
|
|
36
36
|
<%_ } _%>
|
|
37
|
-
<%_ if (auth === '
|
|
37
|
+
<%_ if (auth === 'iam') { _%>
|
|
38
38
|
import { Grant, IGrantable } from 'aws-cdk-lib/aws-iam';
|
|
39
39
|
<%_ } _%>
|
|
40
40
|
import {
|
|
@@ -68,7 +68,7 @@ export interface <%= apiNameClassName %>Props<
|
|
|
68
68
|
* Map of operation names to their API Gateway integrations
|
|
69
69
|
*/
|
|
70
70
|
integrations: TIntegrations;
|
|
71
|
-
<%_ if (auth === '
|
|
71
|
+
<%_ if (auth === 'cognito') { _%>
|
|
72
72
|
/**
|
|
73
73
|
* Identity details for Cognito Authentication
|
|
74
74
|
*/
|
|
@@ -175,7 +175,7 @@ export class <%= apiNameClassName %><
|
|
|
175
175
|
id: string,
|
|
176
176
|
props: <%= apiNameClassName %>Props<TIntegrations>,
|
|
177
177
|
) {
|
|
178
|
-
<%_ if (auth === '
|
|
178
|
+
<%_ if (auth === 'custom') { _%>
|
|
179
179
|
const authorizerFunction = new Function(scope, '<%= apiNameClassName %>AuthorizerFunction', {
|
|
180
180
|
<%_ if (['trpc', 'smithy'].includes(backend.type)) { _%>
|
|
181
181
|
runtime: Runtime.NODEJS_LATEST,
|
|
@@ -218,13 +218,13 @@ export class <%= apiNameClassName %><
|
|
|
218
218
|
'x-amz-security-token',
|
|
219
219
|
],
|
|
220
220
|
},
|
|
221
|
-
<%_ if (auth === '
|
|
221
|
+
<%_ if (auth === 'iam') { _%>
|
|
222
222
|
defaultAuthorizer: new HttpIamAuthorizer(),
|
|
223
|
-
<%_ } else if (auth === '
|
|
223
|
+
<%_ } else if (auth === 'cognito') { _%>
|
|
224
224
|
defaultAuthorizer: new HttpUserPoolAuthorizer('<%= apiNameClassName %>Authorizer', props.identity.userPool, {
|
|
225
225
|
userPoolClients: [props.identity.userPoolClient]
|
|
226
226
|
}),
|
|
227
|
-
<%_ } else if (auth === '
|
|
227
|
+
<%_ } else if (auth === 'custom') { _%>
|
|
228
228
|
defaultAuthorizer: new HttpLambdaAuthorizer('<%= apiNameClassName %>LambdaAuthorizer', authorizerFunction, {
|
|
229
229
|
responseTypes: [HttpLambdaResponseType.SIMPLE],
|
|
230
230
|
}),
|
|
@@ -278,7 +278,7 @@ export class <%= apiNameClassName %><
|
|
|
278
278
|
],
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
|
-
<%_ if (auth === '
|
|
281
|
+
<%_ if (auth === 'iam') { _%>
|
|
282
282
|
|
|
283
283
|
/**
|
|
284
284
|
* Grants IAM permissions to invoke any method on this API.
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
<%_ if (['trpc', 'fastapi'].includes(backend.type)) { _%>
|
|
20
20
|
ResponseTransferMode,
|
|
21
21
|
<%_ } _%>
|
|
22
|
-
<%_ if (auth === '
|
|
22
|
+
<%_ if (auth === 'cognito') { _%>
|
|
23
23
|
CognitoUserPoolsAuthorizer,
|
|
24
24
|
<%_ } _%>
|
|
25
|
-
<%_ if (auth === '
|
|
25
|
+
<%_ if (auth === 'custom') { _%>
|
|
26
26
|
TokenAuthorizer,
|
|
27
27
|
<%_ } _%>
|
|
28
28
|
} from 'aws-cdk-lib/aws-apigateway';
|
|
@@ -32,12 +32,12 @@ import {
|
|
|
32
32
|
PolicyStatement,
|
|
33
33
|
Effect,
|
|
34
34
|
AnyPrincipal,
|
|
35
|
-
<%_ if (auth === '
|
|
35
|
+
<%_ if (auth === 'iam') { _%>
|
|
36
36
|
IGrantable,
|
|
37
37
|
Grant,
|
|
38
38
|
<%_ } _%>
|
|
39
39
|
} from 'aws-cdk-lib/aws-iam';
|
|
40
|
-
<%_ if (auth === '
|
|
40
|
+
<%_ if (auth === 'cognito') { _%>
|
|
41
41
|
import { IUserPool } from 'aws-cdk-lib/aws-cognito';
|
|
42
42
|
<%_ } _%>
|
|
43
43
|
import {
|
|
@@ -71,7 +71,7 @@ export interface <%= apiNameClassName %>Props<
|
|
|
71
71
|
* Map of operation names to their API Gateway integrations
|
|
72
72
|
*/
|
|
73
73
|
integrations: TIntegrations;
|
|
74
|
-
<%_ if (auth === '
|
|
74
|
+
<%_ if (auth === 'cognito') { _%>
|
|
75
75
|
/**
|
|
76
76
|
* Identity details for Cognito Authentication
|
|
77
77
|
*/
|
|
@@ -195,7 +195,7 @@ export class <%= apiNameClassName %><
|
|
|
195
195
|
id: string,
|
|
196
196
|
props: <%= apiNameClassName %>Props<TIntegrations>,
|
|
197
197
|
) {
|
|
198
|
-
<%_ if (auth === '
|
|
198
|
+
<%_ if (auth === 'custom') { _%>
|
|
199
199
|
const authorizerFunction = new Function(scope, '<%= apiNameClassName %>AuthorizerFunction', {
|
|
200
200
|
<%_ if (['trpc', 'smithy'].includes(backend.type)) { _%>
|
|
201
201
|
runtime: Runtime.NODEJS_LATEST,
|
|
@@ -228,14 +228,14 @@ export class <%= apiNameClassName %><
|
|
|
228
228
|
super(scope, id, {
|
|
229
229
|
apiName: '<%= apiNameClassName %>',
|
|
230
230
|
defaultMethodOptions: {
|
|
231
|
-
<%_ if (auth === '
|
|
231
|
+
<%_ if (auth === 'iam') { _%>
|
|
232
232
|
authorizationType: AuthorizationType.IAM,
|
|
233
|
-
<%_ } else if (auth === '
|
|
233
|
+
<%_ } else if (auth === 'cognito') { _%>
|
|
234
234
|
authorizationType: AuthorizationType.COGNITO,
|
|
235
235
|
authorizer: new CognitoUserPoolsAuthorizer(scope, '<%= apiNameClassName %>Authorizer', {
|
|
236
236
|
cognitoUserPools: [props.identity.userPool],
|
|
237
237
|
}),
|
|
238
|
-
<%_ } else if (auth === '
|
|
238
|
+
<%_ } else if (auth === 'custom') { _%>
|
|
239
239
|
authorizationType: AuthorizationType.CUSTOM,
|
|
240
240
|
authorizer: new TokenAuthorizer(scope, '<%= apiNameClassName %>TokenAuthorizer', {
|
|
241
241
|
handler: authorizerFunction,
|
|
@@ -247,7 +247,7 @@ export class <%= apiNameClassName %><
|
|
|
247
247
|
},
|
|
248
248
|
policy: new PolicyDocument({
|
|
249
249
|
statements: [
|
|
250
|
-
<%_ if (auth === '
|
|
250
|
+
<%_ if (auth === 'iam') { _%>
|
|
251
251
|
// Open up OPTIONS to allow browsers to make unauthenticated preflight requests
|
|
252
252
|
new PolicyStatement({
|
|
253
253
|
effect: Effect.ALLOW,
|
|
@@ -256,7 +256,7 @@ export class <%= apiNameClassName %><
|
|
|
256
256
|
resources: ['execute-api:/*/OPTIONS/*'],
|
|
257
257
|
}),
|
|
258
258
|
<%_ } else { _%>
|
|
259
|
-
// Allow all callers to invoke the API in the resource policy<% if (auth === '
|
|
259
|
+
// Allow all callers to invoke the API in the resource policy<% if (auth === 'cognito') { %>, since auth is handled by Cognito<% } else if (auth === 'custom') { %>, since auth is handled by the Lambda Authorizer<% } %>
|
|
260
260
|
new PolicyStatement({
|
|
261
261
|
effect: Effect.ALLOW,
|
|
262
262
|
principals: [new AnyPrincipal()],
|
|
@@ -308,7 +308,7 @@ export class <%= apiNameClassName %><
|
|
|
308
308
|
}
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
|
-
<%_ if (auth === '
|
|
311
|
+
<%_ if (auth === 'iam') { _%>
|
|
312
312
|
|
|
313
313
|
/**
|
|
314
314
|
* Grants IAM permissions to invoke any method on this API.
|
|
@@ -9,7 +9,7 @@ terraform {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
<%_ if (auth === '
|
|
12
|
+
<%_ if (auth === 'cognito') { _%>
|
|
13
13
|
# Authentication Configuration
|
|
14
14
|
variable "user_pool_id" {
|
|
15
15
|
description = "Cognito User Pool ID for authentication"
|
|
@@ -254,7 +254,7 @@ resource "aws_lambda_alias" "live" {
|
|
|
254
254
|
}
|
|
255
255
|
<%_ } _%>
|
|
256
256
|
|
|
257
|
-
<%_ if (auth === '
|
|
257
|
+
<%_ if (auth === 'cognito') { _%>
|
|
258
258
|
# Cognito User Pool Authorizer
|
|
259
259
|
resource "aws_apigatewayv2_authorizer" "cognito_authorizer" {
|
|
260
260
|
api_id = module.http_api.api_id
|
|
@@ -267,7 +267,7 @@ resource "aws_apigatewayv2_authorizer" "cognito_authorizer" {
|
|
|
267
267
|
issuer = "https://cognito-idp.${data.aws_region.current.region}.amazonaws.com/${var.user_pool_id}"
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
<%_ } else if (auth === '
|
|
270
|
+
<%_ } else if (auth === 'custom') { _%>
|
|
271
271
|
# Custom Lambda Authorizer
|
|
272
272
|
resource "aws_lambda_function" "authorizer_lambda" {
|
|
273
273
|
#checkov:skip=CKV_AWS_117:Lambda function does not need to be in VPC for this use case
|
|
@@ -407,17 +407,17 @@ resource "aws_apigatewayv2_route" "proxy_routes" {
|
|
|
407
407
|
route_key = "${each.key} /{proxy+}"
|
|
408
408
|
target = "integrations/${aws_apigatewayv2_integration.lambda_integration.id}"
|
|
409
409
|
|
|
410
|
-
<%_ if (auth === '
|
|
410
|
+
<%_ if (auth === 'iam') { _%>
|
|
411
411
|
authorization_type = "AWS_IAM"
|
|
412
|
-
<%_ } else if (auth === '
|
|
412
|
+
<%_ } else if (auth === 'cognito') { _%>
|
|
413
413
|
authorization_type = "JWT"
|
|
414
414
|
authorizer_id = aws_apigatewayv2_authorizer.cognito_authorizer.id
|
|
415
|
-
<%_ } else if (auth === '
|
|
415
|
+
<%_ } else if (auth === 'custom') { _%>
|
|
416
416
|
authorization_type = "CUSTOM"
|
|
417
417
|
authorizer_id = aws_apigatewayv2_authorizer.custom_authorizer.id
|
|
418
418
|
<%_ } _%>
|
|
419
419
|
|
|
420
|
-
depends_on = [aws_apigatewayv2_integration.lambda_integration<% if (auth === '
|
|
420
|
+
depends_on = [aws_apigatewayv2_integration.lambda_integration<% if (auth === 'cognito') { %>, aws_apigatewayv2_authorizer.cognito_authorizer<% } else if (auth === 'custom') { %>, aws_apigatewayv2_authorizer.custom_authorizer<% } %>]
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
# Add API url to runtime config
|
|
@@ -9,7 +9,7 @@ terraform {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
<%_ if (auth === '
|
|
12
|
+
<%_ if (auth === 'cognito') { _%>
|
|
13
13
|
# Authentication Configuration
|
|
14
14
|
variable "user_pool_id" {
|
|
15
15
|
description = "Cognito User Pool ID for authentication"
|
|
@@ -251,7 +251,7 @@ resource "aws_lambda_alias" "live" {
|
|
|
251
251
|
}
|
|
252
252
|
<%_ } _%>
|
|
253
253
|
|
|
254
|
-
<%_ if (auth === '
|
|
254
|
+
<%_ if (auth === 'cognito') { _%>
|
|
255
255
|
# Cognito User Pool Authorizer
|
|
256
256
|
resource "aws_api_gateway_authorizer" "cognito_authorizer" {
|
|
257
257
|
name = "<%- apiNameClassName %>Authorizer-${random_string.suffix.result}"
|
|
@@ -260,7 +260,7 @@ resource "aws_api_gateway_authorizer" "cognito_authorizer" {
|
|
|
260
260
|
provider_arns = ["arn:aws:cognito-idp:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:userpool/${var.user_pool_id}"]
|
|
261
261
|
identity_source = "method.request.header.Authorization"
|
|
262
262
|
}
|
|
263
|
-
<%_ } else if (auth === '
|
|
263
|
+
<%_ } else if (auth === 'custom') { _%>
|
|
264
264
|
# Custom Lambda Authorizer
|
|
265
265
|
resource "aws_lambda_function" "authorizer_lambda" {
|
|
266
266
|
#checkov:skip=CKV_AWS_117:Lambda function does not need to be in VPC for this use case
|
|
@@ -408,12 +408,12 @@ resource "aws_api_gateway_method" "proxy_method" {
|
|
|
408
408
|
resource_id = aws_api_gateway_resource.proxy_resource.id
|
|
409
409
|
http_method = "ANY"
|
|
410
410
|
|
|
411
|
-
<%_ if (auth === '
|
|
411
|
+
<%_ if (auth === 'iam') { _%>
|
|
412
412
|
authorization = "AWS_IAM"
|
|
413
|
-
<%_ } else if (auth === '
|
|
413
|
+
<%_ } else if (auth === 'cognito') { _%>
|
|
414
414
|
authorization = "COGNITO_USER_POOLS"
|
|
415
415
|
authorizer_id = aws_api_gateway_authorizer.cognito_authorizer.id
|
|
416
|
-
<%_ } else if (auth === '
|
|
416
|
+
<%_ } else if (auth === 'custom') { _%>
|
|
417
417
|
authorization = "CUSTOM"
|
|
418
418
|
authorizer_id = aws_api_gateway_authorizer.custom_authorizer.id
|
|
419
419
|
<%_ } _%>
|
|
@@ -422,7 +422,7 @@ resource "aws_api_gateway_method" "proxy_method" {
|
|
|
422
422
|
"method.request.path.proxy" = true
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
-
depends_on = [<% if (auth === '
|
|
425
|
+
depends_on = [<% if (auth === 'cognito') { %>aws_api_gateway_authorizer.cognito_authorizer<% } else if (auth === 'custom') { %>aws_api_gateway_authorizer.custom_authorizer<% } %>]
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
# OPTIONS method for CORS preflight
|
|
@@ -500,7 +500,7 @@ resource "aws_api_gateway_deployment" "api_deployment" {
|
|
|
500
500
|
aws_api_gateway_integration.options_integration,
|
|
501
501
|
aws_api_gateway_method_response.options_response,
|
|
502
502
|
aws_api_gateway_integration_response.options_integration_response,
|
|
503
|
-
<%_ if (auth === '
|
|
503
|
+
<%_ if (auth === 'custom') { _%>
|
|
504
504
|
aws_api_gateway_authorizer.custom_authorizer,
|
|
505
505
|
<%_ } _%>
|
|
506
506
|
]
|
|
@@ -530,7 +530,7 @@ resource "aws_api_gateway_rest_api_policy" "api_policy" {
|
|
|
530
530
|
policy = jsonencode({
|
|
531
531
|
Version = "2012-10-17"
|
|
532
532
|
Statement = [
|
|
533
|
-
<%_ if (auth === '
|
|
533
|
+
<%_ if (auth === 'iam') { _%>
|
|
534
534
|
{
|
|
535
535
|
# Grant any AWS credentials from the account to call the API
|
|
536
536
|
# Machine to machine fine-grained access can be defined here using more specific principals
|
|
@@ -551,7 +551,7 @@ resource "aws_api_gateway_rest_api_policy" "api_policy" {
|
|
|
551
551
|
}
|
|
552
552
|
<%_ } else { _%>
|
|
553
553
|
{
|
|
554
|
-
# Allow all callers to invoke the API in the resource policy<% if (auth === '
|
|
554
|
+
# Allow all callers to invoke the API in the resource policy<% if (auth === 'cognito') { %>, since auth is handled by Cognito<% } else if (auth === 'custom') { %>, since auth is handled by the Lambda Authorizer<% } %>
|
|
555
555
|
Effect = "Allow"
|
|
556
556
|
Principal = "*"
|
|
557
557
|
Action = "execute-api:Invoke"
|
|
@@ -3,9 +3,9 @@
|
|
|
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
|
export interface AddOpenApiMetadataGenerateTargetOptions {
|
|
8
|
-
|
|
8
|
+
iac: Iac;
|
|
9
9
|
apiNameKebabCase: string;
|
|
10
10
|
specPath: string;
|
|
11
11
|
specBuildTargetName: string;
|
|
@@ -14,4 +14,4 @@ export interface AddOpenApiMetadataGenerateTargetOptions {
|
|
|
14
14
|
* Adds a generate:<api-name>-metadata target to shared constructs (CDK only)
|
|
15
15
|
* This allows for API CDK constructs to have type-safety for integrations based on an OpenAPI Specification
|
|
16
16
|
*/
|
|
17
|
-
export declare const addSharedConstructsOpenApiMetadataGenerateTarget: (tree: Tree, {
|
|
17
|
+
export declare const addSharedConstructsOpenApiMetadataGenerateTarget: (tree: Tree, { iac, apiNameKebabCase, specPath, specBuildTargetName, }: AddOpenApiMetadataGenerateTargetOptions) => void;
|
|
@@ -13,8 +13,8 @@ const shared_constructs_constants_1 = require("../shared-constructs-constants");
|
|
|
13
13
|
* Adds a generate:<api-name>-metadata target to shared constructs (CDK only)
|
|
14
14
|
* This allows for API CDK constructs to have type-safety for integrations based on an OpenAPI Specification
|
|
15
15
|
*/
|
|
16
|
-
const addSharedConstructsOpenApiMetadataGenerateTarget = (tree, {
|
|
17
|
-
if (
|
|
16
|
+
const addSharedConstructsOpenApiMetadataGenerateTarget = (tree, { iac, apiNameKebabCase, specPath, specBuildTargetName, }) => {
|
|
17
|
+
if (iac !== 'cdk') {
|
|
18
18
|
// For Terraform, we do not support type-safe integration builders, rather only the single lambda
|
|
19
19
|
// router pattern, and therefore do not need to add depenencies on metadata generation.
|
|
20
20
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-api-metadata.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/utils/api-constructs/open-api-metadata.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAKoB;AAEpB,gCAAyC;AACzC,8BAA0D;AAC1D,gFAGwC;AASxC;;;GAGG;AACI,MAAM,gDAAgD,GAAG,CAC9D,IAAU,EACV,EACE,
|
|
1
|
+
{"version":3,"file":"open-api-metadata.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/utils/api-constructs/open-api-metadata.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAKoB;AAEpB,gCAAyC;AACzC,8BAA0D;AAC1D,gFAGwC;AASxC;;;GAGG;AACI,MAAM,gDAAgD,GAAG,CAC9D,IAAU,EACV,EACE,GAAG,EACH,gBAAgB,EAChB,QAAQ,EACR,mBAAmB,GACqB,EAC1C,EAAE;IACF,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;QAClB,iGAAiG;QACjG,uFAAuF;QACvF,OAAO;IACT,CAAC;IAED,MAAM,oBAAoB,GAAG,IAAA,0BAAiB,EAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;IAC9E,MAAM,4BAA4B,GAAG,IAAA,0BAAiB,EACpD,IAAA,0BAAiB,EAAC,0CAAY,EAAE,mDAAqB,CAAC,EACtD,KAAK,EACL,oBAAoB,CACrB,CAAC;IAEF,IAAA,mBAAU,EACR,IAAI,EACJ,IAAA,0BAAiB,EAAC,0CAAY,EAAE,mDAAqB,EAAE,cAAc,CAAC,EACtE,CAAC,MAA4B,EAAE,EAAE;QAC/B,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YAC1B,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;QAC5B,CAAC;QACD,wFAAwF;QACxF,0CAA0C;QAC1C,MAAM,kBAAkB,GAAG,YAAY,gBAAgB,WAAW,CAAC;QACnE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACxC,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG;gBACnC,KAAK,EAAE,IAAI;gBACX,QAAQ,EAAE,iBAAiB;gBAC3B,MAAM,EAAE;oBACN;wBACE,yBAAyB,EAAE,WAAW;qBACvC;iBACF;gBACD,OAAO,EAAE;oBACP,IAAA,0BAAiB,EAAC,iBAAiB,EAAE,4BAA4B,CAAC;iBACnE;gBACD,OAAO,EAAE;oBACP,QAAQ,EAAE;wBACR,+DAA+D,QAAQ,mBAAmB,4BAA4B,oBAAoB;qBAC3I;iBACF;gBACD,SAAS,EAAE,CAAC,mBAAmB,CAAC;aACjC,CAAC;QACJ,CAAC;QACD,IAAA,sCAAiC,EAAC,MAAM,EAAE,SAAS,EAAE,kBAAkB,CAAC,CAAC;QACzE,OAAO,MAAM,CAAC;IAChB,CAAC,CACF,CAAC;IAEF,2CAA2C;IAC3C,sFAAsF;IACtF,IAAA,qBAAe,EACb,IAAI,EACJ,IAAA,0BAAiB,EAAC,0CAAY,EAAE,mDAAqB,CAAC,EACtD,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,GAAG,QAAQ,EAAE,IAAA,0BAAiB,EAAC,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAC5E,CAAC;AACJ,CAAC,CAAC;AAnEW,QAAA,gDAAgD,oDAmE3D"}
|
package/src/utils/commands.d.ts
CHANGED
|
@@ -44,4 +44,4 @@ export declare const buildInstallCommand: (pm: string, pkg: string, dev: boolean
|
|
|
44
44
|
* The package manager is auto-detected by @aws/create-nx-workspace from the
|
|
45
45
|
* invoking command, so --pm is not needed.
|
|
46
46
|
*/
|
|
47
|
-
export declare const buildCreateNxWorkspaceCommand: (pm: string, workspace: string,
|
|
47
|
+
export declare const buildCreateNxWorkspaceCommand: (pm: string, workspace: string, iac?: "cdk" | "terraform", tag?: string) => string;
|
package/src/utils/commands.js
CHANGED
|
@@ -53,7 +53,7 @@ exports.buildInstallCommand = buildInstallCommand;
|
|
|
53
53
|
* The package manager is auto-detected by @aws/create-nx-workspace from the
|
|
54
54
|
* invoking command, so --pm is not needed.
|
|
55
55
|
*/
|
|
56
|
-
const buildCreateNxWorkspaceCommand = (pm, workspace,
|
|
56
|
+
const buildCreateNxWorkspaceCommand = (pm, workspace, iac, tag) => {
|
|
57
57
|
const createPrefix = exports.PACKAGE_MANAGER_COMMANDS[pm]?.create ?? `${pm} create`;
|
|
58
58
|
const pkgName = tag ? `@aws/nx-workspace@${tag}` : '@aws/nx-workspace';
|
|
59
59
|
const parts = [
|
|
@@ -62,7 +62,7 @@ const buildCreateNxWorkspaceCommand = (pm, workspace, iacProvider, tag) => {
|
|
|
62
62
|
// npm requires '--' to stop interpreting subsequent flags as npm config
|
|
63
63
|
...(pm === 'npm' ? ['--'] : []),
|
|
64
64
|
workspace,
|
|
65
|
-
...(
|
|
65
|
+
...(iac ? [`--iac=${iac}`] : []),
|
|
66
66
|
];
|
|
67
67
|
return parts.join(' ');
|
|
68
68
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/commands.ts"],"names":[],"mappings":";;;AAsBa,QAAA,wBAAwB,GAGjC;IACF,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE;IAC1D,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE;IAC1D,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE;IAC1D,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE;CACxD,CAAC;AAEF;;GAEG;AACI,MAAM,8BAA8B,GAAG,CAAC,EAAU,EAAE,OAAe,EAAE,EAAE;IAC5E,MAAM,MAAM,GAAG,gCAAwB,CAAC,EAA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exports[`config utils > should add multiple new keys to an empty config 1`] = `
|
|
|
4
4
|
"import { AwsNxPluginConfig } from '@aws/nx-plugin';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
iac: { provider: '
|
|
7
|
+
iac: { provider: 'cdk' },
|
|
8
8
|
tags: ['a', 'b'],
|
|
9
9
|
} satisfies AwsNxPluginConfig;
|
|
10
10
|
"
|
|
@@ -31,7 +31,7 @@ export default {
|
|
|
31
31
|
`;
|
|
32
32
|
|
|
33
33
|
exports[`config utils > should handle config without satisfies clause 1`] = `
|
|
34
|
-
"export default { iac: { provider: '
|
|
34
|
+
"export default { iac: { provider: 'cdk' } };
|
|
35
35
|
"
|
|
36
36
|
`;
|
|
37
37
|
|
|
@@ -44,7 +44,7 @@ export default {
|
|
|
44
44
|
content: { lines: [\`Copyright \${new Date().getFullYear()} Foo Inc.\`] },
|
|
45
45
|
},
|
|
46
46
|
},
|
|
47
|
-
iac: { provider: '
|
|
47
|
+
iac: { provider: 'cdk' },
|
|
48
48
|
} satisfies AwsNxPluginConfig;
|
|
49
49
|
"
|
|
50
50
|
`;
|
|
@@ -59,7 +59,7 @@ export default {
|
|
|
59
59
|
content: { lines: [\`Copyright \${new Date().getFullYear()} Acme\`] },
|
|
60
60
|
},
|
|
61
61
|
},
|
|
62
|
-
iac: { provider: '
|
|
62
|
+
iac: { provider: 'terraform' },
|
|
63
63
|
} satisfies AwsNxPluginConfig;
|
|
64
64
|
"
|
|
65
65
|
`;
|
|
@@ -75,7 +75,7 @@ exports[`config utils > should snapshot merged config with multiple keys 1`] = `
|
|
|
75
75
|
"import { AwsNxPluginConfig } from '@aws/nx-plugin';
|
|
76
76
|
|
|
77
77
|
export default {
|
|
78
|
-
iac: { provider: '
|
|
78
|
+
iac: { provider: 'cdk' },
|
|
79
79
|
tags: ['tag1'],
|
|
80
80
|
} satisfies AwsNxPluginConfig;
|
|
81
81
|
"
|
|
@@ -84,7 +84,7 @@ export default {
|
|
|
84
84
|
exports[`config utils > should snapshot simple iac config 1`] = `
|
|
85
85
|
"import { AwsNxPluginConfig } from '@aws/nx-plugin';
|
|
86
86
|
|
|
87
|
-
export default { iac: { provider: '
|
|
87
|
+
export default { iac: { provider: 'cdk' } } satisfies AwsNxPluginConfig;
|
|
88
88
|
"
|
|
89
89
|
`;
|
|
90
90
|
|
|
@@ -6,8 +6,8 @@ import { LicenseConfig } from '../../license/config-types';
|
|
|
6
6
|
import { IacConfig } from '../iac';
|
|
7
7
|
import { ContainersConfig } from '../containers';
|
|
8
8
|
export * from '../../license/config-types';
|
|
9
|
-
export { IacConfig,
|
|
10
|
-
export { ContainersConfig,
|
|
9
|
+
export { IacConfig, Iac } from '../iac';
|
|
10
|
+
export { ContainersConfig, Containers } from '../containers';
|
|
11
11
|
/**
|
|
12
12
|
* Configuration for the nx plugin
|
|
13
13
|
*/
|
package/src/utils/connection/open-api/files/components/__apiNameClassName__Provider.tsx.template
CHANGED
|
@@ -2,9 +2,9 @@ import { createContext, FC, PropsWithChildren, useMemo } from 'react';
|
|
|
2
2
|
import { <%- apiNameClassName %> } from '../<%- generatedClientDir %>/client.gen';
|
|
3
3
|
import { <%- apiNameClassName %>OptionsProxy } from '../<%- generatedClientDir %>/options-proxy.gen';
|
|
4
4
|
import { useRuntimeConfig } from '../hooks/useRuntimeConfig';
|
|
5
|
-
<%_ if (auth === '
|
|
5
|
+
<%_ if (auth === 'iam') { _%>
|
|
6
6
|
import { useSigV4 } from '../hooks/useSigV4';
|
|
7
|
-
<%_ } else if (auth === '
|
|
7
|
+
<%_ } else if (auth === 'cognito') { _%>
|
|
8
8
|
import { useAuth } from 'react-oidc-context';
|
|
9
9
|
<%_ } _%>
|
|
10
10
|
<%_ if (isAgentRuntime) { _%>
|
|
@@ -32,9 +32,9 @@ const useCreate<%- apiNameClassName %>Client = (): <%- apiNameClassName %> => {
|
|
|
32
32
|
<%_ } else { _%>
|
|
33
33
|
const apiUrl = runtimeConfig.apis.<%- apiNameClassName %>;
|
|
34
34
|
<%_ } _%>
|
|
35
|
-
<%_ if(auth === '
|
|
35
|
+
<%_ if(auth === 'iam') { _%>
|
|
36
36
|
const sigv4Client = useSigV4();
|
|
37
|
-
<%_ } else if (auth === '
|
|
37
|
+
<%_ } else if (auth === 'cognito') { _%>
|
|
38
38
|
const auth = useAuth();
|
|
39
39
|
const user = auth?.user;
|
|
40
40
|
const cognitoClient: typeof fetch = (url, init) => {
|
|
@@ -45,12 +45,12 @@ const useCreate<%- apiNameClassName %>Client = (): <%- apiNameClassName %> => {
|
|
|
45
45
|
<%_ } _%>
|
|
46
46
|
return useMemo(() => new <%- apiNameClassName %>({
|
|
47
47
|
url: apiUrl,
|
|
48
|
-
<%_ if(auth === '
|
|
48
|
+
<%_ if(auth === 'iam') { _%>
|
|
49
49
|
fetch: sigv4Client.fetch,
|
|
50
|
-
<%_ } else if(auth === '
|
|
50
|
+
<%_ } else if(auth === 'cognito') { _%>
|
|
51
51
|
fetch: cognitoClient,
|
|
52
52
|
<%_ } _%>
|
|
53
|
-
}), [apiUrl<% if(auth === '
|
|
53
|
+
}), [apiUrl<% if(auth === 'iam') { %>, sigv4Client<% } else if(auth === 'cognito') { %>, cognitoClient<% } %>])
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
export const <%- apiNameClassName %>Provider: FC<PropsWithChildren> = ({ children }) => {
|
|
@@ -80,7 +80,7 @@ const addOpenApiReactClient = async (tree, { apiName, frontendProjectConfig, bac
|
|
|
80
80
|
project: frontendProjectConfig.name,
|
|
81
81
|
});
|
|
82
82
|
// Add sigv4 fetch
|
|
83
|
-
if (auth === '
|
|
83
|
+
if (auth === 'iam') {
|
|
84
84
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../../files/website/hooks/sigv4'), (0, devkit_1.joinPathFragments)(frontendProjectConfig.sourceRoot, 'hooks'), {}, {
|
|
85
85
|
overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting,
|
|
86
86
|
});
|
|
@@ -121,7 +121,7 @@ const addOpenApiReactClient = async (tree, { apiName, frontendProjectConfig, bac
|
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
(0, devkit_1.addDependenciesToPackageJson)(tree, (0, versions_1.withVersions)([
|
|
124
|
-
...(auth === '
|
|
124
|
+
...(auth === 'iam'
|
|
125
125
|
? [
|
|
126
126
|
'oidc-client-ts',
|
|
127
127
|
'react-oidc-context',
|
|
@@ -129,7 +129,7 @@ const addOpenApiReactClient = async (tree, { apiName, frontendProjectConfig, bac
|
|
|
129
129
|
'aws4fetch',
|
|
130
130
|
]
|
|
131
131
|
: []),
|
|
132
|
-
...(auth === '
|
|
132
|
+
...(auth === 'cognito' ? ['react-oidc-context'] : []),
|
|
133
133
|
'@tanstack/react-query',
|
|
134
134
|
'@tanstack/react-query-devtools',
|
|
135
135
|
]), (0, versions_1.withVersions)(['@smithy/types']));
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Tree } from '@nx/devkit';
|
|
6
6
|
export declare const CONTAINER_ENGINES: readonly ["docker", "finch"];
|
|
7
|
-
export type
|
|
8
|
-
export type
|
|
7
|
+
export type Containers = (typeof CONTAINER_ENGINES)[number];
|
|
8
|
+
export type ContainersOption = Containers | 'inherit';
|
|
9
9
|
/**
|
|
10
10
|
* Configuration for container tooling
|
|
11
11
|
*/
|
|
@@ -13,17 +13,17 @@ export interface ContainersConfig {
|
|
|
13
13
|
/**
|
|
14
14
|
* Container engine used for build/push/login operations
|
|
15
15
|
*/
|
|
16
|
-
engine:
|
|
16
|
+
engine: Containers;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Detect which container engine is available on the host. Prefers docker;
|
|
20
20
|
* falls back to finch when only finch is installed; defaults to docker
|
|
21
21
|
* when neither is found.
|
|
22
22
|
*/
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const inferContainers: () => Containers;
|
|
24
24
|
/**
|
|
25
25
|
* Given a container engine option, resolve the actual engine to use.
|
|
26
26
|
* `Inherit` reads the value from the workspace plugin config, defaulting
|
|
27
27
|
* to docker when nothing has been configured.
|
|
28
28
|
*/
|
|
29
|
-
export declare const
|
|
29
|
+
export declare const resolveContainers: (tree: Tree, option: ContainersOption) => Promise<Containers>;
|
package/src/utils/containers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.resolveContainers = exports.inferContainers = exports.CONTAINER_ENGINES = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
const utils_1 = require("./config/utils");
|
|
6
6
|
exports.CONTAINER_ENGINES = ['docker', 'finch'];
|
|
@@ -19,21 +19,21 @@ const isOnPath = (binary) => {
|
|
|
19
19
|
* falls back to finch when only finch is installed; defaults to docker
|
|
20
20
|
* when neither is found.
|
|
21
21
|
*/
|
|
22
|
-
const
|
|
22
|
+
const inferContainers = () => {
|
|
23
23
|
if (isOnPath('docker'))
|
|
24
24
|
return 'docker';
|
|
25
25
|
if (isOnPath('finch'))
|
|
26
26
|
return 'finch';
|
|
27
27
|
return 'docker';
|
|
28
28
|
};
|
|
29
|
-
exports.
|
|
29
|
+
exports.inferContainers = inferContainers;
|
|
30
30
|
/**
|
|
31
31
|
* Given a container engine option, resolve the actual engine to use.
|
|
32
32
|
* `Inherit` reads the value from the workspace plugin config, defaulting
|
|
33
33
|
* to docker when nothing has been configured.
|
|
34
34
|
*/
|
|
35
|
-
const
|
|
36
|
-
if (option === '
|
|
35
|
+
const resolveContainers = async (tree, option) => {
|
|
36
|
+
if (option === 'inherit') {
|
|
37
37
|
const pluginConfig = await (0, utils_1.readAwsNxPluginConfig)(tree);
|
|
38
38
|
const engine = pluginConfig?.containers?.engine ?? 'docker';
|
|
39
39
|
if (!exports.CONTAINER_ENGINES.includes(engine)) {
|
|
@@ -43,5 +43,5 @@ const resolveContainerEngine = async (tree, option) => {
|
|
|
43
43
|
}
|
|
44
44
|
return option;
|
|
45
45
|
};
|
|
46
|
-
exports.
|
|
46
|
+
exports.resolveContainers = resolveContainers;
|
|
47
47
|
//# sourceMappingURL=containers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containers.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/containers.ts"],"names":[],"mappings":";;;AAKA,iDAAyC;AACzC,0CAGwB;AAEX,QAAA,iBAAiB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU,CAAC;AAgB9D,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAW,EAAE;IAC3C,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;QACpE,IAAA,wBAAQ,EAAC,GAAG,KAAK,IAAI,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAEF;;;;GAIG;AACI,MAAM,
|
|
1
|
+
{"version":3,"file":"containers.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/containers.ts"],"names":[],"mappings":";;;AAKA,iDAAyC;AACzC,0CAGwB;AAEX,QAAA,iBAAiB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU,CAAC;AAgB9D,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAW,EAAE;IAC3C,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;QACpE,IAAA,wBAAQ,EAAC,GAAG,KAAK,IAAI,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAEF;;;;GAIG;AACI,MAAM,eAAe,GAAG,GAAe,EAAE;IAC9C,IAAI,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC;IACxC,IAAI,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IACtC,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAJW,QAAA,eAAe,mBAI1B;AAEF;;;;GAIG;AACI,MAAM,iBAAiB,GAAG,KAAK,EACpC,IAAU,EACV,MAAwB,EACH,EAAE;IACvB,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,YAAY,GAAG,MAAM,IAAA,6BAAqB,EAAC,IAAI,CAAC,CAAC;QACvD,MAAM,MAAM,GAAG,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,QAAQ,CAAC;QAC5D,IAAI,CAAC,yBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,KAAK,CACb,wBAAwB,sCAA8B,mBAAmB,yBAAiB,CAAC,IAAI,CAC7F,IAAI,CACL,EAAE,CACJ,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAjBW,QAAA,iBAAiB,qBAiB5B"}
|
|
@@ -3,7 +3,7 @@ import * as url from 'url';
|
|
|
3
3
|
import { Code, Function, Runtime, Tracing } from 'aws-cdk-lib/aws-lambda';
|
|
4
4
|
import { Duration } from 'aws-cdk-lib';
|
|
5
5
|
|
|
6
|
-
export class <%=
|
|
6
|
+
export class <%= nameClassName %> extends Function {
|
|
7
7
|
constructor(scope: Construct, id: string) {
|
|
8
8
|
super(scope, id, {
|
|
9
9
|
timeout: Duration.seconds(30),
|