Skip to content

Commit

Permalink
docs: Update Terragrunt custom workflows docs to implement target pla…
Browse files Browse the repository at this point in the history
…ns, imports, and state removals (runatlantis#3776)
  • Loading branch information
Alex-Mussell authored and ijames-gc committed Feb 13, 2024
1 parent eca1afb commit 2858474
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions runatlantis.io/docs/custom-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,11 @@ workflows:
name: TF_IN_AUTOMATION
value: 'true'
- run:
command: terragrunt plan -input=false -out=$PLANFILE
output: strip_refreshing
- run: terragrunt show -json $PLANFILE > $SHOWFILE
# Allow for targetted plans/applies as not supported for Terraform wrappers by default
command: terragrunt plan -input=false $(printf '%s' $COMMENT_ARGS | sed 's/,/ /g' | tr -d '\\') -no-color -out $PLANFILE
output: hide
- run: |
terragrunt show $PLANFILE
apply:
steps:
- env:
Expand All @@ -292,6 +294,23 @@ workflows:
name: TF_IN_AUTOMATION
value: 'true'
- run: terragrunt apply -input=false $PLANFILE
import:
steps:
- env:
name: TERRAGRUNT_TFPATH
command: 'echo "terraform${DEFAULT_TERRAFORM_VERSION}"'
- env:
name: TF_VAR_author
command: 'git show -s --format="%ae" $HEAD_COMMIT'
# Allow for imports as not supported for Terraform wrappers by default
- run: terragrunt import -input=false $(printf '%s' $COMMENT_ARGS | sed 's/,/ /' | tr -d '\\')
state_rm:
steps:
- env:
name: TERRAGRUNT_TFPATH
command: 'echo "terraform${DEFAULT_TERRAFORM_VERSION}"'
# Allow for state removals as not supported for Terraform wrappers by default
- run: terragrunt state rm $(printf '%s' $COMMENT_ARGS | sed 's/,/ /' | tr -d '\\')
```

If using the repo's `atlantis.yaml` file you would use the following config:
Expand Down

0 comments on commit 2858474

Please sign in to comment.