Releases: cloudposse/atmos
v1.182.0
Improve logging and error handling @aknysh (#1358)
what
-
Improve logging
- Remove the deprecated logs functions throughout the codebase
- Only use the structured log functions (
log.Info
,log.Debug
,log.Warn
)
-
Improve error handling
- Add a new Go package
errors
with all functions and data structures related to error handling in the codebase (all other packages import theerrors
package and call its functions) - Remove all functions from the codebase that would exit the program execution earlier:
panic()
,log.Fatal()
,os.Exit()
, and some old Atmos error handling functions - In the new
errors
package, add a function to print errors in Markdown format (if Markdown is configured and TTY is supported), and a function to print errors and exit the program execution
- Add a new Go package
-
Don't process Atmos YAML functions and Go templates in
atmos validate stacks
why
-
Improve logging
- Standardize logs
- Make it easy to parse and analyze by log aggregators, SIEM tools, or monitoring systems
- Easier integration with tracing/Telemetry
- Consistency across logs
- Better debugging and contextual info
- Improved querying and filtering
-
Improve error handling
- Better, standard UI/UX
- All errors and program exits are handled in just one place, allowing easily configuring the look and feel of all error messages, and adding hooks for Tracing/Telemetry with just a few lines of code/config
- All early exits from any functions in the codebase (due to errors or other conditions) are now funneled through just one function in the
errors
package, allowing easier controlling the code execution and exit behavior
-
Don't process Atmos YAML functions and Go templates in
atmos validate stacks
. YAML functions and Go templates can access backends and clouds, butatmos validate stacks
should not require authentication and assuming roles
test
atmos terraform apply --affected --all --dry-run
atmos terraform apply component-1 -s nonprods
atmos terraform apply component-2 -s prod
atmos terraform apply component-1 -s nonprod
atmos terraform apply --all --logs-level=Debu
Add pager to `atmos describe dependents` command @samtholiya (#1295)
what
- Add pager to
atmos describe dependents
command
why
- Helps to view the dependents better in case of large dependents list
Update help with pager @samtholiya (#1276)
what
- Updated help with pager
why
- Makes easier for users to view the content
Add `--format` flag to `atmos version` command @samtholiya (#1322)
what
- Use different output formats: plain text, JSON, or YAML
why
- Required for automation
v1.181.0
Terraform/OpenTofu Multi-Component Commands (Filtered/Bulk Operations) @aknysh (#1327)
what
- Add Terraform/OpenTofu Multi-Component Commands (Filtered/Bulk Operations)
atmos terraform plan/apply/deploy --all
atmos terraform plan/apply/deploy --all --stack <stack>
atmos terraform plan/apply/deploy --affected
atmos terraform plan/apply/deploy --affected --stack <stack>
atmos terraform plan/apply/deploy --affected --include-dependents
atmos terraform plan/apply/deploy --affected --stack <stack> --include-dependents
atmos terraform plan/apply/deploy --components <component1>,<component2>
atmos terraform plan/apply/deploy --components <component1>,<component2> --stack <stack>
atmos terraform plan/apply/deploy --query <yq-expression>
atmos terraform plan/apply/deploy --query <yq-expression> --stack <stack>
- Add unit tests
- Update docs
why
- Allow Terraform/Opentofu operations (plan, apply, deploy) on a set of components in all stacks or a specific stack depending on stack, set of components, query, or filters
description
Atmos Terraform/OpenTofu commands fall into two categories:
-
Single-Component: Run Terraform for one component at a time
-
Multi-Component (Filtered/Bulk): Run Terraform across multiple components using stack names, selectors, or change detection
Single-Component Commands Usage
# Execute `terraform <command>` on a `component` in a `stack`
atmos terraform <command> <component> -s <stack> [options]
atmos terraform <command> <component> --stack <stack> [options]
Multi-Component Commands (Bulk Operations) Usage
# Execute `terraform <command>` on all components in the stack `prod`
atmos terraform <command> --stack prod
# Execute `terraform <command>` on components `component-1` and `component-2` in all stacks
atmos terraform <command> --components component-1,component-2
# Execute `terraform <command>` on components `component-1` and `component-2` in the stack `prod`
atmos terraform <command> --stack prod --components component-1,component-2
# Execute `terraform <command>` on all components in all stacks
atmos terraform <command> --all
# Execute `terraform <command>` on all components in the stack `prod`
atmos terraform <command> --all --stack prod
# Execute `terraform <command>` on all the directly affected components in all stacks in dependency order
# (if component dependencies are configured)
atmos terraform <command> --affected
# Execute `terraform <command>` on all the directly affected components in the `prod` stack in dependency order
# (if component dependencies are configured)
atmos terraform <command> --affected --stack prod
# Execute `terraform <command>` on all the directly affected components in all stacks in dependency order.
# For each directly affected component, detect the dependent components and process them in dependency order, recursively.
# Dependents are components that are indirectly affected, meaning that nothing in the current branch modifies their code
# or configs, but they are configured as dependencies of the components that are modified
atmos terraform <command> --affected --include-dependents
# Execute `terraform <command>` on all the directly affected components in the `prod` stack in dependency order.
# For each directly affected component, detect the dependent components and process them in dependency order, recursively.
atmos terraform <command> --affected --include-dependents --stack prod
# Execute `terraform <command>` on all components that have `vars.tags.team == "data"`, in all stacks
atmos terraform <command> --query '.vars.tags.team == "data"'
# Execute `terraform <command>` on all components that have `vars.tags.team == "eks"`, in the stack `prod`
atmos terraform <command> --query '.vars.tags.team == "eks"' --stack prod
# Execute `terraform <command>` on all components that have `settings.context.account_id == 12345`, in all stacks
atmos terraform <command> --query '.settings.context.account_id == 12345'
Multi-Component Commands (Bulk Operations) Examples
Let's assume that we have the following Atmos stack manifests in the prod
and nonprod
stacks,
with dependencies between the components:
components:
terraform:
vpc:
vars:
tags:
# Team `network` manages the `vpc` component
team: network
eks/cluster:
vars:
tags:
# Team `eks` manages the `eks/cluster` component
team: eks
settings:
depends_on:
# `eks/cluster` depends on the `vpc` component
1:
component: vpc
eks/external-dns:
vars:
tags:
# Team `eks` manages the `eks/external-dns` component
team: eks
settings:
depends_on:
# `eks/external-dns` depends on the `eks/cluster` component
1:
component: eks/cluster
eks/karpenter:
vars:
tags:
# Team `eks` manages the `eks/karpenter` component
team: eks
settings:
depends_on:
# `eks/karpenter` depends on the `eks/cluster` component
1:
component: eks/cluster
eks/karpenter-node-pool:
vars:
tags:
# Team `eks` manages the `eks/karpenter-node-pool` component
team: eks
settings:
# `eks/karpenter-node-pool` depends on the `eks/cluster` and `eks/karpenter` components
depends_on:
1:
component: eks/cluster
2:
component: eks/karpenter
eks/istio/base:
vars:
tags:
# Team `istio` manages the `eks/istio/base` component
team: istio
settings:
# `eks/istio/base` depends on the `eks/cluster` component
depends_on:
1:
component: eks/cluster
eks/istio/istiod:
vars:
tags:
# Team `istio` manages the `eks/istio/istiod` component
team: istio
settings:
# `eks/istio/istiod` depends on the `eks/cluster` and `eks/istio/base` components
depends_on:
1:
component: eks/cluster
2:
component: eks/istio/base
eks/istio/test-app:
vars:
tags:
# Team `istio` manages the `eks/istio/test-app` component
team: istio
settings:
# `eks/istio/test-app` depends on the `eks/cluster`, `eks/istio/istiod` and `eks/istio/base` components
depends_on:
1:
component: eks/cluster
2:
component: eks/istio/istiod
3:
component: eks/istio/base
Let's run the following Multi-Component commands in dry-run
mode and review the output to understand what each command executes:
# Execute the `terraform apply` command on all components in all stacks
> atmos terraform apply --all --dry-run
Executing command="atmos terraform apply vpc -s nonprod"
Executing command="atmos terraform apply eks/cluster -s nonprod"
Executing command="atmos terraform apply eks/external-dns -s nonprod"
Executing command="atmos terraform apply eks/istio/base -s nonprod"
Executing command="atmos terraform apply eks/istio/istiod -s nonprod"
Executing command="atmos terraform apply eks/istio/test-app -s nonprod"
Executing command="atmos terraform apply eks/karpenter -s nonprod"
Executing command="atmos terraform apply eks/karpenter-node-pool -s nonprod"
Executing command="atmos terraform apply vpc -s prod"
Executing command="atmos terraform apply eks/cluster -s prod"
Executing command="atmos terraform apply eks/external-dns -s prod"
Executing command="atmos terraform apply eks/istio/base -s prod"
Executing command="atmos terraform apply eks/istio/istiod -s prod"
Executing command="atmos terraform apply eks/istio/test-app -s prod"
Executing command="atmos terraform apply eks/karpenter -s prod"
Executing command="atmos terraform apply eks/karpenter-node-pool -s prod"
# Execute the `terraform apply` command on all components in the `prod` stack
> atmos terraform apply --all --stack prod --dry-run
Executing command="atmos terraform apply vpc -s prod"
Executing command="atmos terraform apply eks/cluster -s prod"
Executing command="atmos terraform apply eks/external-dns -s prod"
Executing command="atmos terraform apply eks/istio/base -s prod"
Executing command="atmos terraform apply eks/istio/istiod -s prod"
Executing command="atmos terraform apply eks/istio/test-app -s prod"
Executing command="atmos terraform apply eks/karpenter -s prod"
Executing command="atmos terraform apply eks/karpenter-node-pool -s prod"
# Execute the `terraform apply` command on all components in the `prod` stack
> atmos terraform apply --stack prod --dry-run
Executing command="atmos terraform apply vpc -s prod"
Executing command="atmos terraform apply eks/cluster -s prod"
Executing command="atmos terraform apply eks/external-dns -s prod"
Executing command="atmos terraform apply eks/istio/base -s prod"
Executing command="atmos terraform apply eks/istio/istiod -s prod"
Executing command="atmos terraform apply eks/istio/test-app -s prod"
Executing command="atmos terraform apply eks/karpenter -s prod"
Executing command="atmos terraform apply eks/karpenter-node-pool -s prod"
# Execute the `terraform apply` command on the `vpc` and `eks/cluster` components
# in all stacks.
> atmos terraform apply --components vp...
v1.181.0-test.9
🚀 Feature Preview Release
This is a feature preview based on an open pull request. It is intended for testing artifacts and validating functionality before the feature is merged.
Warning
This release is temporary and may be removed at any time without notice.
v1.181.0-test.8
🚀 Feature Preview Release
This is a feature preview based on an open pull request. It is intended for testing artifacts and validating functionality before the feature is merged.
Warning
This release is temporary and may be removed at any time without notice.
v1.181.0-test.7
🚀 Feature Preview Release
This is a feature preview based on an open pull request. It is intended for testing artifacts and validating functionality before the feature is merged.
Warning
This release is temporary and may be removed at any time without notice.
v1.181.0-test.6
🚀 Feature Preview Release
This is a feature preview based on an open pull request. It is intended for testing artifacts and validating functionality before the feature is merged.
Warning
This release is temporary and may be removed at any time without notice.
v1.181.0-test.5
🚀 Feature Preview Release
This is a feature preview based on an open pull request. It is intended for testing artifacts and validating functionality before the feature is merged.
Warning
This release is temporary and may be removed at any time without notice.
v1.181.0-test.4
🚀 Feature Preview Release
This is a feature preview based on an open pull request. It is intended for testing artifacts and validating functionality before the feature is merged.
Warning
This release is temporary and may be removed at any time without notice.
v1.181.0-test.3
🚀 Feature Preview Release
This is a feature preview based on an open pull request. It is intended for testing artifacts and validating functionality before the feature is merged.
Warning
This release is temporary and may be removed at any time without notice.
v1.181.0-test.2
🚀 Feature Preview Release
This is a feature preview based on an open pull request. It is intended for testing artifacts and validating functionality before the feature is merged.
Warning
This release is temporary and may be removed at any time without notice.