Skip to content

Commit

Permalink
Correct outdated 'myapp' references in simple tutorial (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwashburn authored Oct 11, 2024
1 parent 373219a commit 7c41087
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/quick-start-simple/stacks/deploy/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import:

components:
terraform:
myapp:
station:
vars:
location: Stockholm
lang: se
14 changes: 7 additions & 7 deletions website/docs/quick-start/simple/provision.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ After you've written your components and configured your stacks, now we're ready

## Provision Atmos Components into all Stacks

Provision the `myapp` Atmos component into the stacks:
Provision the `station` Atmos component into the stacks:

```shell
atmos terraform apply myapp -s dev
atmos terraform apply station -s dev

atmos terraform apply myapp -s staging
atmos terraform apply station -s staging

atmos terraform apply myapp -s prod
atmos terraform apply station -s prod
```

Alternatively, you can execute the configured [Atmos workflow](/quick-start/advanced/create-workflows) to provision all the components in all the stacks:
Expand All @@ -42,15 +42,15 @@ atmos workflow apply-all-components -f networking

Looking at the commands above, you might have a question "How does Atmos find the component in the stack and all the variables?"

Let's consider what Atmos does when executing the command `atmos terraform apply myapp -s prod`:
Let's consider what Atmos does when executing the command `atmos terraform apply station -s prod`:

- Atmos uses the `stacks.name_pattern` defined in the [CLI config](/quick-start/advanced/configure-cli). In this example, we have defined a simple name based on `stacks.name_pattern: "{stage}"`. This means that the stack name is just the `stage` part of the stack name.

- Atmos searches for the stack configuration file (in the `stacks` folder and all sub-folders) where `stage: prod` is defined (inline or via imports). During the search, Atmos processes all parent (top-level) config files and compares the context variables specified in the command (`-s` flag) with the context variables defined in the stack configurations, finally finding the matching stack

- Atmos finds the component `myapp` in the stack, processing all the inline configs and all the imports
- Atmos finds the component `station` in the stack, processing all the inline configs and all the imports

- Atmos deep-merges all the catalog imports for the `myapp` component and then deep-merges all the variables for the component defined in all sections (global `vars`, terraform `vars`, base components `vars`, component `vars`), producing the final variables for the `myapp` component in the `prod` stack
- Atmos deep-merges all the catalog imports for the `station` component and then deep-merges all the variables for the component defined in all sections (global `vars`, terraform `vars`, base components `vars`, component `vars`), producing the final variables for the `station` component in the `prod` stack

- And lastly, Atmos writes the final deep-merged variables into a `.tfvar.json` file in the component directory and then
executes `terraform apply -var-file ...` command
Expand Down
2 changes: 1 addition & 1 deletion website/docs/quick-start/simple/simple.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You're about to discover [a new way to think about terraform...](/quick-start/mi

**Spoiler alert** You can’t actually change the weather with Terraform, but you can certainly ask for it.

We’ll [use this example](https://github.com/cloudposse/atmos/tree/main/examples/demo-stacks) to avoid relying on complicated cloud credentials, which can vary based on your organizational context and cloud provider. Instead, we want to focus on Terraform and how to utilize it effectively as a component within Atmos. Once you understand this, you’ll see how to tailor your Terraform "root modules" to work seamlessly with Atmos.
We’ll [use this example](https://github.com/cloudposse/atmos/tree/main/examples/quick-start-simple) to avoid relying on complicated cloud credentials, which can vary based on your organizational context and cloud provider. Instead, we want to focus on Terraform and how to utilize it effectively as a component within Atmos. Once you understand this, you’ll see how to tailor your Terraform "root modules" to work seamlessly with Atmos.

__NOTE:__ This tutorial is for those who prefer hands-on learning and want to create something tangible quickly.
If you prefer to learn theory and concepts first, start with the [Core Concepts](/core-concepts).
Expand Down

0 comments on commit 7c41087

Please sign in to comment.