This repo contains reference architectures developed by DigitalOcean to help users understand how to leverage DigitalOcean Services for specific use cases. Each reference architecture is provided as a Terraform module, allowing you to deploy and test to facilitate learning and rapid development. These reference architecture modules leverage our Terraform Module Library, which contains reusable Terraform modules addressing specific components of the architectures.
Note: While these reference architectures are fully functional, they are intended to be used as a reference. Please validate any configuration for your own use case.
| Name | Use Case | Periodic Validation | YouTube Video | 
|---|---|---|---|
| Globally Load Balanced Web Servers | Load balanced web servers deployed into multiple regions with a global load balancer directing users to the region closest to them. | Yes | Watch Tutorial | 
| Partner Network Connect with AWS | End-to-End connection between DO VPC and AWS VPC using Partner Network Connect with HA support | No | Coming Soon | 
| Site to Site VPN with AWS | IPSec VPN Gateway Droplet connecting DO VPC and DOKS cluster with AWS VPC | No | Watch Tutorial | 
Reference architectures deployed entirely on DigitalOcean are validated periodically (typically daily) to ensure they work as intended. Multi-cloud architectures are not validated via periodic testing but are verified using static analysis and unit testing when updates are made.
This section helps beginners set up Terraform and DigitalOcean access.
- Install Terraform
 - Export your DigitalOcean token:
export DIGITALOCEAN_TOKEN="your_token_here"
 - Clone this repo and navigate to the desired reference architecture.
 - Create a 
terraform.tfvarsfile with required inputs. 
Example:
region         = "nyc3"
droplet_count  = 3
image          = "ubuntu-20-04-x64"A typical way to deploy for testing purposes would be to:
- Ensure you have your DigitalOcean Personal Access Token set in the 
DIGITALOCEAN_TOKENenvironment variable. - Clone the repo.
 cdinto theterraformdirectory within the reference architecture you want to test.- Create a 
tfvarsfile with the inputs needed for the reference architecture module. - Run:
terraform init terraform plan -var-file=<path to tfvars file> terraform apply -var-file=<path to tfvars file>
 - Test your deployment.
 - When done, destroy the resources:
terraform destroy -var-file=<path to tfvars file>
 
If you wish to use the reference architecture as a basis for your own deployment, it's recommended to copy the Terraform files to your own repo and customize them for your needs.