Amazon Aurora

Introduction

This guide will show you how to use Amazon Aurora to manage configurations via the Configu interface. Learn about the concept of stores.

Working with the store

CLI installation

Linux
MacOs
Windows
1curl https://cli.configu.com/install.sh | sh

CLI usage

Create the store URI as follows:

// * Aurora PostgreSQL
aurora-postgres://<username>:<password>@<host>[?database=][&resourceArn=][&secretArn=][&region=]

// * Aurora MySQL
aurora-mysql://<username>:<password>@<host>[?database=][&resourceArn=][&secretArn=][&region=]

CLI Upsert

configu upsert --set "example" --schema "example.cfgu.json" --store "aurora-postgres:// username:password@host?database=example" --config "FOO=value" --config "BAR=bar"

CLI Export

configu export --set "example" --schema "example.cfgu.json" --store "aurora-postgres:// username:password@host?database=example" --format "Dotenv"

CLI Delete

configu delete --set "example" --schema "example.cfgu.json" --store --store "aurora-postgres:// username:password@host?database=example"

SDK installation

Install the node.js SDK

// * Using yarn
yarn add @configu/node
// * Using npm
npm install --save @configu/node

SDK usage

import { Cfgu, Set, UpsertCommand, EvalCommand, DeleteCommand, AuroraMysqlStore, AuroraPostgreSQLStore} from "@configu/node";
import path from "path";

// * Select appropriate Aurora instance
const store = new AuroraMysqlStore({ username, password, database, host, region, resourceArn, secretArn });
const store = new AuroraPostgreSQLStore({ username, password, database, host, region, resourceArn, secretArn });

const schema = new Cfgu(path.resolve(__dirname, "./example.cfgu.json"));
const set = new Set("dev");

// * Example upsert command
await new UpsertCommand({ store, set, schema, configs: [{ key: "foo", value: "bar" }] }).run();

// * Example eval command
const configs = await new EvalCommand({ store, set, schema }).run();

// * Example delete command
await new DeleteCommand({ store, set, schema }).run();

References

To reference a value from this store, use the following reference format:

// * Aurora PostgreSQL
{{aurora-postgres://<database>@[set/]<schema>[.key][?key=[key]]}}

// * Aurora MySQL
{{aurora-mysql://<database>@[set/]<schema>[.key][?key=[key]]}}

Example:

// * Aurora PostgreSQL
{{aurora-postgres://my-db@example-set/example-schema.foo}}

// * Aurora MySQL
{{aurora-mysql://my-db@example-set/example-schema.foo}}

Limitations

  • The Configu CLI & SDK do not create the database if it does not exist. Make sure it is created before you use them.
  • The Configu CLI & SDK attempt to use the 'config' table. If you already have such an existing table then it will be overriden.