shithub: infra

ref: 8b1d5d0f185c744c201b1262318cecadc0f94f4e
dir: /deployment/vultr/terraform.tf/

View raw version
terraform {
  required_providers {
    vultr = {
      source = "vultr/vultr"
#      version = "2.1.2"
    }
  }
}

provider "vultr" {
  api_key = "xxx"
  rate_limit = 700
  retry_limit = 3
}

resource "vultr_ssh_key" "bebebeko" {
  name = "bebebeko ssh pub key"
  ssh_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDW6PyL0G7BjfkS2XBkWbfw4fPV6RWQeTy6FI55cs4sfjn7Qq4CmmSfmhiZtOJxbIq1zbgZswieTYZklICKMv18rf7kz5Qdl1iGgbqHx7EqNBk96vE7anYXrtw7+nXl9yltG7Pl3HCgB6sbZyZQHYlcqcbrfk9XLA75pqrrFPchmzNrmvNU8hmASvjNa8IZ1OcAf64Dzk8Ilzw/Y1KxaQGkQu6EnsUEao2rsZQe6tnsOjovslsTtvoeqKUpQD+GORRXkl+Ad4R1Ife81B5588TKV5O4sH8tFHsK03kC95XJ9tvwkiA11BtIxqID5ALR118/iadd2mzdO39cXnPZj63Ui+WfZ2Y4QuoDiX3QMu0vielzmUR5GhNCL8xP3AblwP6q5TAnF10VsmDYZ+qmtsbXbzVFBf4Uq3SjF7hWFuc7kL4LYH8CgtArYJyojxBo+Wjk2QpztNq3QwZC9OURXwOXLmhQtFfL4+eS1ainOYX1lIsGm5KHlnCGkhd0AV68m/M= bebebeko@daria-System-Product-Name"
}

resource "vultr_ssh_key" "kvik" {
  name = "kvik ssh pub key"
  ssh_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6vnB2zC8I3YPMSdbucU4DHIU8K7UTPSpN+FcBCOFSaZT31Hx/CbtBD9y/y8+deeO2bQ76ci+nEm3dia8Izqb8sfwMGrg/P+LU4gxNX4aHbSOcxsElnrFqSBJx1oan5FaAZt/G9vf3zsBEZxWPwsFOqwsHkA8KDdjrdo0MDmFXprSwzl9OhgFacaVbitX1ER1nbPpPNHCQfrbF5i5pwcZu1jfrUKhYi+JG2somaUlmuKGp59pUkeOGRyceC98NGiIO7hgtphTUFDu2odtHussEPRb3Qr2q9PQm2T0+OkMUh2uI3+/BPLrP2WKYBZPV4cR8LvCwxtbt5spmkpXoCn3J kvik@a-b.xyz"
}

resource "vultr_ssh_key" "sirjofri" {
  name = "sirjofri ssh pub key"
  ssh_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfv9mRup8pv5iBm9Z38a14R9xnUkWN/Vna03xL0/KM6QzBbfa7vF/HbqbBMLe1QMzOtTKoShSZOP1+JQDRM4Thnvy/FAUI/65TBhWrRZDUwTLe1TlTMp1A51SvgKBsq7+2YhiubyHOWnO8lUDo0401JAWSEygl2sHp7sNiXKTHYsUMixLhnf0iLty84ATpOzxbNWgk5cfCSPShYSLJEWjRkUUffSz3Lk/lkV5Mu7IMRFMnkTyI0hzxygKyvmfk6n+qpqL+/ikfzbI0bjABWOD7odRqMR9+gUasVs4CibssajBtiIiJZZDTZ4SwYLd12HV6CZAi8+klYgYm/WacELA9"
}

resource "vultr_private_network" "ninep_zone_network" {
    description = "Private network for 9p.zone infrastructure"
    region = "fra"
    v4_subnet  = "10.42.42.0"
    v4_subnet_mask = 24
}

# Create a inferno instance
resource "vultr_instance" "inferno" {
    plan = "vc2-1c-1gb"
    region = "fra"
    os_id =  "215"                    # ubuntu 16.04
    label = "inferno"
    tag = "inferno"
    hostname = "registry.9p.zone"
    enable_ipv6 = false
    backups = "enabled"
    ddos_protection = false
    activation_email = false
    ssh_key_ids = [ vultr_ssh_key.bebebeko.id, vultr_ssh_key.kvik.id, vultr_ssh_key.sirjofri.id ]
    private_network_ids = [ vultr_private_network.ninep_zone_network.id ]
}

resource "vultr_instance" "ninefront" {
    plan = "vc2-1c-1gb"
    region = "fra"
    iso_id = "68657d00-d63e-4dd2-9a3e-24ea5aa83891"       # 9front iso id
    label = "9front"
    tag = "9front"
    hostname = "auth.9p.zone"
    enable_ipv6 = false
    backups = "enabled"
    ddos_protection = false
    activation_email = false
    private_network_ids = [ vultr_private_network.ninep_zone_network.id ]
}