Created
May 13, 2020 04:01
-
-
Save mtranter/3d1687876534087c4a13f8c1d7352e3e to your computer and use it in GitHub Desktop.
Terragrunt Orb - Draft
This file contains 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
version: 2.1 | |
description: Publish Infrastructure with terragrunt | |
orbs: | |
terragrunt: | |
commands: | |
plan: | |
parameters: | |
target_dir: | |
type: string | |
default: . | |
plan_file: | |
type: string | |
default: "" | |
tf_vars: | |
type: string | |
steps: | |
- run: | |
name: Terragrunt plan | |
command: | | |
vars="" | |
IFS="," read -ra TF_VARS \<<< "<< parameters.tf_vars >>" | |
for t in "${TF_VARS[@]}"; do vars="$vars -var $t"; done; | |
cd << parameters.target_dir >> | |
terragrunt plan <<# parameters.tf_vars >>$vars<</ parameters.tf_vars >> <<# parameters.plan_file >> -out << parameters.plan_file >> <</ parameters.plan_file >> | |
apply: | |
parameters: | |
target_dir: | |
type: string | |
default: . | |
plan_file: | |
type: string | |
default: "" | |
tf_vars: | |
type: string | |
steps: | |
- run: | |
name: Terragrunt Apply | |
command: | | |
vars="" | |
IFS="," read -ra TF_VARS \<<< "<< parameters.tf_vars >>" | |
for t in "${TF_VARS[@]}"; do vars="$vars -var $t"; done; | |
cd << parameters.target_dir >> | |
terragrunt apply -auto-approve <<# parameters.tf_vars >>$vars<</ parameters.tf_vars >> <<# parameters.plan_file >> -out << parameters.plan_file >> <</ parameters.plan_file >> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment