feat: add terraform
This commit is contained in:
parent
bc087a5a2d
commit
5b8a9df559
6 changed files with 83 additions and 1 deletions
13
.woodpecker/deplyoment.yaml
Normal file
13
.woodpecker/deplyoment.yaml
Normal file
|
@ -0,0 +1,13 @@
|
|||
when:
|
||||
- event: push
|
||||
branch: main
|
||||
|
||||
depends_on:
|
||||
- test
|
||||
- playwright
|
||||
|
||||
steps:
|
||||
- name: terraform
|
||||
image: hashicorp/terraform:latest
|
||||
commands:
|
||||
- terraform plan
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
when:
|
||||
- event: push
|
||||
branch: main
|
||||
|
|
2
resources/infra/.gitignore
vendored
Normal file
2
resources/infra/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
.terraform
|
||||
.terraform.lock.hcl
|
23
resources/infra/backend.tf
Normal file
23
resources/infra/backend.tf
Normal 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
|
||||
*/
|
||||
|
15
resources/infra/provider.tf
Normal file
15
resources/infra/provider.tf
Normal 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"
|
||||
}
|
||||
|
30
resources/infra/scw-container.tf
Normal file
30
resources/infra/scw-container.tf
Normal 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"
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue