-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.ts
43 lines (38 loc) · 1.3 KB
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
*/
import { CdkGraph, FilterPreset, Filters } from "@aws/pdk/cdk-graph";
import { CdkGraphDiagramPlugin } from "@aws/pdk/cdk-graph-plugin-diagram";
import { CdkGraphThreatComposerPlugin } from "@aws/pdk/cdk-graph-plugin-threat-composer";
import { AwsPrototypingChecks, PDKNag } from "@aws/pdk/pdk-nag";
import { ApplicationStack } from "./stacks/application-stack";
import { applyNagSuppressions } from "./utils/nag-suppressions";
// for development, use account/region from cdk cli
const devEnv = {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION,
};
/* eslint-disable @typescript-eslint/no-floating-promises */
(async () => {
const app = PDKNag.app({
nagPacks: [new AwsPrototypingChecks()],
});
const mainStack = new ApplicationStack(app, "InfraDev", { env: devEnv });
applyNagSuppressions(mainStack);
const graph = new CdkGraph(app, {
plugins: [
new CdkGraphDiagramPlugin({
defaults: {
filterPlan: {
preset: FilterPreset.COMPACT,
filters: [{ store: Filters.pruneCustomResources() }],
},
},
}),
new CdkGraphThreatComposerPlugin(),
],
});
app.synth();
await graph.report();
})();