-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcache.ts
40 lines (34 loc) · 1.21 KB
/
cache.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
import { GitlabRunnerAutoscaling } from "@pepperize/cdk-autoscaling-gitlab-runner";
import { Stack } from "aws-cdk-lib";
import { Bucket } from "aws-cdk-lib/aws-s3";
import { ParameterTier, ParameterType, StringParameter } from "aws-cdk-lib/aws-ssm";
import { Construct } from "constructs";
import { RunnerStackProps } from "./runner-stack-props";
export interface WithCustomCacheBucketStackProps extends RunnerStackProps {}
export class CacheBucketStack extends Stack {
constructor(scope: Construct, id: string, props: WithCustomCacheBucketStackProps) {
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 cache = new Bucket(this, "Cache", {
// Your custom bucket
bucketName: "your-custom-bucket",
});
new GitlabRunnerAutoscaling(this, "Runner", {
runners: [
{
token: token,
configuration: {
name: "gitlab-runner-with-custom-cache-settings",
},
},
],
cache: { bucket: cache },
});
}
}