#atmos (2022-11)

2022-11-01

Dan Miller (Cloud Posse) avatar
Dan Miller (Cloud Posse)
05:55:16 PM

@Dan Miller (Cloud Posse) has joined the channel

2022-11-02

Release notes from atmos avatar
Release notes from atmos
01:14:37 PM

v1.11.0 what Add disabled field to component validation steps Add verbose field to custom command steps Expose component config in custom commands why Add disabled field to component validation steps to be able to to skip the validation step. disabled is set to false by default and the validation step is allowed if disabled attribute is not specified. This is useful when we add component validation in settings.validation at environment/tenant/stage/base component level, but we want to disable…

Release v1.11.0 · cloudposse/atmosattachment image

what Add disabled field to component validation steps Add verbose field to custom command steps Expose component config in custom commands why Add disabled field to component validation steps to…

Release notes from atmos avatar
Release notes from atmos
01:34:36 PM

v1.11.0 what Add disabled field to component validation steps Add verbose field to custom command steps Expose component config in custom commands why Add disabled field to component validation steps to be able to to skip the validation step. disabled is set to false by default and the validation step is allowed if disabled attribute is not specified. This is useful when we add component validation in settings.validation at environment/tenant/stage/base component level, but we want to disable…

2022-11-03

Release notes from atmos avatar
Release notes from atmos
02:14:37 PM

v1.11.1 what Update custom commands Refactor custom commands code why When parsing and executing CLI custom commands, clone the command struct into a local variable because of the automatic closure in the Run function of the Cobra command (the last processed command config affects all the previous ones). Cloning will make a closure over the local variable which is different in each iteration (we cloned just Go slices before, but we need to clone Go maps as well, so we clone the whole struct instead)

Release v1.11.1 · cloudposse/atmosattachment image

what Update custom commands Refactor custom commands code why When parsing and executing CLI custom commands, clone the command struct into a local variable because of the automatic closure in t…

Release notes from atmos avatar
Release notes from atmos
02:34:36 PM

v1.11.1 what Update custom commands Refactor custom commands code why When parsing and executing CLI custom commands, clone the command struct into a local variable because of the automatic closure in the Run function of the Cobra command (the last processed command config affects all the previous ones). Cloning will make a closure over the local variable which is different in each iteration (we cloned just Go slices before, but we need to clone Go maps as well, so we clone the whole struct instead)

Release notes from atmos avatar
Release notes from atmos
05:54:36 AM

v1.11.2 what Update parsing command-line arguments why After refactoring in atmos v1.10.x, the command-line arguments were parsed incorrectly. For example, in the following command atmos terraform plan -s –auto-generate-backend-file=true

the argument –auto-generate-backend-file=true was lost and never applied.

Release v1.11.2 · cloudposse/atmosattachment image

what Update parsing command-line arguments why After refactoring in atmos v1.10.x, the command-line arguments were parsed incorrectly. For example, in the following command atmos terraform plan…

Release notes from atmos avatar
Release notes from atmos
06:14:41 AM

v1.11.2 what Update parsing command-line arguments why After refactoring in atmos v1.10.x, the command-line arguments were parsed incorrectly. For example, in the following command atmos terraform plan -s –auto-generate-backend-file=true

the argument –auto-generate-backend-file=true was lost and never applied.

2022-11-04

Release notes from atmos avatar
Release notes from atmos
04:54:45 PM

v1.11.3 what Fix atmos vendor pull command why The function os.IsNotExist has probably changed in some latest Go versions After calling os.Stat, don’t check for “path does not exist” errors using os.IsNotExist, instead check for all errors This fixes the error: atmos vendor pull -c acm

Pulling sources for the component ‘acm’ from

‘/localhost/infra/components/terraform/acm/github.com/cloudposse/terraform-aws-components.git/modules/acm?ref=1.86.0’

and writing to…

Release v1.11.3 · cloudposse/atmosattachment image

what Fix atmos vendor pull command why The function os.IsNotExist has probably changed in some latest Go versions After calling os.Stat, don’t check for “path does not exist” errors using os.IsN…

Release notes from atmos avatar
Release notes from atmos
05:14:46 PM

v1.11.3 what Fix atmos vendor pull command why The function os.IsNotExist has probably changed in some latest Go versions After calling os.Stat, don’t check for “path does not exist” errors using os.IsNotExist, instead check for all errors This fixes the error: atmos vendor pull -c acm

Pulling sources for the component ‘acm’ from

