File tree 1 file changed +12
-9
lines changed
1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 1
1
# Generate .tf and .tfstate for existing AWS VPC resources
2
- # Author: Kyler Middleton, 7.9 .2019
2
+ # Author: Kyler Middleton, 7.8 .2019
3
3
4
4
# Limitations/bugs
5
5
# SG rules are stripped of descriptions during import for some reason
@@ -56,14 +56,17 @@ find temp -type f -not -empty -name '*.tf' -exec basename {} \; | sed -e 's/.tf/
56
56
echo " Removing versions.tf file which block 0.12upgrade process"
57
57
rm -f versions.tf
58
58
59
- # Fixup file for terraform 0.12, will automatically response yes
60
- echo " Init terraform project and auto-upgrading config and tfstate to 0.12 terraform standard"
61
- terraform init
62
- echo " yes" | terraform 0.12upgrade
63
-
64
- # Format all local scripts
65
- echo " Formatting scripts via terraform fmt"
66
- terraform fmt
59
+ # Init terraform
60
+ echo " init and format Terraform"
61
+ if $( terraform init && terraform fmt) ; then
62
+ echo " Code is initialized"
63
+ else
64
+ echo " *******************************"
65
+ echo " There were formatting issues with your code which isn't unusual"
66
+ echo " Review the issues and manually fix them in the config file"
67
+ echo " Test against with command \" terraform init && terraform fmt\" "
68
+ echo " *******************************"
69
+ fi
67
70
68
71
# Remove temp directory, no longer needed
69
72
echo " Deleting temp directory and all contents"
You can’t perform that action at this time.
0 commit comments