-
-
Save Rud5G/14550503ec52676257f7a0b298795b15 to your computer and use it in GitHub Desktop.
Obtain values from the AWS Parameter store with Typescript/node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SSM } from "aws-sdk"; | |
const getParameterWorker = async (name:string, decrypt:boolean) : Promise<string> => { | |
const ssm = new SSM(); | |
const result = await ssm | |
.getParameter({ Name: name, WithDecryption: decrypt }) | |
.promise(); | |
return result.Parameter.Value; | |
} | |
export const getParameter = async (name:string) : Promise<string> => { | |
return getParameterWorker(name,false); | |
} | |
export const getEncryptedParameter = async (name:string) : Promise<string> => { | |
return getParameterWorker(name,true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment