This repository provides a Terraform configuration for deploying instances, a load balancer, and firewall rules in Apache CloudStack.
- Terraform installed (Download)
- CloudStack API access (API URL, API Key, and Secret Key)
- A working CloudStack environment
git clone https://github.com/shapeblue/cloudstack-terraform-example.git
cd cloudstack-terraform-example
Update your terraform.tfvars file with the following values to customize your environment. These are the only values you need to configure to customize the deployment:
# CloudStack API Details
api_url = "<YOUR-CLOUDSTACK-ADDRESS_AND_PORT>/client/api"
api_key = "<YOUR-CLOUDSTACK-API-KEY>"
secret_key = "<YOUR-CLOUDSTACK-SECRET-KEY>"
# General Configuration
# Zone Var
zone = "<CLOUDSTACK-ZONE>"
Other variables are already pre-configured in the terraform.tfvars file with default values. If needed, you can update them to fit your requirements.
terraform init
terraform validate
terraform apply -auto-approve
terraform apply -auto-approve
Once deployed, Terraform will output the public IP.
- Open a web browser.
- Enter the public IP in the address bar:
http://PUBLIC-IP/
- Refresh the page periodically to see the request being served by different instances.
To remove all created resources:
terraform destroy -auto-approve