Skip to content

upmaru/terraform-digitalocean-instellar

Repository files navigation

Terraform DigitalOcean module for Instellar

This module automatically forms LXD cluster on DigitalOcean. This terraform module will do the following:

  • Setup networking
  • Setup bastion node
  • Setup compute instances
  • Setup Private Key access
  • Automatically form a cluster
  • Destroy a cluster
  • Enable removal of specific nodes gracefully
  • Protect against database-leader deletion

These functionality come together to enable the user to fully manage LXD cluster using IaC (infrastructure as code)

Requirements

Name Version
terraform >= 1.0.0
digitalocean ~> 2.31
tls 4.0.4

Providers

Name Version
digitalocean 2.28.1
ssh 2.6.0
terraform n/a
tls 4.0.4

Modules

No modules.

Resources

Name Type
digitalocean_droplet.bastion resource
digitalocean_droplet.bootstrap_node resource
digitalocean_droplet.nodes resource
digitalocean_firewall.bastion_firewall resource
digitalocean_firewall.nodes_firewall resource
digitalocean_project.project resource
digitalocean_ssh_key.bastion resource
digitalocean_ssh_key.terraform_cloud resource
digitalocean_tag.db_access resource
digitalocean_tag.instellar_bastion resource
digitalocean_tag.instellar_node resource
ssh_resource.cluster_join_token resource
ssh_resource.node_detail resource
ssh_resource.trust_token resource
terraform_data.reboot resource
terraform_data.removal resource
tls_private_key.bastion_key resource
tls_private_key.terraform_cloud resource

Inputs

Name Description Type Default Required
bastion_size Size of the bastion instance defaults to Basic 512MB instance https://slugs.do-api.dev/ string "s-1vcpu-512mb-10gb" no
cluster_topology How many nodes do you want in your cluster?
list(object({
id = number
name = string
size = optional(string, "s-1vcpu-1gb")
}))
[] no
environment Environment for project in Digital Ocean possible values are Development, Staging, Production string "Production" no
identifier Name for your cluster any n/a yes
image Image type of choice default is ubuntu 22.04 x86 string "ubuntu-22-04-x64" no
node_size Size of instances you want to use defaults to Basic 1GB instances https://slugs.do-api.dev/ string "s-2vcpu-4gb-amd" no
protect_leader Protect database leader node bool true no
region Region for your cluster string "sgp1" no
ssh_keys List of ssh keys fingerprint list(string) [] no
storage_size Storage size to use with cluster any n/a yes
vpc_id vpc id to pass in from the network module string n/a yes
vpc_ip_range The IP range to use for VPC string "10.0.1.0/24" no

Outputs

Name Description
bootstrap_node n/a
cluster_address n/a
db_access_tag_id n/a
identifier n/a
nodes n/a
project_id n/a
region n/a
trust_token n/a