‘/localhost/infra/components/terraform/acm/github.com/cloudposse/terraform-aws-components.git/modules/acm?ref=1.86.0’

and writing to…

2022-11-05

Release notes from atmos avatar
Release notes from atmos
05:54:41 PM

v1.12.0 what Update atmos custom commands Update atmos terraform generate backends command why Update atmos custom commands to allow the command’s ENV var values to have access to {{ .ComponentConfig.xxx.yyy.zzz }} Go template variables. If a custom command defines component_config section with component and stack, atmos generates the config for the component in the stack and makes it available in {{ .ComponentConfig.xxx.yyy.zzz }} Go template variables, exposing all the component sections. This is…

Release v1.12.0 · cloudposse/atmosattachment image

what Update atmos custom commands Update atmos terraform generate backends command why Update atmos custom commands to allow the command’s ENV var values to have access to {{ .ComponentConfig.xx…

Release notes from atmos avatar
Release notes from atmos
01:34:41 AM

v1.12.1 what Update atmos atlantis generate repo-config command why If an atmos component is derived from a base component, terraform workspace is calculated differently: for a regular atmos component, terraform workspace is the stack name (e.g. tenant1-ue2-prod) for a derived atmos component, terraform workspace is stack name + component name (e.g. tenant1-ue2-prod-)

For example, for the following vpc-2 atmos component vpc-2: metadata: component: infra/vpc terraform workspace in the…

Release v1.12.1 · cloudposse/atmosattachment image

what Update atmos atlantis generate repo-config command why If an atmos component is derived from a base component, terraform workspace is calculated differently: for a regular atmos component,…

Release notes from atmos avatar
Release notes from atmos
01:54:39 AM

v1.12.1 what Update atmos atlantis generate repo-config command why If an atmos component is derived from a base component, terraform workspace is calculated differently: for a regular atmos component, terraform workspace is the stack name (e.g. tenant1-ue2-prod) for a derived atmos component, terraform workspace is stack name + component name (e.g. tenant1-ue2-prod-)

For example, for the following vpc-2 atmos component vpc-2: metadata: component: infra/vpc terraform workspace in the…

Release notes from atmos avatar
Release notes from atmos
05:14:38 AM

v1.12.2 what Add –format=backend-config to atmos terraform generate backends command why Terraform supports -backend-config argument, which required the backend config files to have just the backend attributes without terraform.backend header references https://developer.hashicorp.com/terraform/language/settings/backends/configuration#file test atmos terraform generate backends…

Release v1.12.2 · cloudposse/atmosattachment image

what Add –format=backend-config to atmos terraform generate backends command why Terraform supports -backend-config argument, which required the backend config files to have just the backend at…

Backend Configuration - Configuration Language | Terraform | HashiCorp Developerattachment image

Explore Terraform product documentation, tutorials, and examples.

Release notes from atmos avatar
Release notes from atmos
05:34:42 AM

v1.12.2 what Add –format=backend-config to atmos terraform generate backends command why Terraform supports -backend-config argument, which required the backend config files to have just the backend attributes without terraform.backend header references https://developer.hashicorp.com/terraform/language/settings/backends/configuration#file test atmos terraform generate backends…

2022-11-09

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Andriy Knysh (Cloud Posse), in office hours today, @Joe Caulfield brought up an edge case that prevents atlantis from detecting any changes. When there’s a backend-only change, there’s no .tf or .tfvar file that changes, and it’s non-trivial to know which yaml files should be added as dependencies for the atlantis project. After some ideation, we came up with a solution to address this situation and any other similar one. The root issue, is if we change anything about the configration as it relates to that component instance, (e.g. changed atmos args in the atmos.yaml), we should be triggering a plan. I think the solution is very easy:

• take the deep-merged output from atmos describe component and take an MD5 checksum of it. • Write the checksum as a comment at the top of the .tfvar file that is generated.

• This way, any time any configuration that affects this component is changed, the checksum will change triggering a changed file.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

cc @jose.amengual

jose.amengual avatar
jose.amengual

I will like to understand this more

jose.amengual avatar
jose.amengual

is this running atmos with atlantis on the atlantis image?

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@jose.amengual are you using atmos to generate the backends?

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

…if the backends are not always the same for the component depending on the stack, then the backend.tf.json cannot be committed.

jose.amengual avatar
jose.amengual

yes I do

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

but if the file is not committed, then you cannot detect changes when only the backend changes, and no .tf or varfiles change

jose.amengual avatar
jose.amengual

I have a s3 backend per stack

jose.amengual avatar
jose.amengual

I commit the files

jose.amengual avatar
jose.amengual

with my github action

jose.amengual avatar
jose.amengual
 # Generate tfvars files always
    - name: Generate TF var files and backend configs
      if: github.event.pull_request.state == 'open' || ${{ github.event.issue.pull_request }}
      shell: bash
      run: |
        wget -q <https://github.com/cloudposse/atmos/releases/download/v${ATMOS_VERSION}/atmos_${ATMOS_VERSION}_linux_amd64> && \
        mv atmos_${ATMOS_VERSION}_linux_amd64 /usr/local/bin/atmos && \
        chmod +x /usr/local/bin/atmos
        atmos terraform generate varfiles --file-template={component-path}/varfiles/{namespace}-{environment}-{component}.tfvars.json
        atmos terraform generate backends --format=backend-config --file-template={component-path}/backends/{namespace}-{environment}-{component}.backend
  
    # Commit vars changes (if any) to the PR branch
    - name: Commit changes to the PR branch
      if: github.event.pull_request.state == 'open' || ${{ github.event.issue.pull_request }}
      shell: bash
      run: |
        untracked=$(git ls-files --others --exclude-standard)
        changes_detected=$(git diff --name-only)
        if [ -n "$untracked" ] || [ -n "$changes_detected" ]; then
          git config --global user.name github-actions
          git config --global user.email [email protected]
          git add -A *
          git commit -m "Commiting generated autogenerated var files"
          git push
        fi
        
jose.amengual avatar
jose.amengual

atmos.yaml snip :

  # Workflow templates
    # <https://www.runatlantis.io/docs/custom-workflows.html#custom-init-plan-apply-commands>
    # <https://www.runatlantis.io/docs/custom-workflows.html#custom-run-command>
    # Select a template by using the `--workflow-template <workflow_template>` command-line argument in `atmos atlantis generate repo-config` command
    workflow_templates:
      workflow-1:
        plan:
          steps:
            - run: cp backends/backend.tf .
            - run: terraform init --reconfigure -input=false -backend-config=backends/$PROJECT_NAME.backend
            # When using workspaces, you need to select the workspace using the $WORKSPACE environment variable
            - run: terraform workspace select $WORKSPACE || terraform workspace new $WORKSPACE
            # You must output the plan using `-out $PLANFILE` because Atlantis expects plans to be in a specific location
            - run: terraform plan -input=false -refresh -out $PLANFILE -var-file varfiles/$PROJECT_NAME.tfvars.json
        apply:
          steps:
            - run: terraform apply $PLANFILE
jose.amengual avatar
jose.amengual

the autogenerated backend files that atmos created are in .gitignore

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)
attachment image

what

• Add --format=backend-config to atmos terraform generate backends command

why

• Terraform supports -backend-config argument, which required the backend config files to have just the backend attributes without terraform.backend header

references

https://developer.hashicorp.com/terraform/language/settings/backends/configuration#file

test

atmos terraform generate backends --file-template backends/{tenant}-{environment}-{stage}-{component}.tfbackend --format backend-config --components infra/vpc

Writing backend config for the component 'infra/vpc' to file 'backends/tenant1-ue2-staging-infra-vpc.tfbackend'
Writing backend config for the component 'infra/vpc' to file 'backends/tenant1-ue2-test-1-infra-vpc.tfbackend'
Writing backend config for the component 'infra/vpc' to file 'backends/tenant1-ue2-dev-infra-vpc.tfbackend'
Writing backend config for the component 'infra/vpc' to file 'backends/tenant1-ue2-prod-infra-vpc.tfbackend'
Writing backend config for the component 'infra/vpc' to file 'backends/tenant2-ue2-staging-infra-vpc.tfbackend'
Writing backend config for the component 'infra/vpc' to file 'backends/tenant2-ue2-dev-infra-vpc.tfbackend'
Writing backend config for the component 'infra/vpc' to file 'backends/tenant2-ue2-prod-infra-vpc.tfbackend'

image

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

PePe is using this new functionality to generate the backend config files per component per stack

jose.amengual avatar
jose.amengual

is still hot out of the oven feature

Joe Caulfield avatar
Joe Caulfield

I am using a very similar process in my project that I’m testing with atlantis. The only difference is that I am generating the backend files when atlantis runs but I plan on changing that to commit the .tfbackend files along with the varfiles I am already committing. My initial question I asked that brought this up was if there are any plans to introduce similar functionality to the terraform init command run when running terraform commands through atmos normally. The problem I have run into is that when deploying the same component to multiple stacks since the workspaces are different in each stack terraform init will prompt to select a workspace since the workspace previously selected will not exist in the current stack. My current workaround is to modify the .terraform/environment file but I like the suggestion to use environment variables instead. My though was that having a similar option to the atmos terraform generate backends command to provide the ability to include a partial backend config file in the component then when running terraform command through atmos it could create the backend using the backend-config format instead of the entire backend as json.

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

yes, that can (and will) be implemented: 1) in atmos.yaml we’ll add a flag to specify which backend type to generate; 2) then in all related atmos commands (that use/generate backend files) we’ll check the type, geberate backend file(s) and use -backend-file flag when needed

