-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathapi-service-blue-green-pipeline.ts
30 lines (27 loc) · 1.26 KB
/
api-service-blue-green-pipeline.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
#!/usr/bin/env node
import { App, Stack, StackProps } from 'aws-cdk-lib';
import { TriviaGameContainersCfnPipeline } from './common/cfn-containers-pipeline';
/**
* Pipeline that builds a container image and deploys it to ECS using CloudFormation and CodeDeploy blue-green deployments.
* [Sources: GitHub source, ECR base image] -> [CodeBuild build] -> [CloudFormation Deploy Actions to 'test' stack] -> [CloudFormation Deploy Actions to 'prod' stack]
*/
class TriviaGameBackendBlueGreenPipelineStack extends Stack {
constructor(parent: App, name: string, props?: StackProps) {
super(parent, name, props);
new TriviaGameContainersCfnPipeline(this, 'Pipeline', {
pipelineNameSuffix: 'trivia-backend-cfn-blue-green-deploy',
stackNamePrefix: 'TriviaBackend',
templateNamePrefix: 'TriviaBackend',
buildspecLocation: 'trivia-backend/infra/cdk/buildspec-blue-green.yml',
pipelineCdkFileName: 'api-service-blue-green-pipeline',
});
}
}
const app = new App();
new TriviaGameBackendBlueGreenPipelineStack(app, 'TriviaGameBackendBlueGreenPipeline', {
env: { account: process.env['CDK_DEFAULT_ACCOUNT'], region: 'us-east-1' },
tags: {
project: 'reinvent-trivia'
}
});
app.synth();