chore: combine dogfood regions, use tailscale (#5741)

This commit is contained in:
Dean Sheather 2023-01-17 08:20:48 -06:00 committed by GitHub
parent 145d101512
commit 985fac642e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 7 deletions

View File

@ -13,10 +13,19 @@ terraform {
# User parameters
variable "region" {
type = string
description = "Which region to deploy to."
default = "us-pittsburgh"
validation {
condition = contains(["us-pittsburgh", "eu-helsinki", "ap-sydney"], var.region)
error_message = "Region must be one of us-pittsburg, eu-helsinki, or ap-sydney."
}
}
variable "dotfiles_uri" {
type = string
description = <<-EOF
default = ""
Dotfiles repo URI (optional)
see https://dotfiles.github.io
@ -30,17 +39,23 @@ variable "datocms_api_token" {
default = ""
}
# Admin parameters
locals {
// These are Tailscale IP addresses. Ask Dean or Kyle for help.
docker_host = {
"" = "tcp://100.94.74.63:2375"
"us-pittsburgh" = "tcp://100.94.74.63:2375"
"eu-helsinki" = "tcp://100.117.102.81:2375"
"ap-sydney" = "tcp://100.127.2.1:2375"
}
}
provider "docker" {
host = "unix:///var/run/dogfood-docker.sock"
host = lookup(local.docker_host, var.region)
}
provider "coder" {
}
provider "coder" {}
data "coder_workspace" "me" {
}
data "coder_workspace" "me" {}
resource "coder_agent" "dev" {
arch = "amd64"