Skip to content

Instantly share code, notes, and snippets.

@yuya-maemichi-synspective
Created May 21, 2025 09:47
Show Gist options
  • Save yuya-maemichi-synspective/c9e7f60d5da16a4b7b61520375a788d7 to your computer and use it in GitHub Desktop.
Save yuya-maemichi-synspective/c9e7f60d5da16a4b7b61520375a788d7 to your computer and use it in GitHub Desktop.
Terraform
# init
set --local modules
set --erase modules
terraform state list |
grep -E '^module.mas_\w+' -o |
sort -u |
while read m
set --append modules $m
end
terraform plan -out=tf.plan \
-target={$modules}
terraform apply tf.plan
rm tf.plan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment