Skip to content

Add AWS stores docs #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 146 additions & 0 deletions content/Stores/aws-parameter-store.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
---
id: aws-parameter-store
slug: aws-parameter-store
title: AWS Parameter store
---

Integrates the Configu Orchestrator with AWS Parameter Store.

## SDK Usage

<CodeTabs labels={["Node SDK", "Python SDK"]}>

```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 schema = new ConfigSchema(path.join(__dirname, 'get-started.cfgu.json'));

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
```

</CodeTabs>

## CLI Usage

Configu's CLI needs to be authorized to access your AWS Parameter Store account. This can be done two ways

- By default, Configu's CLI uses the standard authentication method AWS uses, if your CLI has the right IAM access credentials, there's no special action to take.
- via the [.configu file](../cli-config).

example .configu file:

```json
{
"stores": {
"aws-param-store": {
"type": "aws-parameter-store",
"configuration": {
"credentials": {
"accessKeyId": "accessKeyId",
"secretAccessKey": "secretAccessKey"
},
"region": "us-east-1"
}
}
}
}
```

### 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)
153 changes: 153 additions & 0 deletions content/Stores/aws-secrets-manager.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
---
id: aws-secrets-manager
slug: aws-secrets-manager
title: AWS Secrets Manager
---

Integrates the Configu Orchestrator with AWS Secrets Manager.

## Limitations

<Admonition type="info">
- A secret scheduled for deletion cannot be changed by the Configu Orchestrator. You will need to
manually cancel the secret deletion.
</Admonition>

## SDK Usage

<CodeTabs labels={["Node SDK", "Python SDK"]}>

```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 schema = new ConfigSchema(path.join(__dirname, 'get-started.cfgu.json'));

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
```

</CodeTabs>

## CLI Usage

Configu's CLI needs to be authorized to access your AWS Secrets Manager account. This can be done two ways

- By default, Configu's CLI uses the standard authentication method AWS uses, if your CLI has the right IAM access credentials, there's no special action to take.
- via the [.configu file](../cli-config).

example .configu file:

```json
{
"stores": {
"aws-secrets-manager-store": {
"type": "aws-secrets-manager",
"configuration": {
"credentials": {
"accessKeyId": "accessKeyId",
"secretAccessKey": "secretAccessKey"
},
"region": "us-east-1"
}
}
}
}
```

### 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)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions content/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,20 @@
}
]
},
{
"title": "Stores",
"isOpenByDefault": false,
"items": [
{
"title": "AWS Secrets Manager",
"slug": "aws-secrets-manager"
},
{
"title": "AWS Parameter Store",
"slug": "aws-parameter-store"
}
]
},
{
"title": "IDE Plugins",
"isOpenByDefault": false,
Expand Down