Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 48da039

Browse files
fix(runners): upgrade aws sdk v2 to v3 (#3138)
* fix(runners): upgrade aws sdk v2 to v3 * migrate to v3 * refactor * refactor types for runners module * fix: added pagination for EC2 DescribeInstancesCommand. --------- Co-authored-by: Navdeep Gupta <[email protected]>
1 parent e53545c commit 48da039

File tree

9 files changed

+1023
-949
lines changed

9 files changed

+1023
-949
lines changed

Diff for: modules/runners/lambdas/runners/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
"@typescript-eslint/eslint-plugin": "^5.57.0",
2626
"@typescript-eslint/parser": "^5.57.0",
2727
"@vercel/ncc": "^0.36.1",
28+
"aws-sdk-client-mock": "^2.1.1",
29+
"aws-sdk-client-mock-jest": "^2.1.1",
2830
"eslint": "^8.33.0",
2931
"eslint-plugin-prettier": "4.2.1",
3032
"jest": "^29.5",
@@ -39,11 +41,11 @@
3941
},
4042
"dependencies": {
4143
"@aws-lambda-powertools/logger": "^1.6.0",
42-
"@aws-sdk/client-ssm": "^3.296.0",
44+
"@aws-sdk/client-ec2": "^3.303.0",
45+
"@aws-sdk/client-ssm": "^3.303.0",
4346
"@octokit/auth-app": "4.0.9",
4447
"@octokit/rest": "^19.0.7",
4548
"@octokit/types": "^9.0.0",
46-
"aws-sdk": "^2.1340.0",
4749
"cron-parser": "^4.7.1",
4850
"typescript": "^4.9.4"
4951
}

Diff for: modules/runners/lambdas/runners/src/aws/runners.d.ts

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { DefaultTargetCapacityType, SpotAllocationStrategy } from '@aws-sdk/client-ec2';
2+
3+
export type RunnerType = 'Org' | 'Repo';
4+
5+
export interface RunnerList {
6+
instanceId: string;
7+
launchTime?: Date;
8+
owner?: string;
9+
type?: string;
10+
repo?: string;
11+
org?: string;
12+
}
13+
14+
export interface RunnerInfo {
15+
instanceId: string;
16+
launchTime?: Date;
17+
owner: string;
18+
type: string;
19+
}
20+
21+
export interface ListRunnerFilters {
22+
runnerType?: RunnerType;
23+
runnerOwner?: string;
24+
environment?: string;
25+
statuses?: string[];
26+
}
27+
28+
export interface RunnerInputParameters {
29+
runnerServiceConfig: string[];
30+
environment: string;
31+
runnerType: RunnerType;
32+
runnerOwner: string;
33+
ssmTokenPath: string;
34+
subnets: string[];
35+
launchTemplateName: string;
36+
ec2instanceCriteria: {
37+
instanceTypes: string[];
38+
targetCapacityType: DefaultTargetCapacityType;
39+
maxSpotPrice?: string;
40+
instanceAllocationStrategy: SpotAllocationStrategy;
41+
};
42+
numberOfRunners?: number;
43+
amiIdSsmParameterName?: string;
44+
}

0 commit comments

Comments
 (0)