@aws/nx-plugin 0.49.0 → 0.50.0
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 +22 -1
- package/package.json +1 -1
- package/sdk/ts.d.ts +2 -0
- package/sdk/ts.js +6 -3
- package/sdk/ts.js.map +1 -1
- package/src/api-connection/generator.d.ts +2 -2
- package/src/api-connection/generator.js +20 -0
- package/src/api-connection/generator.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +124 -14
- package/src/infra/app/files/app/README.md.template +5 -5
- package/src/infra/app/files/app/checkov.yml.template +12 -0
- package/src/infra/app/files/app/src/main.ts.template +2 -4
- package/src/infra/app/generator.js +13 -8
- package/src/infra/app/generator.js.map +1 -1
- package/src/infra/app/schema.d.ts +0 -8
- package/src/infra/app/schema.json +0 -16
- package/src/license/config.js +3 -3
- package/src/license/config.js.map +1 -1
- package/src/open-api/ts-hooks/__snapshots__/generator.spec.tsx.snap +114 -0
- package/src/open-api/ts-hooks/generator.spec.tsx +176 -0
- package/src/open-api/utils/codegen-data.js +42 -5
- package/src/open-api/utils/codegen-data.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +2 -0
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +55 -2
- package/src/py/fast-api/generator.js +8 -55
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/react/generator.js +9 -111
- package/src/py/fast-api/react/generator.js.map +1 -1
- package/src/py/lambda-function/generator.js +1 -1
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +3 -2
- package/src/py/mcp-server/generator.js +1 -1
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/strands-agent/__snapshots__/generator.spec.ts.snap +3 -2
- package/src/py/strands-agent/generator.js +1 -1
- package/src/py/strands-agent/generator.js.map +1 -1
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +576 -0
- package/src/smithy/project/files/build.Dockerfile.template +97 -0
- package/src/smithy/project/files/smithy-build.json.template +25 -0
- package/src/smithy/project/files/src/main.smithy.template +19 -0
- package/src/smithy/project/files/src/operations/echo.smithy.template +18 -0
- package/src/smithy/project/generator.d.ts +10 -0
- package/src/smithy/project/generator.js +70 -0
- package/src/smithy/project/generator.js.map +1 -0
- package/src/smithy/project/schema.d.ts +11 -0
- package/src/smithy/project/schema.json +42 -0
- package/src/smithy/react-connection/__snapshots__/generator.spec.ts.snap +270 -0
- package/src/smithy/react-connection/files/model/extensions.smithy.template +33 -0
- package/src/smithy/react-connection/generator.d.ts +10 -0
- package/src/smithy/react-connection/generator.js +100 -0
- package/src/smithy/react-connection/generator.js.map +1 -0
- package/src/smithy/react-connection/schema.d.ts +8 -0
- package/src/smithy/react-connection/schema.json +26 -0
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +3023 -0
- package/src/smithy/ts/api/files/context.ts.template +12 -0
- package/src/smithy/ts/api/files/handler.ts.template +50 -0
- package/src/smithy/ts/api/files/index.ts.template +0 -0
- package/src/smithy/ts/api/files/local-server.ts.template +41 -0
- package/src/smithy/ts/api/files/operations/echo.ts.template +7 -0
- package/src/smithy/ts/api/files/service.ts.template +8 -0
- package/src/smithy/ts/api/generator.d.ts +10 -0
- package/src/smithy/ts/api/generator.js +154 -0
- package/src/smithy/ts/api/generator.js.map +1 -0
- package/src/smithy/ts/api/schema.d.ts +14 -0
- package/src/smithy/ts/api/schema.json +56 -0
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +61 -2
- package/src/trpc/backend/generator.js +6 -20
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.ts +2 -1
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/lambda-function/generator.js +10 -10
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lib/eslint.d.ts +7 -0
- package/src/ts/lib/eslint.js +37 -29
- package/src/ts/lib/eslint.js.map +1 -1
- package/src/ts/lib/generator.js +2 -2
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +3 -2
- package/src/ts/mcp-server/files/Dockerfile.template +1 -1
- package/src/ts/mcp-server/generator.js +20 -14
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/ts/nx-generator/generator.js +3 -2
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +264 -3
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +10 -0
- package/src/utils/__snapshots__/shared-constructs.spec.ts.snap +49 -0
- package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +1 -1
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +1 -1
- package/src/utils/api-connection/open-api/react.d.ts +43 -0
- package/src/utils/api-connection/open-api/react.js +132 -0
- package/src/utils/api-connection/open-api/react.js.map +1 -0
- package/src/utils/api-constructs/api-constructs.d.ts +6 -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 +4 -4
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +7 -4
- package/src/utils/api-constructs/files/cdk/core/api/http/http-api.ts.template +37 -2
- package/src/utils/api-constructs/files/cdk/core/api/rest/rest-api.ts.template +15 -0
- package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +1 -1
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +1 -1
- package/src/utils/api-constructs/open-api-metadata.d.ts +17 -0
- package/src/utils/api-constructs/open-api-metadata.js +68 -0
- package/src/utils/api-constructs/open-api-metadata.js.map +1 -0
- package/src/utils/bundle/bundle.d.ts +35 -0
- package/src/utils/bundle/bundle.js +107 -0
- package/src/utils/bundle/bundle.js.map +1 -0
- package/src/utils/bundle/files/ts/rolldown.config.ts.template +3 -0
- package/src/utils/files/common/constructs/src/core/checkov.ts.template +44 -0
- package/src/utils/files/common/constructs/src/core/index.ts.template +1 -0
- package/src/utils/fs.d.ts +16 -0
- package/src/utils/fs.js +32 -0
- package/src/utils/fs.js.map +1 -0
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +8 -0
- package/src/utils/nx.d.ts +10 -3
- package/src/utils/nx.js +18 -3
- package/src/utils/nx.js.map +1 -1
- package/src/utils/versions.d.ts +6 -2
- package/src/utils/versions.js +5 -1
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/cdk/core/static-website.ts.template +56 -2
- package/src/infra/app/files/common/constructs/src/core/cfn-guard-rules/aws-prototyping.guard +0 -1282
- package/src/infra/app/files/common/constructs/src/core/cfn-guard-rules/cfn-nag.guard +0 -6839
- package/src/infra/app/files/common/constructs/src/core/cfn-guard-rules/hipaa-security.guard +0 -2807
- package/src/infra/app/files/common/constructs/src/core/cfn-guard-rules/nist-csf.guard +0 -2585
- package/src/infra/app/files/common/constructs/src/core/cfn-guard-rules/pci-dss-3-2-1.guard +0 -2236
- package/src/infra/app/files/common/constructs/src/core/cfn-guard-rules/wa-reliability-pillar.guard +0 -885
- package/src/infra/app/files/common/constructs/src/core/cfn-guard-rules/wa-security-pillar.guard +0 -2205
- package/src/infra/app/files/common/constructs/src/core/cfn-guard.ts.template +0 -67
- package/src/utils/bundle.d.ts +0 -16
- package/src/utils/bundle.js +0 -48
- package/src/utils/bundle.js.map +0 -1
- package/src/utils/esbuild.d.ts +0 -15
- package/src/utils/esbuild.js +0 -46
- package/src/utils/esbuild.js.map +0 -1
- /package/src/{py/fast-api/react/files/website → utils/api-connection/open-api/files}/components/__apiNameClassName__Provider.tsx.template +0 -0
- /package/src/{py/fast-api/react/files/website → utils/api-connection/open-api/files}/hooks/use__apiNameClassName__.tsx.template +0 -0
- /package/src/{py/fast-api/react/files/website → utils/api-connection/open-api/files}/hooks/use__apiNameClassName__Client.tsx.template +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IConstruct } from 'constructs';
|
|
2
|
+
import { CfnResource } from 'aws-cdk-lib';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Suppresses a set of rules for a construct tree.
|
|
6
|
+
*
|
|
7
|
+
* @param construct The root construct to suppress the rule for.
|
|
8
|
+
* @param ids The ids of the rules to suppress.
|
|
9
|
+
* @param comment The reason for suppressing the rule
|
|
10
|
+
* @param predicate A predicate function that determines whether the rule should be suppressed for the given construct or any of its descendants.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* The following example suppresses the CKV_AWS_XXX rule for the given construct.
|
|
14
|
+
* suppressRules(construct, ['CKV_AWS_XXX'], 'Not required for this use case')
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* The following example suppresses the CKV_AWS_XXX rule for the construct or any of its descendants if it is an instance of Bucket:
|
|
18
|
+
* suppressRules(construct, ['CKV_AWS_XXX'], 'Not required for this use case', (construct) => construct instanceof Bucket)
|
|
19
|
+
*/
|
|
20
|
+
export const suppressRules = (
|
|
21
|
+
construct: IConstruct,
|
|
22
|
+
ids: string[],
|
|
23
|
+
comment: string,
|
|
24
|
+
predicate?: (construct: IConstruct) => boolean,
|
|
25
|
+
) => {
|
|
26
|
+
const resources = (
|
|
27
|
+
predicate ? construct.node.findAll().filter(predicate) : [construct]
|
|
28
|
+
)
|
|
29
|
+
.map((resource) => {
|
|
30
|
+
if (CfnResource.isCfnResource(resource)) {
|
|
31
|
+
return resource;
|
|
32
|
+
} else return resource.node.defaultChild;
|
|
33
|
+
})
|
|
34
|
+
.filter((resource) => CfnResource.isCfnResource(resource));
|
|
35
|
+
|
|
36
|
+
resources.forEach((resource) => {
|
|
37
|
+
const metadata = resource.getMetadata('checkov') || {};
|
|
38
|
+
metadata['skip'] = [
|
|
39
|
+
...(metadata['skip'] ?? []),
|
|
40
|
+
...ids.map((id) => ({ id, comment })),
|
|
41
|
+
];
|
|
42
|
+
resource.addMetadata('checkov', metadata);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
/**
|
|
7
|
+
* Utility class for creating platform agnostic commands for filesystem operations.
|
|
8
|
+
* Adds the required dependencies to the root package json
|
|
9
|
+
*/
|
|
10
|
+
export declare class FsCommands {
|
|
11
|
+
private tree;
|
|
12
|
+
constructor(tree: Tree);
|
|
13
|
+
cp(src: string, dst: string): string;
|
|
14
|
+
rm(dir: string): string;
|
|
15
|
+
mkdir(dir: string): string;
|
|
16
|
+
}
|
package/src/utils/fs.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FsCommands = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
+
*/
|
|
8
|
+
const devkit_1 = require("@nx/devkit");
|
|
9
|
+
const versions_1 = require("./versions");
|
|
10
|
+
/**
|
|
11
|
+
* Utility class for creating platform agnostic commands for filesystem operations.
|
|
12
|
+
* Adds the required dependencies to the root package json
|
|
13
|
+
*/
|
|
14
|
+
class FsCommands {
|
|
15
|
+
constructor(tree) {
|
|
16
|
+
this.tree = tree;
|
|
17
|
+
}
|
|
18
|
+
cp(src, dst) {
|
|
19
|
+
(0, devkit_1.addDependenciesToPackageJson)(this.tree, {}, (0, versions_1.withVersions)(['ncp']));
|
|
20
|
+
return `ncp ${src} ${dst}`;
|
|
21
|
+
}
|
|
22
|
+
rm(dir) {
|
|
23
|
+
(0, devkit_1.addDependenciesToPackageJson)(this.tree, {}, (0, versions_1.withVersions)(['rimraf']));
|
|
24
|
+
return `rimraf ${dir}`;
|
|
25
|
+
}
|
|
26
|
+
mkdir(dir) {
|
|
27
|
+
(0, devkit_1.addDependenciesToPackageJson)(this.tree, {}, (0, versions_1.withVersions)(['make-dir-cli']));
|
|
28
|
+
return `make-dir ${dir}`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.FsCommands = FsCommands;
|
|
32
|
+
//# sourceMappingURL=fs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/fs.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAAgE;AAChE,yCAA0C;AAE1C;;;GAGG;AACH,MAAa,UAAU;IAGrB,YAAY,IAAU;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEM,EAAE,CAAC,GAAW,EAAE,GAAW;QAChC,IAAA,qCAA4B,EAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,IAAA,uBAAY,EAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACnE,OAAO,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAC7B,CAAC;IAEM,EAAE,CAAC,GAAW;QACnB,IAAA,qCAA4B,EAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,IAAA,uBAAY,EAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACtE,OAAO,UAAU,GAAG,EAAE,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,GAAW;QACtB,IAAA,qCAA4B,EAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,IAAA,uBAAY,EAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QAC5E,OAAO,YAAY,GAAG,EAAE,CAAC;IAC3B,CAAC;CACF;AArBD,gCAqBC"}
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
import { Construct } from 'constructs';
|
|
17
17
|
import { RuntimeConfig } from './runtime-config.js';
|
|
18
18
|
import { Distribution } from 'aws-cdk-lib/aws-cloudfront';
|
|
19
|
+
import { suppressRules } from './checkov.js';
|
|
19
20
|
|
|
20
21
|
const WEB_CLIENT_ID = 'WebClient';
|
|
21
22
|
/**
|
|
@@ -52,6 +53,13 @@ export class UserIdentity extends Construct {
|
|
|
52
53
|
userPoolWebClientId: this.userPoolClient.userPoolClientId,
|
|
53
54
|
};
|
|
54
55
|
|
|
56
|
+
suppressRules(
|
|
57
|
+
this.userPool,
|
|
58
|
+
['CKV_AWS_111'],
|
|
59
|
+
'SMS Role requires wildcard resource',
|
|
60
|
+
(c) => c.node.path.includes('/smsRole/'),
|
|
61
|
+
);
|
|
62
|
+
|
|
55
63
|
new CfnOutput(this, `${id}-UserPoolId`, {
|
|
56
64
|
value: this.userPool.userPoolId,
|
|
57
65
|
});
|
package/src/utils/nx.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { Tree } from '@nx/devkit';
|
|
5
|
+
import { ProjectConfiguration, Tree } from '@nx/devkit';
|
|
6
6
|
export interface NxGeneratorInfo {
|
|
7
7
|
readonly id: string;
|
|
8
8
|
readonly metric: string;
|
|
@@ -25,8 +25,15 @@ export declare const getPackageVersion: () => string;
|
|
|
25
25
|
/**
|
|
26
26
|
* Read a project configuration where the project name may not be fully qualified (ie may omit the scope prefix)
|
|
27
27
|
*/
|
|
28
|
-
export declare const readProjectConfigurationUnqualified: (tree: Tree, projectName: string) =>
|
|
28
|
+
export declare const readProjectConfigurationUnqualified: (tree: Tree, projectName: string) => ProjectConfiguration;
|
|
29
29
|
/**
|
|
30
30
|
* Add metadata about the generator to the project.json
|
|
31
31
|
*/
|
|
32
|
-
export declare const addGeneratorMetadata: (tree: Tree, projectName: string, info: NxGeneratorInfo
|
|
32
|
+
export declare const addGeneratorMetadata: (tree: Tree, projectName: string, info: NxGeneratorInfo, additionalMetadata?: {
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Mutate the project to add the dependency to the target if not already present
|
|
37
|
+
* Adds the target if not present.
|
|
38
|
+
*/
|
|
39
|
+
export declare const addDependencyToTargetIfNotPresent: (project: ProjectConfiguration, target: string, dependency: string) => void;
|
package/src/utils/nx.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addGeneratorMetadata = exports.readProjectConfigurationUnqualified = exports.getPackageVersion = exports.getGeneratorInfo = exports.listGenerators = void 0;
|
|
3
|
+
exports.addDependencyToTargetIfNotPresent = exports.addGeneratorMetadata = exports.readProjectConfigurationUnqualified = exports.getPackageVersion = exports.getGeneratorInfo = exports.listGenerators = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
/**
|
|
6
6
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
@@ -62,9 +62,24 @@ exports.readProjectConfigurationUnqualified = readProjectConfigurationUnqualifie
|
|
|
62
62
|
/**
|
|
63
63
|
* Add metadata about the generator to the project.json
|
|
64
64
|
*/
|
|
65
|
-
const addGeneratorMetadata = (tree, projectName, info) => {
|
|
65
|
+
const addGeneratorMetadata = (tree, projectName, info, additionalMetadata) => {
|
|
66
66
|
const config = (0, exports.readProjectConfigurationUnqualified)(tree, projectName);
|
|
67
|
-
(0, devkit_1.updateProjectConfiguration)(tree, config.name, Object.assign(Object.assign({}, config), { metadata: Object.assign(Object.assign({}, config === null || config === void 0 ? void 0 : config.metadata), { generator: info.id }) }));
|
|
67
|
+
(0, devkit_1.updateProjectConfiguration)(tree, config.name, Object.assign(Object.assign({}, config), { metadata: Object.assign(Object.assign(Object.assign({}, config === null || config === void 0 ? void 0 : config.metadata), { generator: info.id }), additionalMetadata) }));
|
|
68
68
|
};
|
|
69
69
|
exports.addGeneratorMetadata = addGeneratorMetadata;
|
|
70
|
+
/**
|
|
71
|
+
* Mutate the project to add the dependency to the target if not already present
|
|
72
|
+
* Adds the target if not present.
|
|
73
|
+
*/
|
|
74
|
+
const addDependencyToTargetIfNotPresent = (project, target, dependency) => {
|
|
75
|
+
var _a, _b, _c;
|
|
76
|
+
var _d;
|
|
77
|
+
(_a = project.targets) !== null && _a !== void 0 ? _a : (project.targets = {});
|
|
78
|
+
(_b = (_d = project.targets)[target]) !== null && _b !== void 0 ? _b : (_d[target] = {});
|
|
79
|
+
project.targets[target].dependsOn = [
|
|
80
|
+
...((_c = project.targets[target].dependsOn) !== null && _c !== void 0 ? _c : []).filter((d) => d !== dependency),
|
|
81
|
+
dependency,
|
|
82
|
+
];
|
|
83
|
+
};
|
|
84
|
+
exports.addDependencyToTargetIfNotPresent = addDependencyToTargetIfNotPresent;
|
|
70
85
|
//# sourceMappingURL=nx.js.map
|
package/src/utils/nx.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nx.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/nx.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"nx.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/nx.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCAMoB;AACpB,oFAAmD;AACnD,8EAA6C;AAC7C,mDAA6B;AAC7B,2CAA6D;AAC7D,mCAAsC;AAYtC,MAAM,UAAU,GAAsB,MAAM,CAAC,OAAO,CAClD,yBAAc,CAAC,UAAU,CAC1B,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CA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AE,IAAI,CAAC,EAAE,KACf,kBAAkB,CACf,IACR,CAAC;AACL,CAAC,CAAC;AAfW,QAAA,oBAAoB,wBAe/B;AAEF;;;GAGG;AACI,MAAM,iCAAiC,GAAG,CAC/C,OAA6B,EAC7B,MAAc,EACd,UAAkB,EAClB,EAAE;;;IACF,MAAA,OAAO,CAAC,OAAO,oCAAf,OAAO,CAAC,OAAO,GAAK,EAAE,EAAC;IACvB,YAAA,OAAO,CAAC,OAAO,EAAC,MAAM,wCAAN,MAAM,IAAM,EAAE,EAAC;IAC/B,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,GAAG;QAClC,GAAG,CAAC,MAAA,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,mCAAI,EAAE,CAAC,CAAC,MAAM,CACjD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,UAAU,CACxB;QACD,UAAU;KACX,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,iCAAiC,qCAa5C"}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
* Versons for TypeScript dependencies added by generators
|
|
7
7
|
*/
|
|
8
8
|
export declare const TS_VERSIONS: {
|
|
9
|
-
readonly '@cdklabs/cdk-validator-cfnguard': "0.0.60";
|
|
10
9
|
readonly '@aws-sdk/client-cognito-identity': "3.876.0";
|
|
11
10
|
readonly '@aws-sdk/credential-providers': "3.876.0";
|
|
12
11
|
readonly '@aws-sdk/credential-provider-cognito-identity': "3.876.0";
|
|
13
12
|
readonly '@aws-sdk/client-bedrock-agentcore-control': "3.876.0";
|
|
13
|
+
readonly '@aws-smithy/server-apigateway': "1.0.0-alpha.10";
|
|
14
|
+
readonly '@aws-smithy/server-node': "1.0.0-alpha.10";
|
|
14
15
|
readonly '@aws-lambda-powertools/logger': "2.25.2";
|
|
15
16
|
readonly '@aws-lambda-powertools/metrics': "2.25.2";
|
|
16
17
|
readonly '@aws-lambda-powertools/tracer': "2.25.2";
|
|
@@ -50,9 +51,12 @@ export declare const TS_VERSIONS: {
|
|
|
50
51
|
readonly express: "5.1.0";
|
|
51
52
|
readonly 'jsonc-eslint-parser': "2.4.0";
|
|
52
53
|
readonly 'make-dir-cli': "4.0.0";
|
|
54
|
+
readonly ncp: "2.0.0";
|
|
53
55
|
readonly 'oidc-client-ts': "3.3.0";
|
|
54
56
|
readonly prettier: "3.6.2";
|
|
55
57
|
readonly 'react-oidc-context': "3.3.0";
|
|
58
|
+
readonly rimraf: "6.0.1";
|
|
59
|
+
readonly rolldown: "1.0.0-beta.38";
|
|
56
60
|
readonly 'source-map-support': "0.5.21";
|
|
57
61
|
readonly tailwindcss: "4.1.12";
|
|
58
62
|
readonly '@tailwindcss/vite': "4.1.12";
|
|
@@ -66,7 +70,7 @@ export type ITsDepVersion = keyof typeof TS_VERSIONS;
|
|
|
66
70
|
* Add versions to the given dependencies
|
|
67
71
|
*/
|
|
68
72
|
export declare const withVersions: (deps: ITsDepVersion[]) => {
|
|
69
|
-
[k: string]: "
|
|
73
|
+
[k: string]: "3.876.0" | "1.0.0-alpha.10" | "2.25.2" | "6.4.4" | "21.2.0" | "9.0.0" | "21.4.1" | "1.17.4" | "0.16.5" | "1.131.28" | "1.131.2" | "3.0.117" | "3.0.1075" | "1.0.45" | "5.87.4" | "11.0.0" | "22.18.0" | "8.10.152" | "2.8.19" | "5.0.3" | "4.3.2" | "1.0.20" | "2.1027.0" | "2.213.0" | "3.10.3" | "10.4.2" | "2.8.5" | "0.25.9" | "5.5.4" | "5.1.0" | "2.4.0" | "4.0.0" | "2.0.0" | "3.3.0" | "3.6.2" | "6.0.1" | "1.0.0-beta.38" | "0.5.21" | "4.1.12" | "4.20.1" | "5.1.4" | "4.1.5" | "npm:zod@^3";
|
|
70
74
|
};
|
|
71
75
|
/**
|
|
72
76
|
* Versions for Python dependencies added by generators
|
package/src/utils/versions.js
CHANGED
|
@@ -9,11 +9,12 @@ exports.withPyVersions = exports.PY_VERSIONS = exports.withVersions = exports.TS
|
|
|
9
9
|
* Versons for TypeScript dependencies added by generators
|
|
10
10
|
*/
|
|
11
11
|
exports.TS_VERSIONS = {
|
|
12
|
-
'@cdklabs/cdk-validator-cfnguard': '0.0.60',
|
|
13
12
|
'@aws-sdk/client-cognito-identity': '3.876.0',
|
|
14
13
|
'@aws-sdk/credential-providers': '3.876.0',
|
|
15
14
|
'@aws-sdk/credential-provider-cognito-identity': '3.876.0',
|
|
16
15
|
'@aws-sdk/client-bedrock-agentcore-control': '3.876.0',
|
|
16
|
+
'@aws-smithy/server-apigateway': '1.0.0-alpha.10',
|
|
17
|
+
'@aws-smithy/server-node': '1.0.0-alpha.10',
|
|
17
18
|
'@aws-lambda-powertools/logger': '2.25.2',
|
|
18
19
|
'@aws-lambda-powertools/metrics': '2.25.2',
|
|
19
20
|
'@aws-lambda-powertools/tracer': '2.25.2',
|
|
@@ -53,9 +54,12 @@ exports.TS_VERSIONS = {
|
|
|
53
54
|
express: '5.1.0',
|
|
54
55
|
'jsonc-eslint-parser': '2.4.0',
|
|
55
56
|
'make-dir-cli': '4.0.0',
|
|
57
|
+
ncp: '2.0.0',
|
|
56
58
|
'oidc-client-ts': '3.3.0',
|
|
57
59
|
prettier: '3.6.2',
|
|
58
60
|
'react-oidc-context': '3.3.0',
|
|
61
|
+
rimraf: '6.0.1',
|
|
62
|
+
rolldown: '1.0.0-beta.38',
|
|
59
63
|
'source-map-support': '0.5.21',
|
|
60
64
|
tailwindcss: '4.1.12',
|
|
61
65
|
'@tailwindcss/vite': '4.1.12',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/versions.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACU,QAAA,WAAW,GAAG;IACzB,
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/versions.ts"],"names":[],"mappings":";AA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BACsB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CfnOutput, RemovalPolicy, Stack } from 'aws-cdk-lib';
|
|
1
|
+
import { CfnOutput, CfnResource, RemovalPolicy, Stack } from 'aws-cdk-lib';
|
|
2
2
|
import { Distribution, ViewerProtocolPolicy } from 'aws-cdk-lib/aws-cloudfront';
|
|
3
3
|
import { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
4
4
|
import {
|
|
@@ -13,6 +13,8 @@ import { Construct } from 'constructs';
|
|
|
13
13
|
import { RuntimeConfig } from './runtime-config.js';
|
|
14
14
|
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
15
15
|
import { CfnWebACL } from 'aws-cdk-lib/aws-wafv2';
|
|
16
|
+
import { suppressRules } from './checkov.js';
|
|
17
|
+
|
|
16
18
|
const DEFAULT_RUNTIME_CONFIG_FILENAME = 'runtime-config.json';
|
|
17
19
|
|
|
18
20
|
export interface StaticWebsiteProps {
|
|
@@ -59,6 +61,17 @@ export class StaticWebsite extends Construct {
|
|
|
59
61
|
publicReadAccess: false,
|
|
60
62
|
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
61
63
|
});
|
|
64
|
+
suppressRules(
|
|
65
|
+
accessLogsBucket,
|
|
66
|
+
['CKV_AWS_21'],
|
|
67
|
+
'Access log bucket does not need versioning enabled',
|
|
68
|
+
);
|
|
69
|
+
suppressRules(
|
|
70
|
+
accessLogsBucket,
|
|
71
|
+
['CKV_AWS_18'],
|
|
72
|
+
'Access log bucket does not need an access log bucket',
|
|
73
|
+
);
|
|
74
|
+
|
|
62
75
|
// S3 Bucket to hold website files
|
|
63
76
|
this.websiteBucket = new Bucket(this, 'WebsiteBucket', {
|
|
64
77
|
versioned: true,
|
|
@@ -89,6 +102,12 @@ export class StaticWebsite extends Construct {
|
|
|
89
102
|
serverAccessLogsPrefix: 'distribution-access-logs',
|
|
90
103
|
serverAccessLogsBucket: accessLogsBucket,
|
|
91
104
|
});
|
|
105
|
+
suppressRules(
|
|
106
|
+
logBucket,
|
|
107
|
+
['CKV_AWS_21'],
|
|
108
|
+
'Distribution log bucket does not need versioning enabled',
|
|
109
|
+
);
|
|
110
|
+
|
|
92
111
|
const defaultRootObject = 'index.html';
|
|
93
112
|
this.cloudFrontDistribution = new Distribution(
|
|
94
113
|
this,
|
|
@@ -114,8 +133,14 @@ export class StaticWebsite extends Construct {
|
|
|
114
133
|
responsePagePath: `/${defaultRootObject}`,
|
|
115
134
|
},
|
|
116
135
|
],
|
|
117
|
-
}
|
|
136
|
+
},
|
|
118
137
|
);
|
|
138
|
+
suppressRules(
|
|
139
|
+
this.cloudFrontDistribution,
|
|
140
|
+
['CKV_AWS_174'],
|
|
141
|
+
'Cloudfront default certificate does not use TLS 1.2',
|
|
142
|
+
);
|
|
143
|
+
|
|
119
144
|
// Deploy Website
|
|
120
145
|
this.bucketDeployment = new BucketDeployment(this, 'WebsiteDeployment', {
|
|
121
146
|
sources: [
|
|
@@ -130,6 +155,17 @@ export class StaticWebsite extends Construct {
|
|
|
130
155
|
distribution: this.cloudFrontDistribution,
|
|
131
156
|
memoryLimit: 1024,
|
|
132
157
|
});
|
|
158
|
+
|
|
159
|
+
suppressRules(
|
|
160
|
+
Stack.of(this),
|
|
161
|
+
['CKV_AWS_111'],
|
|
162
|
+
'CDK Bucket Deployment uses wildcard to deploy arbitrary assets',
|
|
163
|
+
(c) =>
|
|
164
|
+
CfnResource.isCfnResource(c) &&
|
|
165
|
+
c.cfnResourceType === 'AWS::IAM::Policy' &&
|
|
166
|
+
c.node.path.includes(`/Custom::CDKBucketDeployment`),
|
|
167
|
+
);
|
|
168
|
+
|
|
133
169
|
new CfnOutput(this, 'DistributionDomainName', {
|
|
134
170
|
value: this.cloudFrontDistribution.domainName,
|
|
135
171
|
});
|
|
@@ -177,6 +213,24 @@ export class CloudfrontWebAcl extends Stack {
|
|
|
177
213
|
none: {},
|
|
178
214
|
},
|
|
179
215
|
},
|
|
216
|
+
{
|
|
217
|
+
name: 'KnownBadInputsRule',
|
|
218
|
+
priority: 1,
|
|
219
|
+
statement: {
|
|
220
|
+
managedRuleGroupStatement: {
|
|
221
|
+
name: 'AWSManagedRulesKnownBadInputsRuleSet',
|
|
222
|
+
vendorName: 'AWS',
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
visibilityConfig: {
|
|
226
|
+
cloudWatchMetricsEnabled: true,
|
|
227
|
+
metricName: 'MetricForWebACLCDK-CRS',
|
|
228
|
+
sampledRequestsEnabled: true,
|
|
229
|
+
},
|
|
230
|
+
overrideAction: {
|
|
231
|
+
none: {},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
180
234
|
],
|
|
181
235
|
}).attrArn;
|
|
182
236
|
}
|