chiefbiiko / get-aws-config

derive aws config & creds

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

get-aws-config

ci

Get AWS config and credentials following the "official" AWS CLI strategy.

Usage

Make sure you are running deno with the --allow-env and/or --allow-read flags as this module depends on filesystem and/or environment access.

import { get } from "https://denopkg.com/chiefbiiko/get-aws-config/mod.ts";

const got = get();
// {
//   accessKeyId: "accessKeyId",
//   secretAccessKey: "secretAccessKey",
//   sessionToken: "sessionToken",
//   region: "us-east-1",
//   output: "json",
//   moreConfig: "bla"
// }

API

get(opts?: GetOptions): { [key: string]: string }

Derive configuration from the environment, the credentials file, and config file, in that order.

Options

export interface GetOptions {
  profile?: string; // which profile to load [default]
  credentialsFile?: string; // credentials file path [~/.aws/credentials]
  configFile?: string; // config file path [~/.aws/config]
  env?: boolean; // whether to check environment [true]
  fs?: boolean; // whether to check file system [true]
}

License

MIT

About

derive aws config & creds

License:MIT License


Languages

Language:TypeScript 100.0%