export async function getParamFromSSM()

in src/lib/ssm.ts [49:62]


export async function getParamFromSSM(ssm: SSM, path: string): Promise<string> {
	const ssmResponse = await ssm
		.getParameter({
			Name: path,
			WithDecryption: true,
		})
		.promise();

	if (ssmResponse.Parameter && ssmResponse.Parameter.Value) {
		return ssmResponse.Parameter.Value;
	}

	throw new Error(`Could not get config from SSM path ${path}`);
}