Skip to content

Commit

Permalink
BAU: bump aws sdk from v2 to v3
Browse files Browse the repository at this point in the history
AWS SDK for js is being deprecated and is entering maintenance mode in September, 2024.

The bump required some code changes as the implementation of some features have been changed/removed.

Also deleted aws.ts as none of the functions in this file were used.
  • Loading branch information
alhcomer committed Jun 17, 2024
1 parent 1bf2e42 commit d54efbd
Show file tree
Hide file tree
Showing 5 changed files with 789 additions and 192 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@
},
"dependencies": {
"@aws-sdk/client-kms": "^3.366.0",
"@aws-sdk/client-ssm": "^3.366.0",
"@govuk-one-login/frontend-language-toggle": "^1.1.0",
"@govuk-one-login/frontend-passthrough-headers": "^0.0.3",
"@govuk-one-login/frontend-analytics": "1.0.3",
"@otplib/core": "^12.0.1",
"@otplib/plugin-base32-enc-dec": "^12.0.1",
"aws-sdk": "^2.1356.0",
"axios": "^1.6.8",
"connect-redis": "^7.1.1",
"cookie-parser": "^1.4.5",
Expand Down
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RedisConfig } from "./utils/types";
import ssm from "./utils/ssm";
import { Parameter } from "aws-sdk/clients/ssm";
import { Parameter } from "@aws-sdk/client-ssm";
import { ENVIRONMENT_NAME } from "./app.constants";

export function getLogLevel(): string {
Expand Down Expand Up @@ -74,7 +74,7 @@ export async function getRedisConfig(): Promise<RedisConfig> {
WithDecryption: true,
};

const result = await ssm.getParameters(params).promise();
const result = await ssm.getParameters(params);

if (result.InvalidParameters && result.InvalidParameters.length > 0) {
throw Error("Invalid SSM config values for redis");
Expand Down
23 changes: 0 additions & 23 deletions src/config/aws.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/utils/ssm.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const AWS = require("aws-sdk");
const { SSM } = require("@aws-sdk/client-ssm");

export default new AWS.SSM();
export default new SSM();
Loading

0 comments on commit d54efbd

Please sign in to comment.