-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathcdk.ts
More file actions
59 lines (51 loc) · 1.74 KB
/
cdk.ts
File metadata and controls
59 lines (51 loc) · 1.74 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from 'aws-cdk-lib';
import { MainStack } from '../lib/main-stack';
import { UsEast1Stack } from '../lib/us-east-1-stack';
const app = new cdk.App();
interface EnvironmentProps {
account: string;
/**
* Custom domain name for the webapp and Cognito.
* You need to have a public Route53 hosted zone for the domain name in your AWS account.
*
* @default No custom domain name. When not specified, the stack automatically generates
* a random prefix for the Cognito domain (e.g., webapp-abc123def4.auth.us-west-2.amazoncognito.com)
* and uses the CloudFront default domain (e.g., d1234567890.cloudfront.net) for the webapp.
*/
domainName?: string;
/**
* Use a NAT instance instead of NAT Gateways.
* @default true
*/
useNatInstance?: boolean;
}
const props: EnvironmentProps = {
account: process.env.CDK_DEFAULT_ACCOUNT!,
// domainName: 'FIXME.example.com',
useNatInstance: true,
};
const virginia = new UsEast1Stack(app, 'ServerlessWebappStarterKitUsEast1Stack', {
env: {
account: props.account,
region: 'us-east-1',
},
crossRegionReferences: true,
domainName: props.domainName,
});
new MainStack(app, 'ServerlessWebappStarterKitStack', {
env: {
account: props.account,
region: process.env.CDK_DEFAULT_REGION,
},
crossRegionReferences: true,
sharedCertificate: virginia.certificate,
domainName: props.domainName,
useNatInstance: props.useNatInstance,
signPayloadHandler: virginia.signPayloadHandler,
});
cdk.Tags.of(app).add('Application', 'ServerlessFullStackWebappStarterKit');
// import { Aspects } from 'aws-cdk-lib';
// import { AwsSolutionsChecks } from 'cdk-nag';
// Aspects.of(app).add(new AwsSolutionsChecks());