t
This commit is contained in:
50
terraform/environments/dev/main.tf
Normal file
50
terraform/environments/dev/main.tf
Normal file
@@ -0,0 +1,50 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
google = {
|
||||
source = "hashicorp/google"
|
||||
version = "~> 6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "google" {
|
||||
project = var.project_id
|
||||
region = var.region
|
||||
}
|
||||
|
||||
module "network" {
|
||||
source = "../../modules/network"
|
||||
|
||||
# Variables d'entrée
|
||||
project_name = var.project_name
|
||||
region = var.region
|
||||
|
||||
# Autres variables spécifiques au module
|
||||
backend_cidr = var.backend_cidr
|
||||
frontend_cidr = var.frontend_cidr
|
||||
database_cidr = var.database_cidr
|
||||
ssh_source_ranges = var.ssh_source_ranges
|
||||
}
|
||||
|
||||
/*module "iam" {
|
||||
source = "../../modules/iam"
|
||||
|
||||
# Variables d'entrée
|
||||
|
||||
|
||||
# Autres variables spécifiques au module
|
||||
}*/
|
||||
|
||||
module "compute" {
|
||||
source = "../../modules/compute"
|
||||
|
||||
zone = var.zone
|
||||
instance_type = var.instance_type
|
||||
|
||||
sub1 = module.network.subnet["frontend"]
|
||||
sub2 = module.network.subnet["backend"]
|
||||
sub3 = module.network.subnet["database"]
|
||||
|
||||
|
||||
|
||||
}
|
0
terraform/environments/dev/outputs.tf
Normal file
0
terraform/environments/dev/outputs.tf
Normal file
53
terraform/environments/dev/variables.tf
Normal file
53
terraform/environments/dev/variables.tf
Normal file
@@ -0,0 +1,53 @@
|
||||
variable "project_id" {
|
||||
description = "ID du projet GCP"
|
||||
type = string
|
||||
default = "radiant-pen-442314-f9"
|
||||
}
|
||||
|
||||
variable "project_name" {
|
||||
description = "nom_du_projet"
|
||||
type = string
|
||||
default = "My Project 91685"
|
||||
}
|
||||
|
||||
variable "region" {
|
||||
description = "region"
|
||||
type = string
|
||||
default = "europe-west4"
|
||||
}
|
||||
|
||||
variable "frontend_cidr" {
|
||||
description = "range_front"
|
||||
type = string
|
||||
default = "10.0.1.0/24"
|
||||
}
|
||||
|
||||
variable "backend_cidr" {
|
||||
description = "range_back"
|
||||
type = string
|
||||
default = "10.0.2.0/24"
|
||||
}
|
||||
|
||||
variable "database_cidr" {
|
||||
description = "range_database"
|
||||
type = string
|
||||
default = "10.0.3.0/24"
|
||||
}
|
||||
|
||||
variable "ssh_source_ranges" {
|
||||
description = "range_ssh"
|
||||
type = string
|
||||
default = "0.0.0.0/0"
|
||||
}
|
||||
|
||||
variable "instance_type" {
|
||||
description = "type d'instance"
|
||||
type = string
|
||||
default = "e2-micro"
|
||||
}
|
||||
|
||||
variable "zone" {
|
||||
description = "zone"
|
||||
type = string
|
||||
default = "europe-west4-a"
|
||||
}
|
Reference in New Issue
Block a user