Skip to content

Commit ee5cd58

Browse files
committed
Reuse ssm client
1 parent dca2ad5 commit ee5cd58

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/server/utils/ssm.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import { GetParameterCommand, SSMClient } from '@aws-sdk/client-ssm';
22
import { credentials, region } from './aws';
33

4-
const getSSMClient = () =>
5-
new SSMClient({
6-
credentials: credentials(),
7-
region,
8-
});
4+
const client = new SSMClient({
5+
credentials: credentials(),
6+
region,
7+
});
98

109
export async function getSsmValue(stage: string, id: string): Promise<string | undefined> {
1110
const name = `/membership/support-dotcom-components/${stage}/${id}`;
12-
const client = getSSMClient();
1311

1412
const response = await client.send(
1513
new GetParameterCommand({

0 commit comments

Comments
 (0)