Joe Caulfield avatar
Joe Caulfield

Awesome, that is exactly what I was hoping to hear!! I’ll be keeping an eye on the release notes

jose.amengual avatar
jose.amengual

in case you missed it :

atmos terraform generate backends --format=backend-config --file-template={component-path}/backends/{namespace}-{environment}-{component}.backend
jose.amengual avatar
jose.amengual

that will generate a backend-config format

jose.amengual avatar
jose.amengual

but the dummy backend.tf is blank

jose.amengual avatar
jose.amengual
terraform {backend s3 {}}
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

yes correct

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

we want to generate backends in diff formats in atmos terraform plan/apply on the fly

jose.amengual avatar
jose.amengual

ahhhhhhhh I c ok

jose.amengual avatar
jose.amengual

If anyone is trying to run Atmos with Atlantis hit me up , in todays OfficeHours there were a few questions about it and I have answers for all!! and the cool think Atmos already supports all those cases

2
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@jose.amengual we just merged the rough draft of the docs for https://atmos.tools

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

would be great to get some of your help with atlantis docs

1

2022-11-10

2022-11-11

Release notes from atmos avatar
Release notes from atmos
07:24:42 PM

v1.13.0 what && why New docs website https://atmos.tools

Introduction to Atmos | atmos

Atmos is a workflow automation tool to manage complex configurations with ease. It’s compatible with Terraform and many other tools.

