Parameter cache for AWS System Manager Parameter Store and AWS Secrets Manager
npm install --save aws-parameter-cache
import { ssmParameter } from 'aws-parameter-cache';
const param = ssmParameter({ name: 'foo' });
const value = await param.value;
import { secretsManagerParameter } from 'aws-parameter-cache';
const param = secretsManagerParameter({ name: 'foo' });
const value = await param.value;
const param = ssmParameter({ name: 'foo', maxAge: 1000 * 60 * 5 });
const value = await param.value;
const param = ssmParameter({ name: 'foo' });
const value = await param.value;
param.refresh();
const newValue = await param.value;
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ssm:GetParameter"
],
"Resource": "arn:aws:ssm:<REGION>:<ACCOUNT_ID>:parameter/<PARAMETER_NAME>"
},
{
"Effect": "Allow",
"Action": [
"kms:Decrypt"
],
"Resource": "arn:aws:kms:<REGION>:<ACCOUNT_ID>:alias/aws/ssm"
}
]
}