-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvpc.ts
39 lines (33 loc) · 1.12 KB
/
vpc.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
import { GitlabRunnerAutoscaling } from "@pepperize/cdk-autoscaling-gitlab-runner";
import { Stack } from "aws-cdk-lib";
import { Vpc } from "aws-cdk-lib/aws-ec2";
import { ParameterTier, ParameterType, StringParameter } from "aws-cdk-lib/aws-ssm";
import { Construct } from "constructs";
import { RunnerStackProps } from "./runner-stack-props";
export interface WithCustomVpcStackProps extends RunnerStackProps {}
export class VpcStack extends Stack {
constructor(scope: Construct, id: string, props: WithCustomVpcStackProps) {
super(scope, id, props);
const { gitlabToken } = props;
const token = new StringParameter(this, "Token", {
parameterName: "/gitlab-runner/token",
stringValue: gitlabToken,
type: ParameterType.SECURE_STRING,
tier: ParameterTier.STANDARD,
});
const vpc = new Vpc(this, "Vpc", {
// Your custom vpc
});
new GitlabRunnerAutoscaling(this, "Runner", {
runners: [
{
token: token,
configuration: {
name: "gitlab-runner-with-custom-vpc",
},
},
],
network: { vpc: vpc },
});
}
}