gabe avatar

As the Cloud Posse team is updating their documentation and tutorials for using SweetOps, I thought it might be useful to develop a sandbox/lab environment for folks to learn some of the fundamentals. We internally use the Instruqt e-learning platform which is convenient for building out demos/labs/training environments.

https://play.instruqt.com/riverpointtechnology/invite/9hknxtho0prk

Feel free to check out the invitation above and walk through the labs that mirror the Cloud Posse tutorials. Like most of you I learn by doing so being able to spin up an on demand environment is very helpful (AWS Account, Code Editor & Lab Guides included). There is a cost associated with us hosting these labs, which I am happy to currently cover, but may need to rate limit. Let me know if they are helpful.

As you can see we have a number of labs that I would like to continue to build out including integrations with Spacelift, Atlantis and TFC.

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

thanks @gabe, this sounds interesting, we’ll take a look

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

wow, that’s rad

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
gabe avatar

@Erik Osterman (Cloud Posse) - did this lab environment provision for you? 2 mins is avg time for lab to spin up

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

I wasn’t able to get back to it

Release notes from atmos avatar
Release notes from atmos
07:44:41 PM

v1.13.0 what && why New docs website https://atmos.tools

Release notes from atmos avatar
Release notes from atmos
08:44:44 PM

v1.13.1 what Allow Helmfile component without using EKS. why Because atmos could be used without using EKS.

Release v1.13.1 · cloudposse/atmosattachment image

what Allow Helmfile component without using EKS. why Because atmos could be used without using EKS.

Release notes from atmos avatar
Release notes from atmos
09:04:43 PM

v1.13.1 what Allow Helmfile component without using EKS. why Because atmos could be used without using EKS.

2022-11-14

Release notes from atmos avatar
Release notes from atmos
05:44:35 PM

