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

Commit

Permalink
fix(runners): upgrade aws sdk v2 to v3 (#3138)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
npalm and GuptaNavdeep1983 authored Apr 7, 2023
1 parent e53545c commit 48da039
Show file tree
Hide file tree
Showing 9 changed files with 1,023 additions and 949 deletions.
6 changes: 4 additions & 2 deletions modules/runners/lambdas/runners/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.57.0",
"@vercel/ncc": "^0.36.1",
"aws-sdk-client-mock": "^2.1.1",
"aws-sdk-client-mock-jest": "^2.1.1",
"eslint": "^8.33.0",
"eslint-plugin-prettier": "4.2.1",
"jest": "^29.5",
Expand All @@ -39,11 +41,11 @@
},
"dependencies": {
"@aws-lambda-powertools/logger": "^1.6.0",
"@aws-sdk/client-ssm": "^3.296.0",
"@aws-sdk/client-ec2": "^3.303.0",
"@aws-sdk/client-ssm": "^3.303.0",
"@octokit/auth-app": "4.0.9",
"@octokit/rest": "^19.0.7",
"@octokit/types": "^9.0.0",
"aws-sdk": "^2.1340.0",
"cron-parser": "^4.7.1",
"typescript": "^4.9.4"
}
Expand Down
44 changes: 44 additions & 0 deletions modules/runners/lambdas/runners/src/aws/runners.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { DefaultTargetCapacityType, SpotAllocationStrategy } from '@aws-sdk/client-ec2';

export type RunnerType = 'Org' | 'Repo';

export interface RunnerList {
instanceId: string;
launchTime?: Date;
owner?: string;
type?: string;
repo?: string;
org?: string;
}

export interface RunnerInfo {
instanceId: string;
launchTime?: Date;
owner: string;
type: string;
}

export interface ListRunnerFilters {
runnerType?: RunnerType;
runnerOwner?: string;
environment?: string;
statuses?: string[];
}

export interface RunnerInputParameters {
runnerServiceConfig: string[];
environment: string;
runnerType: RunnerType;
runnerOwner: string;
ssmTokenPath: string;
subnets: string[];
launchTemplateName: string;
ec2instanceCriteria: {
instanceTypes: string[];
targetCapacityType: DefaultTargetCapacityType;
maxSpotPrice?: string;
instanceAllocationStrategy: SpotAllocationStrategy;
};
numberOfRunners?: number;
amiIdSsmParameterName?: string;
}
Loading

0 comments on commit 48da039

Please sign in to comment.