JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 41
  • Score
    100M100P100Q71100F
  • License MIT

Config library for axiom cli

Package Exports

  • @dsmrt/axiom-config
  • @dsmrt/axiom-config/dist/index.js
  • @dsmrt/axiom-config/dist/index.mjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@dsmrt/axiom-config) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Axiom logo

Axiom - Config

An AWS focused config manager

This package focuses on the config part of axiom

Features

  • Customize your application's config type interface
  • load config based on environment
  • Multiple environments/accounts/regions
  • Secrets with SSM Parameters

Getting Started

Install Config

npm install @dsmrt/axiom-config

Config Usage

Example

  1. Add your config to the base of your project

Your project file structure

.
├── .axiom.dev.js
├── .axiom.js
├── README.md
├── package.json
├── src
│   └── config.ts
│   └── index.ts
└── tsconfig.json

Prod Config

// .axiom.js
const config = {
  name: "my-prod-app",
  env: "prod",
  aws: {
    account: "prod-account",
    profile: "prod-profile",
    region: "us-east-1",
    // baseParameterPath can be used to secrets using ssm parameters (secure strings)
    baseParameterPath: "/my-app/prod",
  },
};
module.exports = config;

Dev Config

// .axiom.dev.js

const config = {
  name: "my-prod-app",
  env: "dev",
  aws: {
    account: "dev-account",
    profile: "dev-profile",
    region: "us-north-1",
    baseParameterPath: "/my-app/dev",
  },
};

module.exports = config;

Adding configs for your application based on your needs

// ./config.ts
// within your code

import { Config } from "@dsmrt/axiom-config"

export interface MyAppConfig extends Config {
    appDomain: string;
    appAcmCertArn: string;
}

Load the config within AWS CDK or your node application

import { MyAppConfig } from "./config"
import { loadConfig } from "@dsmrt/axiom-config"

const config = loadConfig<MyAppConfig>();

//  or for dev
const config = loadConfig<MyAppConfig>({
    env: "dev"
});

console.log(config.appDomain);

Acknowledgements