v1.13.2 what Update docs website and atmos help commands why Better looking website Improve the website color theme Update/improve CLI/Configuration and CLI/Commands sections (https://atmos.tools/category/commands)

Release v1.13.2 · cloudposse/atmosattachment image

what

Update docs website and atmos help commands

why

Better looking website Improve the website color theme Update/improve CLI/Configuration and CLI/Commands sections (https://atmos.tools/catego

Introduction to Atmos | atmos

Atmos is a workflow automation tool to manage complex configurations with ease. It’s compatible with Terraform and many other tools.

Release notes from atmos avatar
Release notes from atmos
06:04:38 PM

v1.13.2 what Update docs website and atmos help commands why Better looking website Improve the website color theme Update/improve CLI/Configuration and CLI/Commands sections (https://atmos.tools/category/commands)

Release notes from atmos avatar
Release notes from atmos
02:44:32 AM

v1.13.3 what Documentation website sections: tutorials glossary component library mixins imports

why Consolidate atmos documentation under the new docs site

Release v1.13.3 · cloudposse/atmosattachment image

what

Documentation website sections:

tutorials glossary component library mixins imports

why

Consolidate atmos documentation under the new docs site

2022-11-15

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@here we’re actively working on documentation and have pushed a whole new site to https://atmos.tools

Please let us know what you want to see…

Introduction to Atmos | atmos

Atmos is a workflow automation tool to manage complex configurations with ease. It’s compatible with Terraform and many other tools.

3
Release notes from atmos avatar
Release notes from atmos
11:04:39 PM

Documentation Updates Reorganize CLI commands & subcommands Improve the introduction Describe the AWS integrations

Release Documentation Updates · cloudposse/atmosattachment image

Reorganize CLI commands & subcommands Improve the introduction Describe the AWS integrations

Release notes from atmos avatar
Release notes from atmos
11:24:41 PM

v1.13.4 Reorganize CLI commands & subcommands Improve the introduction Describe the AWS integrations

2022-11-16

Release notes from atmos avatar
Release notes from atmos
05:44:36 PM

v1.13.5 what Standardize CLI commands formatting Provide a general command usage page that embeds the auto-generated index Add “Component Inheritance” section to the docs why It was not clear what each command should be used for without reading further down the page Having one separate index page and an index page of subcommand led to information being sprawled across two pages, rather than having a single usage page that shows general command usage and all available subcommands “Component…

Release v1.13.5 · cloudposse/atmosattachment image

what

Standardize CLI commands formatting Provide a general command usage page that embeds the auto-generated index Add “Component Inheritance” section to the docs

why

It was not clear what each …

Release notes from atmos avatar
Release notes from atmos
06:04:39 PM

v1.13.5 what Standardize CLI commands formatting Provide a general command usage page that embeds the auto-generated index Add “Component Inheritance” section to the docs why It was not clear what each command should be used for without reading further down the page Having one separate index page and an index page of subcommand led to information being sprawled across two pages, rather than having a single usage page that shows general command usage and all available subcommands “Component…

Release notes from atmos avatar
Release notes from atmos
09:24:47 PM

v1.14.0 what add shell completion script generation for bash, zsh, fish and powershell users can now run atmos completion [bash|zsh|fish|powershell] and atmos will output the shell completion script for that shell why so users can run atmos [tab][tab] and get command auto-completion

Release v1.14.0 · cloudposse/atmosattachment image

what

add shell completion script generation for bash, zsh, fish and powershell users can now run atmos completion [bash|zsh|fish|powershell] and atmos will output the shell completion script for t…

Release notes from atmos avatar
Release notes from atmos
09:44:37 PM

v1.14.0 what add shell completion script generation for bash, zsh, fish and powershell users can now run atmos completion [bash|zsh|fish|powershell] and atmos will output the shell completion script for that shell why so users can run atmos [tab][tab] and get command auto-completion

2022-11-17

Matt Gowie avatar
Matt Gowie

Love seeing all the work on Atmos docs. Feel like it has the chance to get some serious legs under it now that there is a strong starting point that is in one place! Well done to ya’ll Gonna spin through the new docs at some point over the coming week or so and I’ll provide feedback when I do!

2
2
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Thanks man! Let me know where you think we should focus next.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Andriy Knysh (Cloud Posse) is working on the QuickStart

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

yes, we have some things to add yet 9which we know about), we’ll add it in the coming days/weeks. Please let us know what info you want to see in the docs

2022-11-21

Release notes from atmos avatar
Release notes from atmos
05:34:36 PM

v1.15.0 what & why Update atmos “deps” calculation. In some cases, when more than one different YAML stack config files imported the same import (b/c some components in both derived from the same base component), then all of those stack config files were added to the component’s “deps” list (resulting in Spacelift stacks having unrelated dependency labels which would cause unnecessary stack triggering) Document atmos completion CLI command Add “Component-Oriented Programming” page to document…

Release v1.15.0 · cloudposse/atmosattachment image

what & why

Update atmos “deps” calculation. In some cases, when more than one different YAML stack config files imported the same import (b/c some components in both derived from the same base com…

1
Susie avatar
Introduction to Atmos | atmos

Atmos is a workflow automation tool to manage complex configurations with ease. It’s compatible with Terraform and many other tools.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Yes! @Andriy Knysh (Cloud Posse) is planning to finish that this week

Introduction to Atmos | atmos

Atmos is a workflow automation tool to manage complex configurations with ease. It’s compatible with Terraform and many other tools.

1
Susie avatar

Tag me when you do I was going to write a python wrapper to deploy my topology but i’m really excited to use atmos and share it with my team. Struggle bussing through the docs!

Susie avatar

Can atmos workflows be used to deploy multiple terraform configurations? For example, I have broken down my deployment into services: vpc, eks, rds, etc. Currently, this requires cd’ing to each directory and running plan then apply to bring up each service. Could atmos workflows be leveraged to string these together?

jose.amengual avatar
jose.amengual

yes

jose.amengual avatar
jose.amengual

you can use the deploy command in atmos to do a plan and apply in one go

jose.amengual avatar
jose.amengual

or do sequencial run of plan and apply etc

Susie avatar

The command subcommand under workflows i thought would only be terraform commands as shown here - https://github.com/cloudposse/atmos/blob/master/examples/complete/stacks/workflows/workflow1.yaml

how can i use the atmos deploy

workflows:

  terraform-plan-all-test-components:
    description: |
      Run 'terraform plan' on 'test/test-component' and all its derived components.
      The stack must be provided on the command line: atmos workflow terraform-plan-all-test-components -f workflow1 -s <stack>
    steps:
      - command: terraform plan test/test-component
      - command: terraform plan test/test-component-override
      - command: terraform plan test/test-component-override-2
      - command: terraform plan test/test-component-override-3

  terraform-plan-test-component-override-2-all-stacks:
    description: Run 'terraform plan' on 'test/test-component-override-2' component in all stacks
    steps:
      - command: terraform plan test/test-component-override-2 -s tenant1-ue2-dev
      - command: terraform plan test/test-component-override-2 -s tenant1-ue2-staging
      - command: terraform plan test/test-component-override-2 -s tenant1-ue2-prod
      - command: terraform plan test/test-component-override-2 -s tenant2-ue2-dev
      - command: terraform plan test/test-component-override-2 -s tenant2-ue2-staging
      - command: terraform plan test/test-component-override-2 -s tenant2-ue2-prod

  terraform-plan-test-component-override-3-all-stacks:
    description: Run 'terraform plan' on 'test/test-component-override-3' component in all stacks
    steps:
      - command: terraform plan test/test-component-override-3
        # The step `stack` attribute overrides any stack in the `command` (if specified)
        stack: tenant1-ue2-dev
      - command: terraform plan test/test-component-override-3
        stack: tenant1-ue2-staging
      - command: terraform plan test/test-component-override-3
        stack: tenant1-ue2-prod
      - command: terraform plan test/test-component-override-3
        stack: tenant2-ue2-dev
      - command: terraform plan test/test-component-override-3
        stack: tenant2-ue2-staging
      - command: terraform plan test/test-component-override-3
        stack: tenant2-ue2-prod

  terraform-plan-all-tenant1-ue2-dev:
    description: Run 'terraform plan' on all components in the 'tenant1-ue2-dev' stack
    # The workflow `stack` attribute overrides any stack in the `command` (if specified)
    # The step `stack` attribute overrides any stack in the `command` (if specified) and the workflow `stack` attribute
    stack: tenant1-ue2-dev
    steps:
      - command: echo Running terraform plan on the component 'test/test-component' in the stack 'tenant1-ue2-dev'
        type: shell
      - command: terraform plan test/test-component
        # Type `atmos` is implicit, you don't have to specify it
        # Other supported types: 'shell'
        type: atmos
      - command: echo Running terraform plan on the component 'test/test-component-override' in the stack 'tenant1-ue2-dev'
        type: shell
      - command: terraform plan test/test-component-override
        type: atmos
      - command: echo Running terraform plan on the component 'test/test-component-override-2' in the stack 'tenant1-ue2-dev'
        type: shell
      - command: terraform plan test/test-component-override-2
        type: atmos
      - command: echo Running terraform plan on the component 'test/test-component-override-3' in the stack 'tenant1-ue2-dev'
        type: shell
      - command: terraform plan test/test-component-override-3
        type: atmos

  test-1:
    description: Test workflow
    steps:
      - command: echo Command 1
        type: shell
      - command: echo Command 2
        type: shell
      - command: echo Command 3
        type: shell
      - command: echo Command 4
        type: shell
      - command: echo Command 5
        type: shell

Susie avatar

is there an example or tutorial you can link? this is my first time using atmos. heard about it on the Office Hour last week

jose.amengual avatar
jose.amengual

I thought you were talking about terraform

Susie avatar

i am talking about terraform

Susie avatar

terraform doesn’t have the deploy command, atmos does. i didn’t knw you could provide atmos workflow with atmos commands. that is what i was saying

jose.amengual avatar
jose.amengual

ahhh ok, yes you can

jose.amengual avatar
jose.amengual

the deploy command is the same as: terrafrom plan && terraform apply -auto-aprove

jose.amengual avatar
jose.amengual

that is what basically it does

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)
# Atmos workflows for managing EKS clusters

workflows:

  deploy-basics:
    description: Deploy the basic infrastructure for an EKS cluster
    steps:
    - command: terraform deploy eks/karpenter
    - command: terraform deploy eks/karpenter-provisioner
    - command: terraform deploy eks/cert-manager
    - command: terraform deploy eks/alb-controller
    - command: terraform deploy eks/external-dns
    - command: terraform deploy eks/reloader
    - command: terraform deploy eks/echo-server
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)
Introduction to Atmos | atmos

Atmos is a workflow automation tool to manage complex configurations with ease. It’s compatible with Terraform and many other tools.

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)
workflows:

  terraform-plan-all-test-components:
    description: |
      Run 'terraform plan' on 'test/test-component' and all its derived components.
      The stack must be provided on the command line: atmos workflow terraform-plan-all-test-components -f workflow1 -s <stack>
    steps:
      - command: terraform plan test/test-component
      - command: terraform plan test/test-component-override
      - command: terraform plan test/test-component-override-2
      - command: terraform plan test/test-component-override-3

  terraform-plan-test-component-override-2-all-stacks:
    description: Run 'terraform plan' on 'test/test-component-override-2' component in all stacks
    steps:
      - command: terraform plan test/test-component-override-2 -s tenant1-ue2-dev
      - command: terraform plan test/test-component-override-2 -s tenant1-ue2-staging
      - command: terraform plan test/test-component-override-2 -s tenant1-ue2-prod
      - command: terraform plan test/test-component-override-2 -s tenant2-ue2-dev
      - command: terraform plan test/test-component-override-2 -s tenant2-ue2-staging
      - command: terraform plan test/test-component-override-2 -s tenant2-ue2-prod

  terraform-plan-test-component-override-3-all-stacks:
    description: Run 'terraform plan' on 'test/test-component-override-3' component in all stacks
    steps:
      - command: terraform plan test/test-component-override-3
        # The step `stack` attribute overrides any stack in the `command` (if specified)
        stack: tenant1-ue2-dev
      - command: terraform plan test/test-component-override-3
        stack: tenant1-ue2-staging
      - command: terraform plan test/test-component-override-3
        stack: tenant1-ue2-prod
      - command: terraform plan test/test-component-override-3
        stack: tenant2-ue2-dev
      - command: terraform plan test/test-component-override-3
        stack: tenant2-ue2-staging
      - command: terraform plan test/test-component-override-3
        stack: tenant2-ue2-prod

  terraform-plan-all-tenant1-ue2-dev:
    description: Run 'terraform plan' on all components in the 'tenant1-ue2-dev' stack
    # The workflow `stack` attribute overrides any stack in the `command` (if specified)
    # The step `stack` attribute overrides any stack in the `command` (if specified) and the workflow `stack` attribute
    stack: tenant1-ue2-dev
    steps:
      - command: echo Running terraform plan on the component 'test/test-component' in the stack 'tenant1-ue2-dev'
        type: shell
      - command: terraform plan test/test-component
        # Type `atmos` is implicit, you don't have to specify it
        # Other supported types: 'shell'
        type: atmos
      - command: echo Running terraform plan on the component 'test/test-component-override' in the stack 'tenant1-ue2-dev'
        type: shell
      - command: terraform plan test/test-component-override
        type: atmos
      - command: echo Running terraform plan on the component 'test/test-component-override-2' in the stack 'tenant1-ue2-dev'
        type: shell
      - command: terraform plan test/test-component-override-2
        type: atmos
      - command: echo Running terraform plan on the component 'test/test-component-override-3' in the stack 'tenant1-ue2-dev'
        type: shell
      - command: terraform plan test/test-component-override-3
        type: atmos

  test-1:
    description: Test workflow
    steps:
      - command: echo Command 1
        type: shell
      - command: echo Command 2
        type: shell
      - command: echo Command 3
        type: shell
      - command: echo Command 4
        type: shell
      - command: echo Command 5
        type: shell

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

