A Terraform Project used to Boostrap setting up components in a Sandbox Cloud Environment (AWS, Azure, GCP). In particular, a Sandbox Cloud Envionrment that gets destroyed after X number of hours and you needto restart.
git clone https://github.com/rssanders3/cloud-sandbox-bootstrap-terraform
Install Terraform Check Installation
terraform --version
Install Azure CLI Check Installation
az --version
Install AWS CLI Check Installation
aws --version
Install GCP CLI Check Installation
gcloud --version
Within the project there are subdirectories (example: azure-databricks-setup
). Each subdirectory is its own Terraform Project that integrates with a particualr cloud environment (AWS, Azure, GCP) and creates a specific set of resources depending on what you are doing within the Sandbox. To work with this project, you will need to open a terminal and change directory (cd
) into the specific project you want to use that contains the resources you need.
For more details around what is needed to setup a specific project, see the README.md within that project. Here are some general project setup steps for Terraform:
- Initialize the Project
terraform init
- Validate the Terraform
terraform validate
- Show a summary of what Terraform will do and what resources will be created (note: this step doesnt create any resources)
terraform plan
- Trigger Terraform to create the required resources in the Cloud Envionrment
terraform apply
Steps you can take to "restart" in a particular environment.
Destroy/Delete the Resources that are managed/created by Terraform
terraform destroy
Delete State Files:
sh clear_tfstates.sh
Show the Azure Subscription you are currently configured to access from Azure CLI
az account show
Destroy specific resources:
terraform destroy --target {terraform-resource-id}
Useful if you want to refresh a specific resource