-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add another CDK app to test synth and deploy
- Loading branch information
1 parent
edd1d04
commit 45744e0
Showing
6 changed files
with
158 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/usr/bin/env node | ||
import { App, Environment } from 'aws-cdk-lib/core'; | ||
import 'source-map-support/register'; | ||
|
||
import { | ||
appName, | ||
resourceDescription, | ||
resourceId, | ||
stackName, | ||
stageName, | ||
ApiStack, | ||
AuthStack, | ||
CertificateStack, | ||
HostedZoneStack, | ||
UiStack, | ||
} from '../lib'; | ||
|
||
/* | ||
This application can be used to test stack changes before they are deployed by | ||
the production pipeline. See the cloud README for details. | ||
*/ | ||
|
||
const app = new App(); | ||
const generateStackName = stackName(app); | ||
const generateDescription = resourceDescription(app); | ||
|
||
/* Common stack resources */ | ||
|
||
// NOTE: Need DOMAIN_NAME and HOSTED_ZONE_ID env vars, see "cloud/.env.example" | ||
// If you have access to SpyLogic AWS account, these are viewable in Parameter Store. | ||
const env: Environment = { | ||
account: process.env.CDK_DEFAULT_ACCOUNT, | ||
region: process.env.CDK_DEFAULT_REGION, | ||
}; | ||
|
||
const tags = { | ||
owner: appName, | ||
stage: stageName(app), | ||
}; | ||
|
||
/* Stack constructs */ | ||
|
||
const hostedZoneStack = new HostedZoneStack(app, generateStackName('hostedzone'), { | ||
description: generateDescription('Hosted Zone stack'), | ||
env, | ||
tags, | ||
}); | ||
|
||
const certificateStack = new CertificateStack(app, generateStackName('certificate'), { | ||
description: generateDescription('Certificate stack'), | ||
env, | ||
tags, | ||
domainName: hostedZoneStack.topLevelDomain.value as string, | ||
hostedZone: hostedZoneStack.hostedZone, | ||
}); | ||
|
||
const authStack = new AuthStack(app, generateStackName('auth'), { | ||
description: generateDescription('Auth stack'), | ||
env, | ||
tags, | ||
domainName: hostedZoneStack.topLevelDomain.value as string, | ||
}); | ||
|
||
new ApiStack(app, generateStackName('api'), { | ||
description: generateDescription('API stack'), | ||
env, | ||
tags, | ||
apiDomainName: certificateStack.apiDomainName, | ||
certificate: certificateStack.loadBalancerCert, | ||
customAuthHeaderName: authStack.customAuthHeaderName, | ||
customAuthHeaderValue: authStack.customAuthHeaderValue, | ||
domainName: hostedZoneStack.topLevelDomain.value as string, | ||
hostedZone: hostedZoneStack.hostedZone, | ||
}); | ||
|
||
new UiStack(app, generateStackName('ui'), { | ||
description: generateDescription('UI stack'), | ||
env, | ||
tags, | ||
apiDomainName: certificateStack.apiDomainName, | ||
certificate: certificateStack.cloudFrontCert, | ||
customAuthHeaderName: authStack.customAuthHeaderName, | ||
customAuthHeaderValue: authStack.customAuthHeaderValue, | ||
domainName: hostedZoneStack.topLevelDomain.value as string, | ||
hostedZone: hostedZoneStack.hostedZone, | ||
hostBucketName: resourceId(app)('host-bucket'), | ||
parameterNameUserPoolClient: authStack.parameterNameUserPoolClient, | ||
parameterNameUserPoolId: authStack.parameterNameUserPoolId, | ||
}); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
export * from './resourceNamingUtils'; | ||
|
||
export { ApiStack } from './api-stack'; | ||
export { AuthStack } from './auth-stack'; | ||
export { CertificateStack } from './certificate-stack'; | ||
export { HostedZoneStack } from './hostedzone-stack'; | ||
export { UiStack } from './ui-stack'; | ||
|
||
export { PipelineAssistUsEast1Stack } from './pipeline-assist-useast1-stack'; | ||
export { PipelineStack } from './pipeline-stack'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters