-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
500 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
website/docs/core-concepts/projects/configuration/stores.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
--- | ||
title: Configure Stores | ||
sidebar_position: 4 | ||
sidebar_label: Configure Stores | ||
id: stores | ||
--- | ||
import Intro from '@site/src/components/Intro' | ||
|
||
<Intro> | ||
Atmos supports the concept of remote stores to facilitate the sharing of values between components or between | ||
some external process and a component. In `atmos`, values are saved to stores via | ||
[hooks](/core-concepts/stacks/hooks) and are read using the [!store](/core-concepts/stacks/yaml-functions/store.mdx) | ||
yaml function. Values can also be saved to stores from outside of `atmos`, for example, from a CI/CD pipeline or a | ||
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/) | ||
</Intro> | ||
|
||
Atmos stores are configured in the `atmos.yaml` file and available to use in stacks via the | ||
[store](/core-concepts/stacks/yaml-functions/store) YAML function. | ||
|
||
## CLI Configuration | ||
|
||
All of these settings should be configured in the [Atmos CLI Configuration](/cli/configuration) found in `atmos.yaml`. | ||
|
||
### Artifactory | ||
|
||
```yaml | ||
stores: | ||
dev/artifactory: | ||
type: artifactory | ||
options: | ||
url: https://cptrialstores.jfrog.io/artifactory | ||
repo_name: tfsharedstore | ||
``` | ||
<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 `artifactory`</dd> | ||
|
||
<dt>`stores.[store_name].options`</dt> | ||
<dd>A map of options specific to the store type. For Artifactory, the following options are supported:</dd> | ||
|
||
<dt>`stores.[store_name].options.access_token (optional)`</dt> | ||
<dd>An access token to use for authentication. This is not recommended as it is less secure than using the | ||
`JFROG_ACCESS_TOKEN` or `ARTIFACTORY_ACCESS_TOKEN` environment variables. See [Authentication](#authentication) below | ||
for more information.</dd> | ||
|
||
<dt>`stores.[store_name].options.prefix (optional)`</dt> | ||
<dd>A prefix path that will be added to all keys stored or retreived from SSM Parameter Store. 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.repo_name (required)`</dt> | ||
<dd>The name of the Artifactory repository to use.</dd> | ||
|
||
<dt>`stores.[store_name].options.url (required)`</dt> | ||
<dd>The URL of the Artifactory instance.</dd> | ||
</dl> | ||
|
||
#### Authentication | ||
|
||
The Artifactory store supports using an access token for authentication. The access token can be set directly in the | ||
`atmos.yaml` (not recommended) or via the `JFROG_ACCESS_TOKEN` or `ARTIFACTORY_ACCESS_TOKEN` environment variables. | ||
|
||
### AWS SSM Parameter Store | ||
|
||
```yaml | ||
stores: | ||
prod/ssm: | ||
type: aws-ssm-parameter-store | ||
options: | ||
region: us-east-2 | ||
``` | ||
|
||
<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 `aws-ssm-parameter-store`</dd> | ||
|
||
<dt>`stores.[store_name].options`</dt> | ||
<dd>A map of options specific to the store type. For AWS SSM Parameter Store, 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 SSM Parameter Store. 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.region (required)`</dt> | ||
<dd>The AWS region to use for the SSM Parameter Store.</dd> | ||
</dl> | ||
|
||
#### Authentication | ||
|
||
The AWS SSM Parameter Store store supports the standard AWS methods for authentication and the `AWS_ACCESS_KEY_ID, | ||
`AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN` environment variables. | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
title: Manage Lifecycle Events with Hooks | ||
sidebar_position: 6 | ||
sidebar_label: Manage Lifecycle Events with Hooks | ||
description: Use lifecycle hooks to take action at various points in the lifecycle of your components. | ||
id: hooks | ||
--- | ||
import Terminal from '@site/src/components/Terminal' | ||
import Intro from '@site/src/components/Intro' | ||
import File from '@site/src/components/File' | ||
|
||
<Intro> | ||
Atmos supports the ability to take action at various points in the lifecycle of your components. This is done by | ||
configuring the `hooks` section in your stack manifest for the component that you want to take action on. | ||
</Intro> | ||
|
||
|
||
## Hooks Schema | ||
|
||
The `hooks` section schema is as follows: | ||
|
||
```yaml | ||
components: | ||
terraform: | ||
top-level-component1: | ||
hooks: | ||
store-outputs: | ||
events: | ||
- after-terraform-apply | ||
command: store | ||
name: prod/ssm | ||
outputs: | ||
vpc_id: .id | ||
``` | ||
## Supported Lifecycle Events | ||
Atmos supports the following lifecycle events: | ||
- `after-terraform-apply` (this event is triggered after the `atmos terraform apply` or `atmos terraform deploy` command is run) | ||
|
||
## Supported Commands | ||
|
||
## store | ||
|
||
The `store` command is used to write data to a remote store. | ||
|
||
<dl> | ||
<dt>`hooks.[hook_name]`</dt> | ||
<dd>This map key is the name you want to give to the hook. This must be unique for each hook in the component.</dd> | ||
|
||
<dt>`stores.[hook_name].events`</dt> | ||
<dd> | ||
This is a list of [Supported Lifecycle Events](#supported-lifecycle-events) that should trigger running the command. | ||
</dd> | ||
|
||
<dt>`stores.[hook_name].command`</dt> | ||
<dd>Must be set to `store`</dd> | ||
|
||
<dt>`stores.[hook_name].name`</dt> | ||
<dd>The name of the store to use.</dd> | ||
|
||
<dt>`stores.[hook_name].outputs`</dt> | ||
<dd> | ||
A map of values that will be written to the store under the key for this component. The key is the name of the key in | ||
the store. The value is the value to write to the store. If the value begins with a dot (`.`), it will be treated as a | ||
[Terraform output](https://developer.hashicorp.com/terraform/language/values/outputs) and the value will be retrieved | ||
from the Terraform state for the current component. | ||
</dd> | ||
</dl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.