2.0.5 • Published 2 years ago

@gravitywelluk/environment v2.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Usage

Use at a convenient entry point to check that your environment is setup correctly (Webpack config, Serverless Stack deployment etc.)

import { validateAppEnvironment } from "@gravitywelluk/environment";

await validateAppEnvironment(process.env.ENVIRONMENT, {
  variables: [
    // sequelize (local dev)
    "DB_DATABASE",
    "DB_HOST",
    "DB_PORT",
    "DB_ENGINE",
    "DB_USERNAME",
    "DB_PASSWORD",
    // aws
    "REGION",
    // external apis
    "SOME_API_KEY"
  ],
  // put AWS Secret ARNs here for backend projects
  awsSecrets: [
    "DB_SECRET_ARN"
  ]
});

This validation function will throw an error if required variables are not found. Secrets will also be checked to see if they exist in AWS Secrets Manager.

2.0.5

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.4

2 years ago

2.0.1

3 years ago

1.0.1

3 years ago