command can be of type atmos (can execute any atmos command, this is the default) or shell (can execute any shell command)

1
Susie avatar

OK, i see what you’re saying now. I was confused when you used terraform deploy since that’s not a terraform command. Like how you have it in “# Atmos workflows for managing EKS clusters”. Maybe you have an alias for it or something.

I now have the workflow I want but I am stuck on how to build a stack. I’ll waiti for the docs to be updates on that unless there is an example somewhere? I have all my variables in a .tfvars file and am passing that to terraform but atmos won’t let me run without the stack

Susie avatar
workflows:
  # Can also be set using 'ATMOS_WORKFLOWS_BASE_PATH' ENV var, or '--workflows-dir' command-line arguments
  # Supports both absolute and relative paths
    vpc-and-s3:
    description: |
      Deploy the VPC and S3 buckets to test atmos
    steps:
      - command: terraform plan aws-networking -var-file="UKDev_vpn.tfvars"
      - command: terraform plan s3-buckets
Susie avatar

this is in my atmos.yaml

Susie avatar

Do i have to redefine the values in my tfvars into the stack or does atmos support referencing the vars file?

Susie avatar

Can the stack by empty like it is here?

Susie avatar
import: []
vars:
  stage: example

terraform:
  vars: {}

helmfile:
  vars: {}

