From d61da06e33a51ec29d1bd0a79ebca39aded29bdf Mon Sep 17 00:00:00 2001 From: Mahmoud Emad Date: Sun, 29 Oct 2023 17:37:11 +0200 Subject: [PATCH] Update terraform --- .gitignore | 7 ++----- terraform/main.tf | 27 ++++++++++++++------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 46f8ec79e..273bbe96b 100644 --- a/.gitignore +++ b/.gitignore @@ -140,8 +140,5 @@ dmypy.json # Pyre type checker .pyre/ - - -./.vscode -./*/.vscode -profile_image/ \ No newline at end of file +profile_image/ +.vscode \ No newline at end of file diff --git a/terraform/main.tf b/terraform/main.tf index 8c9bcaf2e..93379f103 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -1,7 +1,8 @@ terraform { required_providers { grid = { - source = "threefoldtechdev.com/providers/grid" + source = "threefoldtech/grid" + version = "1.9.1-dev" } } } @@ -12,28 +13,28 @@ provider "grid" { } data "grid_gateway_domain" "server_domain" { - node = 14 + node = 11 name = "cshrserver" } data "grid_gateway_domain" "client_domain" { - node = 14 + node = 11 name = "cshr" } resource "grid_network" "net1" { - nodes = [14] + nodes = [11] ip_range = "10.1.0.0/16" - name = "cshr-network" + name = "cshrnetwork1" description = "newer network" add_wg_access = true } resource "grid_deployment" "d1" { - node = 14 + node = 11 network_name = grid_network.net1.name vms { - name = "cshr-serverVM" + name = "cshrservervm" flist = "https://hub.grid.tf/omda.3bot/codescalersinternship-cshr_server-latest.flist" cpu = 2 memory = 1024 @@ -41,7 +42,7 @@ resource "grid_deployment" "d1" { planetary = true entrypoint = "/sbin/zinit init" env_vars = { - SSH_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8KhnjC8yi2Td7gMEiVmJfUNg1lXE457S+eW1jip0HW3MGLsKjXekauLbR7qcSOKUGURZlsw2KbRdOZnWbQovs24YdevUos/9XIHxFL+mJEy+5gyHuU5Z/yGcuW7O6Qj5xtwvBwe/kWnMtgEd2xXxQqEY3ZHkVh++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Q== mahmmoud.hassanein@gmail.com" DJANGO_DEBUG="ON" EMAIL="codescalersinternship@gmail.com" EMAIL_PASSWORD="ubunyyzgxeoxhnze" @@ -56,10 +57,10 @@ resource "grid_deployment" "d1" { } resource "grid_deployment" "d2" { - node = 14 + node = 11 network_name = grid_network.net1.name vms { - name = "cshr-clientVM" + name = "cshrclientvm" publicip = false planetary = true flist = "https://hub.grid.tf/omda.3bot/codescalersinternship-cshr_client-latest.flist" @@ -67,21 +68,21 @@ resource "grid_deployment" "d2" { memory = 1024 entrypoint = "/sbin/zinit init" env_vars = { - SSH_KEY = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8KhnjC8yi2Td7gMEiVmJfUNg1lXE457S+eW1jip0HW3MGLsKjXekauLbR7qcSOKUGURZlsw2KbRdOZnWbQovs24YdevUos/9XIHxFL+mJEy+5gyHuU5Z/yGcuW7O6Qj5xtwvBwe/kWnMtgEd2xXxQqEY3ZHkVh++mA/eqbhikMIsM7Qi5SKBT210+7KT5989BbUpk9e43koFNkVPCXgDR5+frhbEvCq06OVAE8vuEQ/C6EW1ZKn65nVt2z0kA7c8rUE0sEZRnI35oCEwazMlxiPm9B67GryoO7bkTvIrencFHeOrR3/7htjGxFEnJw6yyiUJtSZVP/bbRcPZ6yJtCMF03nK4IdXsHblyjXXu7u3M+7nrx6KBjew2bOHlUAU52MPOPpyJFADwM66t7P7hxIDJ3Nubwufxukqt+VasJSWI6GN9rtk6Cj1Ro2N2JJ+a4vZSdxl5RrPhujfkh87Vptxncl5G8q7oSjfMXAjk22rsJ+nuYczn57SD5PxYGjO0= mahmmoud.hassanein@gmail.com" + SSH_KEY = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCF3JezThwSchTvkF2oPtn8X6chevNsfE58dIY3/eg5zK9tKgNYIB2saoFh12a0AJU424sAeLO0HghhNhe/Co62xkzHhk6EpXWNSFkrlzw+FVn1FKDZbbOZH47sC3n6p5a3YhM4dALssZ/aZdpaKBgXkzk91usJ+GVa+eOnpMRBlHgi9PpvowyzPSKeH9ZcVRBPnVU+nQGyV+kd6RahNBoNgNrHu/QFI92yg/y/7Szus1IS0U92cWKf/K/Sot7O10kSjmj06lMGOO8zdENk/xrtUtRHzemCj+mq0Q/3KUMCGvdb/tH0TDeNenxvibummiym4VTcnYqbm+RDXWG8HUc/RPfEVBl8p1NGZnkBt6QJl5hddHaYwx8CCmf3maSrQFcmrWYtlUDBXYkPyrv0qmy2gM1PScntF/X9zhIfnELlyAVAKXfzVwixrBh7oOIAqefydSVcwWtCXoH38F5q/zo9bQv+eHntI83mZrUUT7JGirQF64fpJKbCZPhv0kUm9bF7DVQMiyRZdk748cgVp7dEzMVlrfZ2eIvZag5zmuJTPB7bw00+Ik9jNaOIhEoCWEaYBw7KmrLonesV8rWUkEAwWPe28bXCVmUZlgZbWJi7BFWCst2Z/j2WgScHbdAv28gAcneDW4yQmt2YaYqXqmwgSVCaD/irq5FSO4upmo5u0Q== mahmmoud.hassanein@gmail.com" SERVER_BASE_URL=format("https://%s", data.grid_gateway_domain.server_domain.fqdn) } } } resource "grid_name_proxy" "p1" { - node = 14 + node = 11 name = "cshrserver" backends = [format("http://[%s]:8000", grid_deployment.d1.vms[0].ygg_ip)] tls_passthrough = false } resource "grid_name_proxy" "p2" { - node = 14 + node = 11 name = "cshr" backends = [format("http://[%s]:6000", grid_deployment.d2.vms[0].ygg_ip)] tls_passthrough = false