Skip to content

Commit

Permalink
Ordering stores, removed redundant examples
Browse files Browse the repository at this point in the history
  • Loading branch information
shirkevich committed Feb 11, 2025
1 parent 21051e7 commit 5c5213c
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 61 deletions.
108 changes: 54 additions & 54 deletions website/docs/core-concepts/projects/configuration/stores.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ script.

Currently, the following stores are supported:

- [AWS SSM Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html)
- [Artifactory](https://jfrog.com/artifactory/)
- [Redis](https://redis.io/)
- [AWS SSM Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html)
- [Google Secret Manager](https://cloud.google.com/secret-manager)
- [Redis](https://redis.io/)
</Intro>

Atmos stores are configured in the `atmos.yaml` file and available to use in stacks via the
Expand Down Expand Up @@ -130,58 +130,6 @@ stores:
The AWS SSM Parameter Store supports the standard AWS methods for authentication and the `AWS_ACCESS_KEY_ID`,
`AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN` environment variables.

### Redis

```yaml
stores:
dev/redis:
type: redis
options:
url: redis://localhost:6379
stage/redis:
type: redis
options:
url: !env ATMOS_STAGE_REDIS_URL
prod/redis:
type: redis
# The ATMOS_REDIS_URL environment variable will be used if no URL is specified in the options
```

<dl>
<dt>`stores.[store_name]`</dt>
<dd>This map key is the name of the store. It must be unique across all stores. This is how the store is referenced in the `store` function.</dd>

<dt>`stores.[store_name].type`</dt>
<dd>Must be set to `redis`</dd>

<dt>`stores.[store_name].options`</dt>
<dd>A map of options specific to the store type. For Redis, the following options are supported:</dd>

<dt>`stores.[store_name].options.prefix (optional)`</dt>
<dd>A prefix path that will be added to all keys stored or retreived from Redis. For example if the prefix
is `/atmos/infra-live/`, and if the stack is `plat-us2-dev`, the component is `vpc`, and the key is `vpc_id`, the full path
would be `/atmos/infra-live/plat-us2-dev/vpc/vpc_id`.</dd>

<dt>`stores.[store_name].options.url`</dt>
<dd>
The URL of the Redis instance. This is optional and the `ATMOS_REDIS_URL` environment variable will be used if no
URL is specified in the options.
</dd>

<dt>`stores.[store_name].options.stacks_delimiter (optional)`</dt>
<dd>
The delimiter that atmos is using to delimit stacks in the key path. This defaults to `-`. This is used to build the
key path for the store.
</dd>
</dl>

#### Authentication

The Redis store supports authentication via the URL in options or via the `ATMOS_REDIS_URL` environment variable. The
URL format is described in the Redis [docs](https://redis.github.io/lettuce/user-guide/connecting-redis/).

### Google Secret Manager

```yaml
Expand Down Expand Up @@ -246,3 +194,55 @@ Google Secret Manager supports multiple authentication methods:

3. **Workload Identity**: When running in GCP, you can use Workload Identity which automatically handles authentication
between GCP services.

### Redis

```yaml
stores:
dev/redis:
type: redis
options:
url: redis://localhost:6379
stage/redis:
type: redis
options:
url: !env ATMOS_STAGE_REDIS_URL
prod/redis:
type: redis
# The ATMOS_REDIS_URL environment variable will be used if no URL is specified in the options
```

<dl>
<dt>`stores.[store_name]`</dt>
<dd>This map key is the name of the store. It must be unique across all stores. This is how the store is referenced in the `store` function.</dd>

<dt>`stores.[store_name].type`</dt>
<dd>Must be set to `redis`</dd>

<dt>`stores.[store_name].options`</dt>
<dd>A map of options specific to the store type. For Redis, the following options are supported:</dd>

<dt>`stores.[store_name].options.prefix (optional)`</dt>
<dd>A prefix path that will be added to all keys stored or retreived from Redis. For example if the prefix
is `/atmos/infra-live/`, and if the stack is `plat-us2-dev`, the component is `vpc`, and the key is `vpc_id`, the full path
would be `/atmos/infra-live/plat-us2-dev/vpc/vpc_id`.</dd>

<dt>`stores.[store_name].options.url`</dt>
<dd>
The URL of the Redis instance. This is optional and the `ATMOS_REDIS_URL` environment variable will be used if no
URL is specified in the options.
</dd>

<dt>`stores.[store_name].options.stacks_delimiter (optional)`</dt>
<dd>
The delimiter that atmos is using to delimit stacks in the key path. This defaults to `-`. This is used to build the
key path for the store.
</dd>
</dl>

#### Authentication

The Redis store supports authentication via the URL in options or via the `ATMOS_REDIS_URL` environment variable. The
URL format is described in the Redis [docs](https://redis.github.io/lettuce/user-guide/connecting-redis/).
7 changes: 0 additions & 7 deletions website/docs/core-concepts/stacks/yaml-functions/store.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ components:
security_group_id: !store security-group/lambda id
security_group_id2: !store security-group/lambda2 {{ .stack }} id
security_group_id3: !store security-group/lambda3 {{ .atmos_stack }} id

# Google Secret Manager examples
db_password: !store database password
api_key: !store api credentials | default "default-key"
# Cross-stack example with GSM
shared_secret: !store secrets {{ .stack }} api_token
# Using template for dynamic stack name with GSM
config_value: !store config {{ printf "%s-%s" .vars.environment .vars.stage }} setting
```
</File>
Expand Down

0 comments on commit 5c5213c

Please sign in to comment.