From 7d64b182e87c339d4aae9bb8bdc0abe0b7b52cf8 Mon Sep 17 00:00:00 2001
From: Nathan Rodet <nrodet@grandlyon.com>
Date: Fri, 23 Dec 2022 09:21:58 +0100
Subject: [PATCH] simplified name

---
 instance-scripts/cloud-init.yml |  2 +-
 terraform/main.tf               | 13 +++++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/instance-scripts/cloud-init.yml b/instance-scripts/cloud-init.yml
index fc615af..3ed0a8a 100644
--- a/instance-scripts/cloud-init.yml
+++ b/instance-scripts/cloud-init.yml
@@ -85,4 +85,4 @@ runcmd:
 #
 # Run Webtop Container
 #
-  - "docker run -d --name=webtop --security-opt seccomp=unconfined -e PIAUSER=user -e PIAPASS=$(scw-userdata user_password) -e PUID=0 -e PGID=0 -e TZ=Europe/Paris -e SUBFOLDER=/ -e KEYBOARD=fr-fr-azerty -e AUTO_LOGIN=false -p 8081:3000 -v /root/webtop_data/:/config -v /var/run/docker.sock:/var/run/docker.sock --shm-size=8gb --cap-add=NET_ADMIN --privileged --restart unless-stopped --sysctl net.ipv6.conf.all.disable_ipv6=0 lscr.io/linuxserver/webtop:ubuntu-xfce"
+  - "docker run -d --name=webtop --security-opt seccomp=unconfined -e PUID=0 -e PGID=0 -e TZ=Europe/Paris -e SUBFOLDER=/ -e KEYBOARD=fr-fr-azerty -e AUTO_LOGIN=false -p 8081:3000 -v /root/webtop_data/:/config -v /var/run/docker.sock:/var/run/docker.sock --shm-size=8gb --cap-add=NET_ADMIN --privileged --restart unless-stopped --sysctl net.ipv6.conf.all.disable_ipv6=0 lscr.io/linuxserver/webtop:ubuntu-xfce"
diff --git a/terraform/main.tf b/terraform/main.tf
index 1d2eab3..faac9c2 100644
--- a/terraform/main.tf
+++ b/terraform/main.tf
@@ -14,7 +14,7 @@ resource "scaleway_instance_ip" "public_ip" {
 resource "scaleway_domain_record" "subdomain_record" {
   count    = var.INSTANCES_COUNT
   dns_zone = "daag.alpha.grandlyon.com"
-  name     = "lab-${count.index}-${var.ENVIRONMENT}"
+  name     = "${count.index}-${var.ENVIRONMENT}"
   type     = "A"
   data     = scaleway_instance_ip.public_ip[count.index].address
   ttl      = 3600
@@ -23,7 +23,7 @@ resource "scaleway_domain_record" "subdomain_record" {
 resource "scaleway_domain_record" "host_subdomain_record" {
   count    = var.INSTANCES_COUNT
   dns_zone = "daag.alpha.grandlyon.com"
-  name     = "*.lab-${count.index}-${var.ENVIRONMENT}"
+  name     = "*.${count.index}-${var.ENVIRONMENT}"
   type     = "A"
   data     = scaleway_instance_ip.public_ip[count.index].address
   ttl      = 3600
@@ -35,7 +35,7 @@ resource "scaleway_domain_record" "host_subdomain_record" {
 
 resource "scaleway_instance_security_group" "www" {
   project_id              = var.SCW_PROJECT_ID
-  name                    = "security-group-lab-${var.ENVIRONMENT}"
+  name                    = "security-group-${var.ENVIRONMENT}"
   inbound_default_policy  = "drop"
   outbound_default_policy = "accept"
 
@@ -44,6 +44,11 @@ resource "scaleway_instance_security_group" "www" {
     port   = "443"
   }
 
+  inbound_rule {
+    action = "accept"
+    port   = "22"
+  }
+
 }
 
 ##############################
@@ -53,7 +58,7 @@ resource "scaleway_instance_security_group" "www" {
 resource "scaleway_instance_server" "user_instance_server" {
   count             = var.INSTANCES_COUNT
   project_id        = var.SCW_PROJECT_ID
-  name              = "instance-${count.index}-lab-${var.ENVIRONMENT}"
+  name              = "instance${count.index}-${var.ENVIRONMENT}"
   type              = "DEV1-L"
   image             = "ubuntu_jammy"
   ip_id             = scaleway_instance_ip.public_ip[count.index].id
-- 
GitLab