This commit is contained in:
2024-12-06 16:12:47 +01:00
parent 2c7daea69f
commit 43491ed096
9 changed files with 48 additions and 15 deletions

View File

@@ -36,6 +36,7 @@ resource "google_compute_instance" "backend" {
network_interface {
subnetwork = var.backend_subnet_id
access_config {} # IP publique
}
tags = ["backend", "ssh"]
@@ -59,8 +60,7 @@ resource "google_compute_instance" "database" {
network_interface {
subnetwork = var.database_subnet_id
access_config {}
access_config {} # IP publique
}
tags = ["database", "ssh"]

View File

@@ -7,7 +7,7 @@ variable "instance_type" {
variable "zone" {
description = "zone des instances"
type = string
default = "europe-west4-a"
default = "europe-west4"
}
variable "frontend_subnet_id" {

View File

@@ -21,4 +21,4 @@ resource "google_os_login_ssh_public_key" "add_my_key" {
project = var.project_id
user = data.google_client_openid_userinfo.me.email
key = file("~/.ssh/id_ed25519.pub")
}
}

View File

@@ -1,4 +1,5 @@
# modules/iam/variables.tf
variable "project_id" {
description = "ID du projet GCP"
type = string
}
}

View File

@@ -1,3 +1,4 @@
# VPC
resource "google_compute_network" "vpc" {
name = "myvpc"
auto_create_subnetworks = false

View File

@@ -1,29 +1,29 @@
#- project_name (string)
variable "project_name" {
description = "Nom du projet"
type = string
}
# - region (string)
variable "region" {
description = "Région du projet"
type = string
}
# - frontend_cidr (string)
variable "frontend_cidr" {
description = "cidr du frontend"
type = string
}
# - backend_cidr (string)
variable "backend_cidr" {
description = "cidr du backend"
type = string
}
# - database_cidr (string)
variable "database_cidr" {
description = "cidr du database"
type = string
}
# - ssh_source_ranges (string)
variable "ssh_source_ranges" {
description = "Accès à internet"
type = string