File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ usage ()
1212{
1313cat << END_USAGE
1414Usage:
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
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
2527END_USAGE
2628exit 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
8488echo " Running terraform ${_command} for branch: ${_branch} , You will be prompted to enter the required variables."
8589
You can’t perform that action at this time.
0 commit comments