Terraform/OpenTofu Multi-Component Commands (Filtered/Bulk Operations)#1327
Merged
Terraform/OpenTofu Multi-Component Commands (Filtered/Bulk Operations)#1327
Conversation
…affected-all # Conflicts: # internal/exec/describe_affected.go
osterman
approved these changes
Jun 25, 2025
osterman
approved these changes
Jun 25, 2025
This was referenced Jul 16, 2025
This was referenced Jul 28, 2025
Merged
This was referenced Sep 5, 2025
This was referenced Oct 10, 2025
This was referenced Oct 20, 2025
This was referenced Oct 28, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
atmos terraform plan/apply/deploy --allatmos terraform plan/apply/deploy --all --stack <stack>atmos terraform plan/apply/deploy --affectedatmos terraform plan/apply/deploy --affected --stack <stack>atmos terraform plan/apply/deploy --affected --include-dependentsatmos terraform plan/apply/deploy --affected --stack <stack> --include-dependentsatmos 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>why
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
Multi-Component Commands (Bulk Operations) Usage
Multi-Component Commands (Bulk Operations) Examples
Let's assume that we have the following Atmos stack manifests in the
prodandnonprodstacks,with dependencies between the components:
Let's run the following Multi-Component commands in
dry-runmode and review the output to understand what each command executes:Summary by CodeRabbit
Summary by CodeRabbit
New Features
--affectedand--allflags to Terraform commands for selective or full-stack operations.--components,--query, and--include-dependentsfor precise targeting of components and their dependencies.--repo-path,--ref,--sha,--clone-target-ref,--ssh-key,--ssh-key-password) to identify affected components based on code changes.--dry-runmode to simulate Terraform commands without applying changes.describe affectedcommand with deprecation handling for--verbose.clean,workspace,import,plan,deploy, andapplycommands with new flags and behaviors.--verboseflag deprecation with warning and log level adjustment.Bug Fixes
Documentation
Chores
Tests