components:
  terraform:
    fetch-location:
      vars: {}

    fetch-weather:
      vars: {}

    output-results:
      vars:
        print_users_weather_enabled: true

  helmfile: {}

workflows:
  deploy-all:
    description: Deploy terraform projects in order
    steps:
      - job: terraform deploy fetch-location
      - job: terraform deploy fetch-weather
      - job: terraform deploy output-results

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

atmos does not reference anything in tfvar files, it’s terraform thing

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

the stacks can be empty (if you have all vars in varfiles, it will work, but it’s not what atmos is for)

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

here is an example on how to create first stacks (using catalog and import) https://atmos.tools/core-concepts/components/inheritance

Introduction to Atmos | atmos

Atmos is a workflow automation tool to manage complex configurations with ease. It’s compatible with Terraform and many other tools.

1
Susie avatar
Executing command:
/opt/homebrew/bin/terraform plan -var-file example-aws-networking.terraform.tfvars.json -out example-aws-networking.planfile -var-file='UKDev_vpn.tfvars'
╷
│ Error: Failed to read variables file
│ 
│ Given variables file 'UKDev_vpn.tfvars' does not exist.
Susie avatar
workflows:
  # Can also be set using 'ATMOS_WORKFLOWS_BASE_PATH' ENV var, or '--workflows-dir' command-line arguments
  # Supports both absolute and relative paths
  vpc-and-s3:
    description: Deploy the VPC and S3 buckets to test atmos
    steps:
      - command: terraform plan aws-networking -var-file='UKDev_vpn.tfvars'
      - command: terraform plan s3-buckets
