Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@adikari/config-store
Advanced tools
Reads parameters from specified provider
# Via yarn
$ yarn add @adikari/config-store
# Via npm
$ npm install @adikari/config-store
Add IAM policy to allow getting parameters from ssm.
provider:
name: aws
iamRoleStatements:
- Effect: Allow
Action:
- ssm:GetParameters # Allow Parameter Store to be read
Resource:
- arn:aws:ssm:${env:AWS_REGION}:${env:AWS_ACCOUNT_ID}:parameter/staging/foo-service/*
const { makeConfigStore } = require('@adikari/config-store');
const { STAGE } = process.env;
const configStore = makeConfigStore({
configPath: `/${SERVICE_STAGE}/foo-service/config`,
secretPath: `/${SERVICE_STAGE}/foo-service/secret`,
provider: {
name: 'ssm'
}
});
return Promise.all([
configStore.getConfigs([
'THE_CONFIG_1',
'THE_CONFIG_2'
]),
configStore.getSecrets([
'THE_SECRET_1'
])
])
.then(([configs, secrets]) => ({ ...configs, ...secrets }))
.then(console.log);
/* console.log output
{
THE_CONFIG_1: 'the config 1',
THE_CONFIG_2: 'the config 2',
THE_SECRET_1: 'the secret 1'
};
*/
Add IAM policy to allow getting parameters from dynamodb.
provider:
name: aws
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query # Allow Parameter Store to be read
Resource:
- arn:aws:dynamodb:${env:AWS_REGION}:${env:AWS_ACCOUNT_ID}:table/config-service*
const { makeConfigStore } = require('@adikari/config-store');
const { STAGE } = process.env;
const configStore = makeConfigStore({
configPath: `/${SERVICE_STAGE}/foo-service/config`,
secretPath: `/${SERVICE_STAGE}/foo-service/secret`,
provider: {
tableName: `config-service-${SERVICE_STAGE}`
}
});
return Promise.all([
configStore.getConfigs([
'THE_CONFIG_1',
'THE_CONFIG_2'
]),
configStore.getSecrets([
'THE_SECRET_1'
])
])
.then(([configs, secrets]) => ({ ...configs, ...secrets }))
.then(console.log);
/* console.log output
{
THE_CONFIG_1: 'the config 1',
THE_CONFIG_2: 'the config 2',
THE_SECRET_1: 'the secret 1'
};
*/
FAQs
Read configuration from config stores
We found that @adikari/config-store demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.