diff --git a/content/Concepts/config-store.mdx b/content/Concepts/config-store.mdx index 5d2a095..62384f8 100644 --- a/content/Concepts/config-store.mdx +++ b/content/Concepts/config-store.mdx @@ -42,8 +42,8 @@ You can choose the appropriate `ConfigStore` based on your specific use case, an name="Json File" type="json-file" interfaces={['CLI', 'Node.js', 'Python']} - docs="https://configu.com/docs/" - configs="https://configu.com/docs/" + docs="https://configu.com/docs/json-file" + configs="https://configu.com/docs/json-file#initialization" /> + + @@ -78,7 +87,7 @@ You can choose the appropriate `ConfigStore` based on your specific use case, an name="AWS Secrets Manager" type="aws-secrets-manager" interfaces={['CLI', 'Node.js', 'Python']} - docs="https://docs.aws.amazon.com/secretsmanager/" + docs="https://configu.com/docs/aws-secrets-manager" configs="https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-secrets-manager/interfaces/secretsmanagerclientconfig.html" /> @@ -87,7 +96,7 @@ You can choose the appropriate `ConfigStore` based on your specific use case, an name="Azure Key Vault" type="azure-key-vault" interfaces={['CLI', 'Node.js', 'Python']} - docs="https://learn.microsoft.com/en-us/azure/key-vault/" + docs="https://configu.com/docs/azure-key-vault" configs="https://learn.microsoft.com/en-us/javascript/api/@azure/keyvault-secrets/secretclient" /> @@ -96,7 +105,7 @@ You can choose the appropriate `ConfigStore` based on your specific use case, an name="GCP Secret Manager" type="gcp-secret-manager" interfaces={['CLI', 'Node.js', 'Python']} - docs="https://cloud.google.com/secret-manager/docs" + docs="https://configu.com/docs/gcp-secret-manager" configs="https://cloud.google.com/secret-manager/docs/reference/libraries#client-libraries-install-nodejs" /> @@ -105,8 +114,8 @@ You can choose the appropriate `ConfigStore` based on your specific use case, an name="Kubernetes Secret" type="kubernetes-secret" interfaces={['CLI', 'Node.js', 'Python']} - docs="https://kubernetes.io/docs/concepts/configuration/secret/" - configs="https://github.com/kubernetes-client/javascript" + docs="https://configu.com/docs/kubernetes-secret" + configs="https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig" /> + @@ -141,7 +158,7 @@ You can choose the appropriate `ConfigStore` based on your specific use case, an name="MySQL" type="mysql" interfaces={['CLI', 'Node.js']} - docs="https://dev.mysql.com/doc/" + docs="https://configu.com/docs/mysql" configs="https://typeorm.io/data-source-options#mysql--mariadb-data-source-options" /> @@ -150,7 +167,7 @@ You can choose the appropriate `ConfigStore` based on your specific use case, an name="MariaDB" type="mariadb" interfaces={['CLI', 'Node.js']} - docs="https://dev.mysql.com/doc/" + docs="https://configu.com/docs/mariadb" configs="https://typeorm.io/data-source-options#mysql--mariadb-data-source-options" /> @@ -159,7 +176,7 @@ You can choose the appropriate `ConfigStore` based on your specific use case, an name="PostgreSQL" type="postgres" interfaces={['CLI', 'Node.js']} - docs="https://www.postgresql.org/docs/" + docs="https://configu.com/docs/postgres" configs="https://typeorm.io/data-source-options#postgres--cockroachdb-data-source-options" /> @@ -168,7 +185,7 @@ You can choose the appropriate `ConfigStore` based on your specific use case, an name="CockroachDB" type="cockroachdb" interfaces={['CLI', 'Node.js']} - docs="https://www.cockroachlabs.com/docs/" + docs="https://configu.com/docs/cockroachdb" configs="https://typeorm.io/data-source-options#postgres--cockroachdb-data-source-options" /> @@ -177,7 +194,7 @@ You can choose the appropriate `ConfigStore` based on your specific use case, an name="Microsoft SQL Server" type="mssql" interfaces={['CLI', 'Node.js']} - docs="https://learn.microsoft.com/en-us/sql/sql-server/" + docs="https://configu.com/docs/mssql" configs="https://typeorm.io/data-source-options#mssql-data-source-options" /> @@ -186,7 +203,7 @@ You can choose the appropriate `ConfigStore` based on your specific use case, an name="LocalForage" type="localforage" interfaces={['Browser']} - docs="https://localforage.github.io/localForage/" + docs="https://configu.com/docs/localforage" configs="https://localforage.github.io/localForage/#settings-api-config" /> diff --git a/content/Stores/aws-parameter-store.mdx b/content/Stores/aws-parameter-store.mdx new file mode 100644 index 0000000..8af6a33 --- /dev/null +++ b/content/Stores/aws-parameter-store.mdx @@ -0,0 +1,154 @@ +--- +id: aws-parameter-store +slug: aws-parameter-store +title: AWS Parameter store +--- + +Integrates the Configu Orchestrator with [AWS Parameter Store](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ssm). + +## Initialization + +Configu's needs to be authorized to access your AWS Secrets Manager account. By default, Configu uses the standard authentication methods that the AWS SDKs use, if you have the right IAM access credentials, there's no special action to take. Otherwise, you need to supply the credentials according to the interface that you use: + +- [Node.js SDK & CLI configuration options](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ssm/Interface/SSMClientConfig) + +Example [.configu file](../cli-config) file store configuration for CLI usage: + +```json +{ + "stores": { + "aws-secrets-manager-store": { + "type": "aws-secrets-manager", + "configuration": { + "credentials": { + "accessKeyId": "accessKeyId", + "secretAccessKey": "secretAccessKey" + }, + "region": "us-east-1" + } + } + } +} +``` + +## SDK Usage + + + +```js +import path from 'path'; +import { + AWSParameterStoreConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new AWSParameterStoreConfigStore({ + credentials: { + accessKeyId: 'accessKeyId', + secretAccessKey: 'secretAccessKey', + }, + region: 'us-east-1', + }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + await new TestCommand({ store, clean: true }).run(); + + await new UpsertCommand({ + store, + set, + schema, + configs: { + GREETING: 'hey', + SUBJECT: 'configu node.js sdk', + }, + }).run(); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + data, + }).run(); + + console.log(configurationData); + + await new DeleteCommand({ store, set, schema }).run(); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +```bash +configu test --store "aws-param-store" --clean +``` + +### Upsert command + +```bash +configu upsert --store "aws-param-store" --set "test" --schema "./get-started.cfgu.json" \ + -c "GREETING=hey" \ + -c "SUBJECT=configu node.js sdk" +``` + +### Eval and export commands + +```bash +configu eval --store "aws-param-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Clean up the previous upsert by using: + +```bash +configu delete --store "aws-param-store" --set "test" --schema "./get-started.cfgu.json" +``` + +## Examples + +Secrets list: +![image](./img/aws-parameter-store-upsert-result.png) + +Upserted values to the `test` config set: +![image](./img/aws-parameter-store-param-list.png) diff --git a/content/Stores/aws-secrets-manager.mdx b/content/Stores/aws-secrets-manager.mdx new file mode 100644 index 0000000..d91e3c3 --- /dev/null +++ b/content/Stores/aws-secrets-manager.mdx @@ -0,0 +1,162 @@ +--- +id: aws-secrets-manager +slug: aws-secrets-manager +title: AWS Secrets Manager +--- + +Integrates the Configu Orchestrator with [AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager). + +## Initialization + +Configu's needs to be authorized to access your AWS Secrets Manager account. By default, Configu uses the standard authentication methods that the AWS SDKs use, if you have the right IAM access credentials, there's no special action to take. Otherwise, you need to supply the credentials according to the interface that you use: + +- [Node.js SDK & CLI configuration options](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-secrets-manager/interfaces/secretsmanagerclientconfig.html) +- [Python SDK configuration options](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html#configuration) + +Example [.configu file](../cli-config) file store configuration for CLI usage: + +```json +{ + "stores": { + "aws-secrets-manager-store": { + "type": "aws-secrets-manager", + "configuration": { + "credentials": { + "accessKeyId": "accessKeyId", + "secretAccessKey": "secretAccessKey" + }, + "region": "us-east-1" + } + } + } +} +``` + +## Limitations + + + - A secret scheduled for deletion cannot be changed by the Configu Orchestrator. You will need to + manually cancel the secret deletion. + + +## SDK Usage + + + +```js +import path from 'path'; +import { + AWSSecretsManagerConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new AWSSecretsManagerConfigStore({ + credentials: { + accessKeyId: 'accessKeyId', + secretAccessKey: 'secretAccessKey', + }, + region: 'us-east-1', + }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + await new TestCommand({ store, clean: true }).run(); + + await new UpsertCommand({ + store, + set, + schema, + configs: { + GREETING: 'hey', + SUBJECT: 'configu node.js sdk', + }, + }).run(); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + data, + }).run(); + + console.log(configurationData); + + await new DeleteCommand({ store, set, schema }).run(); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +```bash +configu test --store "aws-secrets-manager-store" --clean +``` + +### Upsert command + +```bash +configu upsert --store "aws-secrets-manager-store" --set "test" --schema "./get-started.cfgu.json" \ + -c "GREETING=hey" \ + -c "SUBJECT=configu node.js sdk" +``` + +### Eval and export commands + +```bash +configu eval --store "aws-secrets-manager-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Clean up the previous upsert by using: + +```bash +configu delete --store "aws-secrets-manager-store" --set "test" --schema "./get-started.cfgu.json" +``` + +## Examples + +Secrets list: +![image](./img/aws-secrets-manager-upsert-result.png) + +Upserted values to the `test` config set: +![image](./img/aws-secrets-manager-secrets-list.png) diff --git a/content/Stores/azure-key-vault.mdx b/content/Stores/azure-key-vault.mdx new file mode 100644 index 0000000..1d77148 --- /dev/null +++ b/content/Stores/azure-key-vault.mdx @@ -0,0 +1,157 @@ +--- +id: azure-key-vault +slug: azure-key-vault +title: Azure Key Vault +--- + +Integrates the Configu Orchestrator with [Azure Key Vault](https://learn.microsoft.com/en-us/azure/key-vault). + +## Initialization + +Configu needs to be authorized to access Azure Key Vault. Configu uses the [default azure credentials](https://www.npmjs.com/package/@azure/identity#defaultazurecredential) which by default will read account information specified via [environment variables](https://www.npmjs.com/package/@azure/identity#environment-variables) and use it to authenticate. The `vaultUrl` parameter must always be provided. + +The examples below will use the following environment variables for authentication: `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_TENANT_ID` in conjunction with the required `vaultUrl` parameter. + +Example [.configu file](../cli-config) file store configuration for CLI usage: + +```json +{ + "stores": { + "azure-key-vault-store": { + "type": "azure-key-vault", + "configuration": { + "credential": {}, + "vaultUrl": "https://example.vault.azure.net" + } + } + } +} +``` + +## Limitations + + + +- Deleted configs does not immediately remove secrets [due to soft deletion](https://learn.microsoft.com/en-us/azure/key-vault/general/soft-delete-overview). Attempting to upsert to a deleted secret that is not purged will throw an error. + + + +## SDK Usage + + + +```js +import path from 'path'; +import fs from 'fs/promises'; +import { + AzureKeyVaultConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new AzureKeyVaultConfigStore({ + credential: {}, + vaultUrl: 'https://example.vault.azure.net', + }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + await new TestCommand({ store, clean: true }).run(); + + await new UpsertCommand({ + store, + set, + schema, + configs: { + GREETING: 'hey', + SUBJECT: 'configu node.js sdk', + }, + }).run(); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + pipe: data, + }).run(); + + console.log(configurationData); + + await new DeleteCommand({ store, set, schema }).run(); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +```bash +configu test --store "azure-key-vault-store" --clean +``` + +### Upsert command + +```bash +configu upsert --store "azure-key-vault-store" --set "test" --schema "./get-started.cfgu.json" \ + -c "GREETING=hey" \ + -c "SUBJECT=configu node.js sdk" +``` + +### Eval and export commands + +```bash +configu eval --store "azure-key-vault-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Clean up the previous upsert by using: + +```bash +configu delete --store "azure-key-vault-store" --set "test" --schema "./get-started.cfgu.json" +``` + +## Examples + +Secrets list: +![image](./img/azure-key-vault-secret-list.png) + +Upserted values to the `test` config set: +![image](./img/azure-key-vault-upsert-result.png) diff --git a/content/Stores/cloud-bees.mdx b/content/Stores/cloud-bees.mdx new file mode 100644 index 0000000..2e8ce77 --- /dev/null +++ b/content/Stores/cloud-bees.mdx @@ -0,0 +1,126 @@ +--- +id: cloud-bees +slug: cloud-bees +title: CloudBees +--- + +Integrates the Configu Orchestrator with [CloudBees Feature Management](https://docs.cloudbees.com/docs/cloudbees-feature-management/latest). + +## Initialization + +Configu needs to be authorized to access your CloudBees app. You must specify an `appKey` that corresponds to an an environment of some CloudBees environment and an optional context that has a `targetingKey` that identifies the subject (end-user, or client service) of a flag evaluation. You may also configure [`providerOptions`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/dc3f51b89bf7741b8d327311321ab6db041aa88d/types/rox-node/index.d.ts#L35C35-L35C35) to customize the CloudBees client. + +Example [.configu file](../cli-config) file store configuration for CLI usage: + +```json +{ + "stores": { + "cloud-bees-store": { + "type": "cloud-bees", + "configuration": { + "appKey": "example-appKey" + } + } + } +} +``` + +## Limitations + + + +- Only supports the eval and export commands + + + +## SDK Usage + + + +```js +import path from 'path'; +import fs from 'fs/promises'; +import { + CloudBeesConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new CloudBeesConfigStore({ + appKey: 'example-appKey', + }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + pipe: data, + }).run(); + + console.log(configurationData); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +Not supported + +### Upsert command + +Not supported + +### Eval and export commands + +```bash +configu eval --store "cloud-bees-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Not supported + +## Examples + +Secrets list: +![image](./img/cloud-bees-feature-flag-list.png) diff --git a/content/Stores/cockroachdb.mdx b/content/Stores/cockroachdb.mdx new file mode 100644 index 0000000..15d9ab1 --- /dev/null +++ b/content/Stores/cockroachdb.mdx @@ -0,0 +1,137 @@ +--- +id: cockroachdb +slug: cockroachdb +title: CockroachDB +--- + +Integrates the Configu Orchestrator with a [CockroachDB](https://www.cockroachlabs.com/docs) database. + +## Initialization + +Configu needs to be authorized to access your database instance. View the configuration options [here](https://typeorm.io/data-source-options#postgres--cockroachdb-data-source-options). + +Example [.configu file](../cli-config) file store configuration for CLI usage: + +```json +{ + "stores": { + "cockroachdb-store": { + "type": "cockroachdb", + "configuration": { + "url": "example://username:password@example-host" + } + } + } +} +``` + +## SDK Usage + + + +```js +import path from 'path'; +import fs from 'fs/promises'; +import { + CockroachDBConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new CockroachDBConfigStore({ + url: 'example://username:password@example-host', + }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + await new TestCommand({ store, clean: true }).run(); + + await new UpsertCommand({ + store, + set, + schema, + configs: { + GREETING: 'hey', + SUBJECT: 'configu node.js sdk', + }, + }).run(); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + pipe: data, + }).run(); + + console.log(configurationData); + + await new DeleteCommand({ store, set, schema }).run(); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +```bash +configu test --store "cockroachdb-store" --clean +``` + +### Upsert command + +```bash +configu upsert --store "cockroachdb-store" --set "test" --schema "./get-started.cfgu.json" \ + -c "GREETING=hey" \ + -c "SUBJECT=configu node.js sdk" +``` + +### Eval and export commands + +```bash +configu eval --store "cockroachdb-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Clean up the previous upsert by using: + +```bash +configu delete --store "cockroachdb-store" --set "test" --schema "./get-started.cfgu.json" +``` diff --git a/content/Stores/gcp-secret-manager.mdx b/content/Stores/gcp-secret-manager.mdx new file mode 100644 index 0000000..1de90f7 --- /dev/null +++ b/content/Stores/gcp-secret-manager.mdx @@ -0,0 +1,142 @@ +--- +id: gcp-secret-manager +slug: gcp-secret-manager +title: GCP Secret Manager +--- + +Integrates the Configu Orchestrator with [GCP Secret Manager](https://cloud.google.com/secret-manager/docs). + +## Initialization + +Configu needs to be authorized to access your GCP Secret manager account. By default, Configu uses the [standard authentication methods](https://cloud.google.com/docs/authentication/application-default-credentials) that the GCP SDKs use, if you have the right IAM access credentials, you only need to provide the `projectId` parameter. + +- [Node.js SDK & CLI configuration options](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#authentication-options) +- [Python SDK configuration options](https://googleapis.dev/python/google-api-core/latest/auth.html) + +Example [.configu file](../cli-config) file using authentication via service account key file: + +```json +{ + "stores": { + "gcp-secret-manager-store": { + "type": "gcp-secret-manager", + "configuration": { + "keyFile": "path/to/service-account.json", + "projectId": "example-projectId" + } + } + } +} +``` + +## SDK Usage + + + +```js +import path from 'path'; +import fs from 'fs/promises'; +import { + GCPSecretManagerConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new GCPSecretManagerConfigStore({ + keyFile: path.resolve(__dirname, './service-account.json'), + projectId: 'example-projectId', + }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + await new TestCommand({ store, clean: true }).run(); + + await new UpsertCommand({ + store, + set, + schema, + configs: { + GREETING: 'hey', + SUBJECT: 'configu node.js sdk', + }, + }).run(); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + pipe: data, + }).run(); + + console.log(configurationData); + + await new DeleteCommand({ store, set, schema }).run(); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +```bash +configu test --store "gcp-secret-manager-store" --clean +``` + +### Upsert command + +```bash +configu upsert --store "gcp-secret-manager-store" --set "test" --schema "./get-started.cfgu.json" \ + -c "GREETING=hey" \ + -c "SUBJECT=configu node.js sdk" +``` + +### Eval and export commands + +```bash +configu eval --store "gcp-secret-manager-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Clean up the previous upsert by using: + +```bash +configu delete --store "gcp-secret-manager-store" --set "test" --schema "./get-started.cfgu.json" +``` diff --git a/content/Stores/hashicorp-vault.mdx b/content/Stores/hashicorp-vault.mdx new file mode 100644 index 0000000..22cf44c --- /dev/null +++ b/content/Stores/hashicorp-vault.mdx @@ -0,0 +1,157 @@ +--- +id: hashicorp-vault +slug: hashicorp-vault +title: HashiCorp Vault +--- + +Integrates the Configu Orchestrator with [HashiCorp Vault](https://developer.hashicorp.com/vault/docs). + +## Initialization + +Configu needs to be authorized to access your HashiCorp vault account. For this, you need to provide the following parameters: `address`, `engine`, `token`. By default, Configu attempts to use the following environment variables for the vault address and token: `VAULT_ADDR`, `VAULT_TOKEN`. The `engine` parameter must always be provided. + +Example [.configu file](../cli-config) file store configuration for CLI usage: + +```json +{ + "stores": { + "hashicorp-vault-store": { + "type": "hashicorp-vault", + "configuration": { + "address": "https://vault.example.com", + "engine": "example-engine", + "token": "example-token" + } + } + } +} +``` + +## Limitations + + + +- Only supports the K/V2 engine. + + + +## SDK Usage + + + +```js +import path from 'path'; +import fs from 'fs/promises'; +import { + HashiCorpVaultConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new HashiCorpVaultConfigStore({ + address: 'https://vault.example.com' + engine: 'example-engine', + token: 'example-token', + }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + await new TestCommand({ store, clean: true }).run(); + + await new UpsertCommand({ + store, + set, + schema, + configs: { + GREETING: 'hey', + SUBJECT: 'configu node.js sdk', + }, + }).run(); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + pipe: data, + }).run(); + + console.log(configurationData); + + await new DeleteCommand({ store, set, schema }).run(); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +```bash +configu test --store "hashicorp-vault-store" --clean +``` + +### Upsert command + +```bash +configu upsert --store "hashicorp-vault-store" --set "test" --schema "./get-started.cfgu.json" \ + -c "GREETING=hey" \ + -c "SUBJECT=configu node.js sdk" +``` + +### Eval and export commands + +```bash +configu eval --store "hashicorp-vault-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Clean up the previous upsert by using: + +```bash +configu delete --store "hashicorp-vault-store" --set "test" --schema "./get-started.cfgu.json" +``` + +## Examples + +Secrets list: +![image](./img/hashicorp-vault-secret-list.png) + +Upserted values to the `test` config set: +![image](./img/hashicorp-vault-upsert-result.png) diff --git a/content/Stores/img/aws-parameter-store-param-list.png b/content/Stores/img/aws-parameter-store-param-list.png new file mode 100644 index 0000000..df39514 Binary files /dev/null and b/content/Stores/img/aws-parameter-store-param-list.png differ diff --git a/content/Stores/img/aws-parameter-store-upsert-result.png b/content/Stores/img/aws-parameter-store-upsert-result.png new file mode 100644 index 0000000..c936023 Binary files /dev/null and b/content/Stores/img/aws-parameter-store-upsert-result.png differ diff --git a/content/Stores/img/aws-secrets-manager-secrets-list.png b/content/Stores/img/aws-secrets-manager-secrets-list.png new file mode 100644 index 0000000..85fe07f Binary files /dev/null and b/content/Stores/img/aws-secrets-manager-secrets-list.png differ diff --git a/content/Stores/img/aws-secrets-manager-upsert-result.png b/content/Stores/img/aws-secrets-manager-upsert-result.png new file mode 100644 index 0000000..5f78199 Binary files /dev/null and b/content/Stores/img/aws-secrets-manager-upsert-result.png differ diff --git a/content/Stores/img/azure-key-vault-secret-list.png b/content/Stores/img/azure-key-vault-secret-list.png new file mode 100644 index 0000000..092399a Binary files /dev/null and b/content/Stores/img/azure-key-vault-secret-list.png differ diff --git a/content/Stores/img/azure-key-vault-upsert-result.png b/content/Stores/img/azure-key-vault-upsert-result.png new file mode 100644 index 0000000..e4de7b7 Binary files /dev/null and b/content/Stores/img/azure-key-vault-upsert-result.png differ diff --git a/content/Stores/img/cloud-bees-feature-flag-list.png b/content/Stores/img/cloud-bees-feature-flag-list.png new file mode 100644 index 0000000..e3c1b11 Binary files /dev/null and b/content/Stores/img/cloud-bees-feature-flag-list.png differ diff --git a/content/Stores/img/hashicorp-vault-secret-list.png b/content/Stores/img/hashicorp-vault-secret-list.png new file mode 100644 index 0000000..f98c0e1 Binary files /dev/null and b/content/Stores/img/hashicorp-vault-secret-list.png differ diff --git a/content/Stores/img/hashicorp-vault-upsert-result.png b/content/Stores/img/hashicorp-vault-upsert-result.png new file mode 100644 index 0000000..40a9376 Binary files /dev/null and b/content/Stores/img/hashicorp-vault-upsert-result.png differ diff --git a/content/Stores/img/launch-darkly-feature-flag-list.png b/content/Stores/img/launch-darkly-feature-flag-list.png new file mode 100644 index 0000000..f8b6361 Binary files /dev/null and b/content/Stores/img/launch-darkly-feature-flag-list.png differ diff --git a/content/Stores/ini-file.mdx b/content/Stores/ini-file.mdx new file mode 100644 index 0000000..098bd5f --- /dev/null +++ b/content/Stores/ini-file.mdx @@ -0,0 +1,151 @@ +--- +id: ini-file +slug: ini-file +title: INI File +--- + +Integrates the Configu Orchestrator with your INI files. + +## Initialization + +Configu needs to be directed to your desired file by providing a file path via the `path` parameter. + +Example [.configu file](../cli-config) file store configuration for CLI usage: + +```json +{ + "stores": { + "ini-file-store": { + "type": "ini-file", + "configuration": { + "path": "path/to/file.ini" + } + } + } +} +``` + +## Limitations + + +- Configs belonging to the root set will always appear above all other section due to native INI file behavior. + + + +## SDK Usage + + + +```js +import path from 'path'; +import { + IniFileConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new IniFileConfigStore({ path: 'store.ini' }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + await new TestCommand({ store, clean: true }).run(); + + await new UpsertCommand({ + store, + set, + schema, + configs: { + GREETING: 'hey', + SUBJECT: 'configu node.js sdk', + }, + }).run(); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + data, + }).run(); + + console.log(configurationData); + + await new DeleteCommand({ store, set, schema }).run(); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +```bash +configu test --store "ini-file-store" --clean +``` + +### Upsert command + +```bash +configu upsert --store "ini-file-store" --set "test" --schema "./get-started.cfgu.json" \ + -c "GREETING=hey" \ + -c "SUBJECT=configu node.js sdk" +``` + +### Eval and export commands + +```bash +configu eval --store "ini-file-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Clean up the previous upsert by using: + +```bash +configu delete --store "ini-file-store" --set "test" --schema "./get-started.cfgu.json" +``` + +## Examples + +INI file store after upsert: + +```ini +[test] +GREETING=hey +SUBJECT=configu node.js sdk +``` diff --git a/content/Stores/json-file.mdx b/content/Stores/json-file.mdx new file mode 100644 index 0000000..5202682 --- /dev/null +++ b/content/Stores/json-file.mdx @@ -0,0 +1,159 @@ +--- +id: json-file +slug: json-file +title: JSON File +--- + +Integrates the Configu Orchestrator with your JSON files. + +## Initialization + +Configu needs to be directed to your desired file by providing a file path via the `path` parameter. Configs are stored in the JSON file in a root-level array, if using an existing file, make sure it matches this format. + +Example [.configu file](../cli-config) file store configuration for CLI usage: + +```json +{ + "stores": { + "json-file-store": { + "type": "json-file", + "configuration": { + "path": "path/to/file.json" + } + } + } +} +``` + +## SDK Usage + + + +```js +import path from 'path'; +import { + JsonFileConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new JsonFileConfigStore({ path: 'store.json' }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + await new TestCommand({ store, clean: true }).run(); + + await new UpsertCommand({ + store, + set, + schema, + configs: { + GREETING: 'hey', + SUBJECT: 'configu node.js sdk', + }, + }).run(); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + data, + }).run(); + + console.log(configurationData); + + await new DeleteCommand({ store, set, schema }).run(); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +```bash +configu test --store "json-file-store" --clean +``` + +### Upsert command + +```bash +configu upsert --store "json-file-store" --set "test" --schema "./get-started.cfgu.json" \ + -c "GREETING=hey" \ + -c "SUBJECT=configu node.js sdk" +``` + +### Eval and export commands + +```bash +configu eval --store "json-file-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Clean up the previous upsert by using: + +```bash +configu delete --store "json-file-store" --set "test" --schema "./get-started.cfgu.json" +``` + +## Examples + +Empty JSON file store before upsert: + +```json +[] +``` + +JSON file store after upsert: + +```json +[ + { + "key": "GREETING", + "set": "test", + "value": "hey" + }, + { + "key": "SUBJECT", + "set": "test", + "value": "configu node.js sdk" + } +] +``` diff --git a/content/Stores/kubernetes-secret.mdx b/content/Stores/kubernetes-secret.mdx new file mode 100644 index 0000000..a00f893 --- /dev/null +++ b/content/Stores/kubernetes-secret.mdx @@ -0,0 +1,139 @@ +--- +id: kubernetes-secret +slug: kubernetes-secret +title: Kubernetes Secret +--- + +Integrates the Configu Orchestrator with [Kubernetes Secret](https://kubernetes.io/docs/concepts/configuration/secret). + +## Initialization + +Configu needs to be authorized to access your Kubernetes Secret instance. By default, Configu attempts to [load the default kubeconfig credentials](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#the-kubeconfig-environment-variable) via the `KUBECONFIG` environment variable. You can manually provide credentials via a kubeconfig file via the `kubeconfig` parameter. The `namespace` parameter must always be provided. + +Example [.configu file](../cli-config) file store configuration for CLI usage: + +```json +{ + "stores": { + "kubernetes-secret-store": { + "type": "kubernetes-secret", + "configuration": { + "kubeconfig": "path/to/kubeconfig.yaml", + "namespace": "example-namespace" + } + } + } +} +``` + +## SDK Usage + + + +```js +import path from 'path'; +import fs from 'fs/promises'; +import { + KubernetesSecretConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new KubernetesSecretConfigStore({ + kubeconfig: path.resolve(__dirname, './kubeconfig.yaml'), + namespace: 'example-namespace', + }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + await new TestCommand({ store, clean: true }).run(); + + await new UpsertCommand({ + store, + set, + schema, + configs: { + GREETING: 'hey', + SUBJECT: 'configu node.js sdk', + }, + }).run(); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + pipe: data, + }).run(); + + console.log(configurationData); + + await new DeleteCommand({ store, set, schema }).run(); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +```bash +configu test --store "kubernetes-secret-store" --clean +``` + +### Upsert command + +```bash +configu upsert --store "kubernetes-secret-store" --set "test" --schema "./get-started.cfgu.json" \ + -c "GREETING=hey" \ + -c "SUBJECT=configu node.js sdk" +``` + +### Eval and export commands + +```bash +configu eval --store "kubernetes-secret-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Clean up the previous upsert by using: + +```bash +configu delete --store "kubernetes-secret-store" --set "test" --schema "./get-started.cfgu.json" +``` diff --git a/content/Stores/launch-darkly.mdx b/content/Stores/launch-darkly.mdx new file mode 100644 index 0000000..29fe302 --- /dev/null +++ b/content/Stores/launch-darkly.mdx @@ -0,0 +1,128 @@ +--- +id: launch-darkly +slug: launch-darkly +title: LaunchDarkly +--- + +Integrates the Configu Orchestrator with [LaunchDarkly](https://apidocs.launchdarkly.com/tag/Feature-flags). + +## Initialization + +Configu needs to be authorized to access your LaunchDarkly project. You must specify an `sdkKey` that corresponds to an SDK key of an environment of some LaunchDarkly project and a context that has a `key` or a `targetingKey` that identifies the subject (end-user, or client service) of a flag evaluation. You may also configure [`ldOptions`](https://launchdarkly.github.io/node-server-sdk/interfaces/_launchdarkly_node_server_sdk_.LDOptions.html) to customize the LaunchDarkly client. + +Example [.configu file](../cli-config) file store configuration for CLI usage: + +```json +{ + "stores": { + "launch-darkly-store": { + "type": "launch-darkly", + "configuration": { + "sdkKey": "example-sdkKey", + "context": { "targetingKey": "default" } + } + } + } +} +``` + +## Limitations + + + +- Only supports the eval and export commands + + + +## SDK Usage + + + +```js +import path from 'path'; +import fs from 'fs/promises'; +import { + LaunchDarklyConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new LaunchDarklyConfigStore({ + sdkKey: 'example-sdkKey', + context: { targetingKey: 'default' }, + }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + pipe: data, + }).run(); + + console.log(configurationData); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +Not supported + +### Upsert command + +Not supported + +### Eval and export commands + +```bash +configu eval --store "launch-darkly-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Not supported + +## Examples + +Secrets list: +![image](./img/launch-darkly-feature-flag-list.png) diff --git a/content/Stores/localforage.mdx b/content/Stores/localforage.mdx new file mode 100644 index 0000000..6431e71 --- /dev/null +++ b/content/Stores/localforage.mdx @@ -0,0 +1,62 @@ +--- +id: localforage +slug: localforage +title: LocalForage +--- + +Integrates the Configu Orchestrator with your desired web app async data store via [localForage](https://localforage.github.io/localForage/). + +## Initialization + +The localForage store needs to be initialized with the [localForage configuration options](https://localforage.github.io/localForage/#settings-api-config). + +## Browser SDK Usage + +```js +import { + LocalForageConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/browser'; + +(async () => { + try { + const store = new LocalForageConfigStore({ name: 'example-db-name' }); + const set = new ConfigSet('test'); + const schema = new ConfigSchema('get-started', schemaContents); + + await new TestCommand({ store, clean: true }).run(); + + await new UpsertCommand({ + store, + set, + schema, + configs: { + GREETING: 'hey', + SUBJECT: 'configu node.js sdk', + }, + }).run(); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + data, + }).run(); + + console.log(configurationData); + + await new DeleteCommand({ store, set, schema }).run(); + } catch (error) { + console.error(error); + } +})(); +``` diff --git a/content/Stores/mariadb.mdx b/content/Stores/mariadb.mdx new file mode 100644 index 0000000..18f6ebf --- /dev/null +++ b/content/Stores/mariadb.mdx @@ -0,0 +1,137 @@ +--- +id: mariadb +slug: mariadb +title: MariaDB +--- + +Integrates the Configu Orchestrator with a MariaDB database. + +## Initialization + +Configu needs to be authorized to access your database instance. View the configuration options [here](https://typeorm.io/data-source-options#mysql--mariadb-data-source-options). + +Example [.configu file](../cli-config) file store configuration for CLI usage: + +```json +{ + "stores": { + "mariadb-store": { + "type": "mariadb", + "configuration": { + "url": "example://username:password@example-host" + } + } + } +} +``` + +## SDK Usage + + + +```js +import path from 'path'; +import fs from 'fs/promises'; +import { + MariaDBConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new MariaDBConfigStore({ + url: 'example://username:password@example-host', + }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + await new TestCommand({ store, clean: true }).run(); + + await new UpsertCommand({ + store, + set, + schema, + configs: { + GREETING: 'hey', + SUBJECT: 'configu node.js sdk', + }, + }).run(); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + pipe: data, + }).run(); + + console.log(configurationData); + + await new DeleteCommand({ store, set, schema }).run(); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +```bash +configu test --store "mariadb-store" --clean +``` + +### Upsert command + +```bash +configu upsert --store "mariadb-store" --set "test" --schema "./get-started.cfgu.json" \ + -c "GREETING=hey" \ + -c "SUBJECT=configu node.js sdk" +``` + +### Eval and export commands + +```bash +configu eval --store "mariadb-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Clean up the previous upsert by using: + +```bash +configu delete --store "mariadb-store" --set "test" --schema "./get-started.cfgu.json" +``` diff --git a/content/Stores/mssql.mdx b/content/Stores/mssql.mdx new file mode 100644 index 0000000..4e41f68 --- /dev/null +++ b/content/Stores/mssql.mdx @@ -0,0 +1,137 @@ +--- +id: mssql +slug: mssql +title: Microsoft SQL Server +--- + +Integrates the Configu Orchestrator with a [Microsoft SQL Server](https://learn.microsoft.com/en-us/sql/sql-server) database. + +## Initialization + +Configu needs to be authorized to access your database instance. View the configuration options [here](https://typeorm.io/data-source-options#mssql-data-source-options). + +Example [.configu file](../cli-config) file store configuration for CLI usage: + +```json +{ + "stores": { + "mssql-store": { + "type": "mssql", + "configuration": { + "url": "example://username:password@example-host" + } + } + } +} +``` + +## SDK Usage + + + +```js +import path from 'path'; +import fs from 'fs/promises'; +import { + MSSQLConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new MSSQLConfigStore({ + url: 'example://username:password@example-host', + }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + await new TestCommand({ store, clean: true }).run(); + + await new UpsertCommand({ + store, + set, + schema, + configs: { + GREETING: 'hey', + SUBJECT: 'configu node.js sdk', + }, + }).run(); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + pipe: data, + }).run(); + + console.log(configurationData); + + await new DeleteCommand({ store, set, schema }).run(); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +```bash +configu test --store "mssql-store" --clean +``` + +### Upsert command + +```bash +configu upsert --store "mssql-store" --set "test" --schema "./get-started.cfgu.json" \ + -c "GREETING=hey" \ + -c "SUBJECT=configu node.js sdk" +``` + +### Eval and export commands + +```bash +configu eval --store "mssql-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Clean up the previous upsert by using: + +```bash +configu delete --store "mssql-store" --set "test" --schema "./get-started.cfgu.json" +``` diff --git a/content/Stores/mysql.mdx b/content/Stores/mysql.mdx new file mode 100644 index 0000000..9bafd59 --- /dev/null +++ b/content/Stores/mysql.mdx @@ -0,0 +1,137 @@ +--- +id: mysql +slug: mysql +title: MySQL +--- + +Integrates the Configu Orchestrator with a [MySQL](https://dev.mysql.com/doc) database. + +## Initialization + +Configu needs to be authorized to access your database instance. View the configuration options [here](https://typeorm.io/data-source-options#mysql--mariadb-data-source-options). + +Example [.configu file](../cli-config) file store configuration for CLI usage: + +```json +{ + "stores": { + "mysql-store": { + "type": "mysql", + "configuration": { + "url": "example://username:password@example-host" + } + } + } +} +``` + +## SDK Usage + + + +```js +import path from 'path'; +import fs from 'fs/promises'; +import { + MySQLConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new MySQLConfigStore({ + url: 'example://username:password@example-host', + }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + await new TestCommand({ store, clean: true }).run(); + + await new UpsertCommand({ + store, + set, + schema, + configs: { + GREETING: 'hey', + SUBJECT: 'configu node.js sdk', + }, + }).run(); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + pipe: data, + }).run(); + + console.log(configurationData); + + await new DeleteCommand({ store, set, schema }).run(); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +```bash +configu test --store "mysql-store" --clean +``` + +### Upsert command + +```bash +configu upsert --store "mysql-store" --set "test" --schema "./get-started.cfgu.json" \ + -c "GREETING=hey" \ + -c "SUBJECT=configu node.js sdk" +``` + +### Eval and export commands + +```bash +configu eval --store "mysql-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Clean up the previous upsert by using: + +```bash +configu delete --store "mysql-store" --set "test" --schema "./get-started.cfgu.json" +``` diff --git a/content/Stores/postgres.mdx b/content/Stores/postgres.mdx new file mode 100644 index 0000000..508a36d --- /dev/null +++ b/content/Stores/postgres.mdx @@ -0,0 +1,137 @@ +--- +id: postgres +slug: postgres +title: PostgreSQL +--- + +Integrates the Configu Orchestrator with a [PostgreSQL](https://www.postgresql.org/docs) database. + +## Initialization + +Configu needs to be authorized to access your database instance. View the configuration options [here](https://typeorm.io/data-source-options#postgres--cockroachdb-data-source-options). + +Example [.configu file](../cli-config) file store configuration for CLI usage: + +```json +{ + "stores": { + "postgres-store": { + "type": "postgres", + "configuration": { + "url": "example://username:password@example-host" + } + } + } +} +``` + +## SDK Usage + + + +```js +import path from 'path'; +import fs from 'fs/promises'; +import { + PostgreSQLConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new PostgreSQLConfigStore({ + url: 'example://username:password@example-host', + }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + await new TestCommand({ store, clean: true }).run(); + + await new UpsertCommand({ + store, + set, + schema, + configs: { + GREETING: 'hey', + SUBJECT: 'configu node.js sdk', + }, + }).run(); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + pipe: data, + }).run(); + + console.log(configurationData); + + await new DeleteCommand({ store, set, schema }).run(); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +```bash +configu test --store "postgres-store" --clean +``` + +### Upsert command + +```bash +configu upsert --store "postgres-store" --set "test" --schema "./get-started.cfgu.json" \ + -c "GREETING=hey" \ + -c "SUBJECT=configu node.js sdk" +``` + +### Eval and export commands + +```bash +configu eval --store "postgres-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Clean up the previous upsert by using: + +```bash +configu delete --store "postgres-store" --set "test" --schema "./get-started.cfgu.json" +``` diff --git a/content/Stores/sqlite.mdx b/content/Stores/sqlite.mdx new file mode 100644 index 0000000..dc18c96 --- /dev/null +++ b/content/Stores/sqlite.mdx @@ -0,0 +1,137 @@ +--- +id: sqlite +slug: sqlite +title: SQLite +--- + +Integrates the Configu Orchestrator with a [SQLite](https://www.sqlite.org/docs.html) database. + +## Initialization + +Configu needs to be authorized to access your database instance. View the configuration options [here](https://typeorm.io/data-source-options#better-sqlite3-data-source-options). + +Example [.configu file](../cli-config) file store configuration for CLI usage: + +```json +{ + "stores": { + "sqlite-store": { + "type": "sqlite", + "configuration": { + "database": "example.sql" + } + } + } +} +``` + +## SDK Usage + + + +```js +import path from 'path'; +import fs from 'fs/promises'; +import { + SQLiteConfigStore, + ConfigSet, + ConfigSchema, + UpsertCommand, + EvalCommand, + ExportCommand, + TestCommand, + DeleteCommand, +} from '@configu/node'; + +(async () => { + try { + const store = new SQLiteConfigStore({ + database: 'example.sql', + }); + const set = new ConfigSet('test'); + const absolutePath = path.resolve(path.join(__dirname, 'get-started.cfgu.json')); + const fileContent = await fs.readFile(absolutePath, { encoding: 'utf8' }); + const schemaContents = JSON.parse(fileContent); + const schema = new ConfigSchema('get-started', schemaContents); + + await new TestCommand({ store, clean: true }).run(); + + await new UpsertCommand({ + store, + set, + schema, + configs: { + GREETING: 'hey', + SUBJECT: 'configu node.js sdk', + }, + }).run(); + + const data = await new EvalCommand({ + store, + set, + schema, + }).run(); + + const configurationData = await new ExportCommand({ + pipe: data, + }).run(); + + console.log(configurationData); + + await new DeleteCommand({ store, set, schema }).run(); + } catch (error) { + console.error(error); + } +})(); +``` + +```python +coming soon +``` + +```GO +coming soon +``` + + + +## CLI Usage + +### Test command + +```bash +configu test --store "sqlite-store" --clean +``` + +### Upsert command + +```bash +configu upsert --store "sqlite-store" --set "test" --schema "./get-started.cfgu.json" \ + -c "GREETING=hey" \ + -c "SUBJECT=configu node.js sdk" +``` + +### Eval and export commands + +```bash +configu eval --store "sqlite-store" --set "test" --schema "./get-started.cfgu.json" \ + | configu export +``` + +Export result: + +```json +{ + "GREETING": "hey", + "SUBJECT": "configu node.js sdk", + "MESSAGE": "hey, configu node.js sdk!" +} +``` + +### Delete command + +Clean up the previous upsert by using: + +```bash +configu delete --store "sqlite-store" --set "test" --schema "./get-started.cfgu.json" +``` diff --git a/content/sidebar.json b/content/sidebar.json index 61ed6c8..701ba10 100644 --- a/content/sidebar.json +++ b/content/sidebar.json @@ -159,6 +159,80 @@ } ] }, + { + "title": "Config Stores", + "isOpenByDefault": false, + "items": [ + { + "title": "JSON file", + "slug": "json-file" + }, + { + "title": "INI file", + "slug": "ini-file" + }, + { + "title": "HashiCorp Vault", + "slug": "hashicorp-vault" + }, + { + "title": "AWS Parameter Store", + "slug": "aws-parameter-store" + }, + { + "title": "AWS Secrets Manager", + "slug": "aws-secrets-manager" + }, + { + "title": "Azure Key Vault", + "slug": "azure-key-vault" + }, + { + "title": "GCP Secret Manager", + "slug": "gcp-secret-manager" + }, + { + "title": "Kubernetes Secret", + "slug": "kubernetes-secret" + }, + { + "title": "SQLite", + "slug": "sqlite" + }, + { + "title": "MySQL", + "slug": "mysql" + }, + { + "title": "MariaDB", + "slug": "mariadb" + }, + { + "title": "PostgreSQL", + "slug": "postgres" + }, + { + "title": "CockroachDB", + "slug": "cockroachdb" + }, + { + "title": "Microsoft SQL Server", + "slug": "mssql" + }, + { + "title": "LaunchDarkly", + "slug": "launch-darkly" + }, + { + "title": "CloudBees", + "slug": "cloud-bees" + }, + { + "title": "LocalForage", + "slug": "localforage" + } + ] + }, { "title": "IDE Plugins", "isOpenByDefault": false,