Skip to content

Commit 3d171e6

Browse files
committed
add generate option back in
1 parent 879d93e commit 3d171e6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/local_feature_deploy.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ usage ()
1212
{
1313
cat <<END_USAGE
1414
Usage:
15-
This script is used to run terraform apply for your local feature branch only.
15+
This script defaults to running \`terraform apply\` for your local feature branch only.
1616
This script should be run from the root of the repository.
1717
Terraform secrets (\`localsecrets\` file) should be sourced and exported in the environment
1818
@@ -22,6 +22,8 @@ Usage:
2222
Run terraform destroy instead of apply
2323
--dry-run
2424
Show what Terraform will do without applying changes (terraform plan)
25+
-g, --generate
26+
Generate terraform resources from import blocks
2527
END_USAGE
2628
exit 99
2729
}
@@ -39,6 +41,8 @@ while ! test -z ${1} ; do
3941
_command="destroy" ;;
4042
--dry-run)
4143
_command="plan" ;; # Switch to terraform plan for dry-run
44+
-g|--generate)
45+
_command="plan -generate-config-out=generated-platform.tf" ;;
4246
-v|--verbose)
4347
set -x ;;
4448
-h|--help)
@@ -79,7 +83,7 @@ terraform -chdir="${TFDIR}" init -migrate-state \
7983
-backend-config="region=${_region}" \
8084
-backend-config="key=${_key}"
8185

82-
## terraform apply, plan or destroy
86+
## run terraform with the required parameters
8387

8488
echo "Running terraform ${_command} for branch: ${_branch}, You will be prompted to enter the required variables."
8589

0 commit comments

Comments
 (0)