@natsuneko-laboratory/varia-aws-parameter-store
v0.1.0
Published
Resolve and validate configuration values from multiple sources - AWS Parameter Store.
Maintainers
Readme
AWS Parameter Store source example
This example follows the Varia Source contract discussed previously. The
configured path is the hierarchy before the key; the key passed to Varia is
always appended as the final segment.
import { Varia } from "varia";
import { awsParameterStore } from "@varia/aws-parameter-store";
const varia = new Varia({
sources: [
awsParameterStore({
region: "ap-northeast-1",
path: "/teyvat/prod/api-natsuneko-com",
}),
],
});
const value = await varia.require("xxx");
// Reads /teyvat/prod/api-natsuneko-com/xxxThe AWS SDK uses its normal credential provider chain. WithDecryption is
enabled by default, so the same source supports String, StringList, and
SecureString values. Set withDecryption: false only when decryption is not
wanted.
Only AWS's ParameterNotFound response becomes undefined. Other AWS errors
are thrown so Varia does not silently fall back when infrastructure is broken.
In the real monorepo, replace src/source.ts with imports of Source,
SourceOptions, and ResolveContext from the core varia package.
