This commit is contained in:
parent
35a639802c
commit
3819d99566
@ -27,12 +27,12 @@ jobs:
|
|||||||
- name: Terraform Init
|
- name: Terraform Init
|
||||||
id: init
|
id: init
|
||||||
run: terraform init
|
run: terraform init
|
||||||
working-directory: examples
|
# working-directory: examples
|
||||||
|
|
||||||
- name: Terraform Validate
|
- name: Terraform Validate
|
||||||
id: validate
|
id: validate
|
||||||
run: terraform validate
|
run: terraform validate
|
||||||
working-directory: examples
|
# working-directory: examples
|
||||||
|
|
||||||
- name: Terraform Plan
|
- name: Terraform Plan
|
||||||
id: plan
|
id: plan
|
||||||
|
42
networks.tf
42
networks.tf
@ -0,0 +1,42 @@
|
|||||||
|
resource "scaleway_lb_ip" "my_company_lb_ip" {}
|
||||||
|
|
||||||
|
resource "scaleway_lb" "my_company_lb" {
|
||||||
|
name = "load-balancer"
|
||||||
|
ip_id = scaleway_lb_ip.my_company_lb_ip.id
|
||||||
|
zone = var.scw_zone
|
||||||
|
type = var.my_company_lb_type
|
||||||
|
|
||||||
|
private_network {
|
||||||
|
private_network_id = scaleway_vpc_private_network.my_company_pn.id
|
||||||
|
dhcp_config = true
|
||||||
|
}
|
||||||
|
|
||||||
|
depends_on = [
|
||||||
|
scaleway_vpc_public_gateway.my_company_pg
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "scaleway_lb_backend" "my_company_lb_backend" {
|
||||||
|
lb_id = scaleway_lb.my_company_lb.id
|
||||||
|
name = "team-builder-backend"
|
||||||
|
forward_protocol = "http"
|
||||||
|
forward_port = "8080"
|
||||||
|
server_ips = [scaleway_vpc_public_gateway_dhcp_reservation.my_company_pg_dhcp_res_team_builder_instance.ip_address]
|
||||||
|
|
||||||
|
health_check_http {
|
||||||
|
uri = "http://${scaleway_lb_ip.my_company_lb_ip.ip_address}/health"
|
||||||
|
method = "GET"
|
||||||
|
code = 200
|
||||||
|
}
|
||||||
|
|
||||||
|
depends_on = [
|
||||||
|
scaleway_instance_server.team_builder_instance
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "scaleway_lb_frontend" "my_company_lb_frontend" {
|
||||||
|
lb_id = scaleway_lb.my_company_lb.id
|
||||||
|
backend_id = scaleway_lb_backend.my_company_lb_backend.id
|
||||||
|
name = "team-builder-frontend"
|
||||||
|
inbound_port = "80"
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
scaleway = {
|
||||||
|
source = "scaleway/scaleway"
|
||||||
|
version = "~> 2.41.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
required_version = ">= 1.7.5"
|
||||||
|
}
|
34
variables.tf
34
variables.tf
@ -0,0 +1,34 @@
|
|||||||
|
variable "access_key" {
|
||||||
|
type = string
|
||||||
|
sensitive = true
|
||||||
|
description = "Id du key"
|
||||||
|
default = "SCW9R1R3SE3JGPJSWEP2"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "secret_key" {
|
||||||
|
type = string
|
||||||
|
sensitive = true
|
||||||
|
description = "Id du secret"
|
||||||
|
default = "7c0502ba-5a74-4ff7-b936-b5552c6554ca"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "organization_id" {
|
||||||
|
type = string
|
||||||
|
sensitive = true
|
||||||
|
description = "Id de l'organisation"
|
||||||
|
default = "1a2b3c4d-1a2b-1a2b-1a2b-1a2b3c4d5e6f"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "project_id" {
|
||||||
|
type = string
|
||||||
|
sensitive = true
|
||||||
|
description = "Id du projet associé"
|
||||||
|
default = "1a2b3c4d-1a2b-1a2b-1a2b-1a2b3c4d5e6f"
|
||||||
|
}
|
||||||
|
|
||||||
|
provider "scaleway" {
|
||||||
|
access_key = var.access_key
|
||||||
|
secret_key = var.secret_key
|
||||||
|
organization_id = var.organization_id
|
||||||
|
project_id = var.project_id
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user