feat: add terraform

This commit is contained in:
kekskurse 2025-03-12 23:23:28 +01:00
parent bc087a5a2d
commit 5b8a9df559
6 changed files with 83 additions and 1 deletions

View file

@ -0,0 +1,13 @@
when:
- event: push
branch: main
depends_on:
- test
- playwright
steps:
- name: terraform
image: hashicorp/terraform:latest
commands:
- terraform plan

View file

@ -1,4 +1,3 @@
when:
- event: push
branch: main

2
resources/infra/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.terraform
.terraform.lock.hcl

View file

@ -0,0 +1,23 @@
terraform {
backend "s3" {
bucket = "miniauth-terraform"
key = "terraform.tfstate"
region = "fr-par"
endpoints = { s3 = "https://s3.fr-par.scw.cloud" }
profile = "miniauth"
skip_credentials_validation = true
skip_region_validation = true
skip_requesting_account_id = true
}
}
/*
For the credentials part:
==> Create a ~/.aws/credentials:
[miniauth]
aws_access_key_id=<SCW_ACCESS_KEY>
aws_secret_access_key=<SCW_SECRET_KEY>
region=fr-par
*/

View file

@ -0,0 +1,15 @@
terraform {
required_providers {
scaleway = {
source = "scaleway/scaleway"
}
}
required_version = ">= 0.13"
}
provider "scaleway" {
project_id = "d7b7ab2d-478c-44af-9f66-f90af976a779"
zone = "fr-par-1"
region = "fr-par"
}

View file

@ -0,0 +1,30 @@
resource "scaleway_container_namespace" "miniauth" {
name = "miniauth"
description = "Miniauth for gutes team"
project_id = "d7b7ab2d-478c-44af-9f66-f90af976a779"
}
resource "scaleway_container" "main" {
name = "miniauth-webgui"
description = "The webpage for the user authentification"
namespace_id = scaleway_container_namespace.miniauth.id
registry_image = "git.keks.cloud/kekskurse/miniauth:latest"
port = 8080
cpu_limit = 100
memory_limit = 128
min_scale = 0
max_scale = 1
timeout = 600
privacy = "public"
protocol = "http1"
deploy = true
http_option = "redirected"
environment_variables = {
"foo" = "var"
}
secret_environment_variables = {
"key" = "secret"
}
}