1.0.0 • Published 3d agoCLI
ssm-to-env-cli
Licence
MIT
Version
1.0.0
Deps
1
Size
5 kB
Vulns
0
Weekly
0
config-loader-demo
A CLI tool that loads AWS SSM Parameter Store values and outputs them as JSON, .env format, or shell exports. Built on top of aws-parameters-store.
Usage
# Output as JSON (default)
npx ts-node src/index.ts /myapp/production/
# Output as .env key=value pairs
npx ts-node src/index.ts /myapp/staging/ --format env
# Output as shell exports (useful for sourcing)
npx ts-node src/index.ts /myapp/dev/ --format export >> .env
# Specify region
npx ts-node src/index.ts /myapp/production/ --region eu-west-1How it works
- Calls
getParams(namespace, { region })fromaws-parameters-store - Gets back a nested object based on the SSM parameter path hierarchy
- Flattens + formats into the desired output (JSON, env, or export)
Example
Given these SSM parameters:
/myapp/prod/database/host = "db.example.com"
/myapp/prod/database/port = "5432"
/myapp/prod/redis/url = "redis://cache:6379"
/myapp/prod/features/dark_mode = true
Running:
npx ts-node src/index.ts /myapp/prod/ --format envOutputs:
DATABASE_HOST=db.example.com
DATABASE_PORT=5432
REDIS_URL=redis://cache:6379
FEATURES_DARK_MODE=true