Skip to content

This repository provides a Terraform-based deployment for Apache CloudStack, showcasing how to create instances, configure a load balancer, and apply firewall rules.

Notifications You must be signed in to change notification settings

shapeblue/cloudstack-terraform-example

Repository files navigation

Terraform CloudStack Example

This repository provides a Terraform configuration for deploying instances, a load balancer, and firewall rules in Apache CloudStack.

Requirements

  • Terraform installed (Download)
  • CloudStack API access (API URL, API Key, and Secret Key)
  • A working CloudStack environment

Setup

Clone the repository

git clone https://github.com/shapeblue/cloudstack-terraform-example.git
cd cloudstack-terraform-example

Configure CloudStack variables

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.

Initialize Terraform

terraform init

Validate the configuration

terraform validate

Deploy the infrastructure

terraform apply -auto-approve

Deploy the infrastructure

terraform apply -auto-approve

Accessing Instances

Once deployed, Terraform will output the public IP.

  1. Open a web browser.
  2. Enter the public IP in the address bar:
http://PUBLIC-IP/
  1. Refresh the page periodically to see the request being served by different instances.

Destroying the Infrastructure

To remove all created resources:

terraform destroy -auto-approve

About

This repository provides a Terraform-based deployment for Apache CloudStack, showcasing how to create instances, configure a load balancer, and apply firewall rules.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages