-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcdk-pipeline.ts
42 lines (34 loc) · 1.04 KB
/
cdk-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
31
32
33
34
35
36
37
38
39
40
41
42
import { Construct } from "constructs";
import * as cdk from "aws-cdk-lib";
import * as pipelines from "aws-cdk-lib/pipelines";
import * as accounts from "#/utils/accounts.js";
import { AppStage } from "#/stages/app.js";
import { InfraStage } from "#/stages/infra.js";
export interface CDKPipelineStackProps extends cdk.StackProps {
//
}
export class CDKPipelineStack extends cdk.Stack {
constructor(scope: Construct, id: string, props: CDKPipelineStackProps) {
super(scope, id, props);
const pipeline = new pipelines.CodePipeline(this, "Pipeline", {
crossAccountKeys: true,
synth: new pipelines.ShellStep("Synth", {
input: pipelines.CodePipelineSource.gitHub(
"dangreaves/template-cdk-project",
"main",
),
commands: ["npm ci", "npx cdk synth"],
}),
});
pipeline.addStage(
new InfraStage(this, "infra", {
env: accounts.root.env,
}),
);
pipeline.addStage(
new AppStage(this, "app", {
env: accounts.root.env,
}),
);
}
}