Susie avatar

thanks, i am copying the stack from the tutorial

Susie avatar

I’ll move the var file to atmos config in the future, i’m first confirming that this will work for what the project needs.

Susie avatar

Disregard my last comments, I see that i can simply past the content of my .tvars file under the vars section in the components.

2022-11-22

2022-11-30

Release notes from atmos avatar
Release notes from atmos
03:44:38 PM

v1.16.0 what & why

Allow custom CLI commands to be any complex shell commands

Fixes and improvements (big thanks to @stoned): <a class=”issue-link js-issue-link” data-error-text=”Failed to load title” data-id=”1456928939” data-permission-text=”Title is private”…

Release v1.16.0 · cloudposse/atmosattachment image

what & why

Allow custom CLI commands to be any complex shell commands

Fixes and improvements (big thanks to @stoned):

#260 #265 #264 #259

stoned - Overview

stoned has 53 repositories available. Follow their code on GitHub.

Release notes from atmos avatar
Release notes from atmos
04:04:45 PM

v1.16.0 what & why

Allow custom CLI commands to be any complex shell commands

Fixes and improvements (big thanks to @stoned): <a class=”issue-link js-issue-link” data-error-text=”Failed to load title” data-id=”1456928939” data-permission-text=”Title is private”…

    keyboard_arrow_up