-
Notifications
You must be signed in to change notification settings - Fork 85
/
infrastructure.ts
61 lines (54 loc) · 1.82 KB
/
infrastructure.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env node
import { App, Stack, StackProps } from 'aws-cdk-lib';
import { StaticSite } from './static-site';
import { RootDomainSite } from './root-domain-site';
interface TriviaGameInfrastructureStackProps extends StackProps {
domainName: string;
siteSubDomain: string;
}
class TriviaGameInfrastructureStack extends Stack {
constructor(parent: App, name: string, props: TriviaGameInfrastructureStackProps) {
super(parent, name, props);
new StaticSite(this, 'StaticSite', {
domainName: props.domainName,
siteSubDomain: props.siteSubDomain
});
}
}
interface TriviaGameRootDomainStackProps extends StackProps {
domainName: string;
}
class TriviaGameRootDomainStack extends Stack {
constructor(parent: App, name: string, props: TriviaGameRootDomainStackProps) {
super(parent, name, props);
new RootDomainSite(this, 'StaticSite', {
domainName: props.domainName,
originSubDomain: 'www'
});
}
}
const app = new App();
new TriviaGameInfrastructureStack(app, 'TriviaGameStaticSiteInfraTest', {
domainName: 'reinvent-trivia.com',
siteSubDomain: 'test',
env: { account: process.env['CDK_DEFAULT_ACCOUNT'], region: 'us-east-1' },
tags: {
project: "reinvent-trivia"
}
});
new TriviaGameInfrastructureStack(app, 'TriviaGameStaticSiteInfraProd', {
domainName: 'reinvent-trivia.com',
siteSubDomain: 'www',
env: { account: process.env['CDK_DEFAULT_ACCOUNT'], region: 'us-east-1' },
tags: {
project: "reinvent-trivia"
}
});
new TriviaGameRootDomainStack(app, 'TriviaGameRootDomainRedirectProd', {
domainName: 'reinvent-trivia.com',
env: { account: process.env['CDK_DEFAULT_ACCOUNT'], region: 'us-east-1' },
tags: {
project: "reinvent-trivia"
}
});
app.synth();