diff --git a/terraform/environments/dev/main.tf b/terraform/environments/dev/main.tf index 006a25c..6fba65f 100644 --- a/terraform/environments/dev/main.tf +++ b/terraform/environments/dev/main.tf @@ -21,7 +21,15 @@ module "network"{ frontend_cidr = var.frontend_cidr backend_cidr = var.backend_cidr database_cidr = var.database_cidr - ssh_source_ranges = var.ssh_source_ranges + ssh_source_ranges = var.ssh_source_ranges +} - +module "computes"{ + source = "../../modules/compute" + + tp07-frontend = var.tp07-frontend + tp07-backend = var.tp07-backend + tp07-database = var.tp07-database + zone = var.zone + instance_type = var.instance_type } \ No newline at end of file diff --git a/terraform/environments/dev/variables.tf b/terraform/environments/dev/variables.tf index ce8d1da..8a16ea0 100644 --- a/terraform/environments/dev/variables.tf +++ b/terraform/environments/dev/variables.tf @@ -38,4 +38,34 @@ variable "ssh_source_ranges"{ description = "source range ssh" type = string default = "0.0.0.0/0" +} + +variable "tp07-frontend"{ + description = "sous réseau frontend" + type = string + default = "tp07-frontend" +} + +variable "tp07-backend"{ + description = "sous réseau backend" + type = string + default = "tp07-backend" +} + +variable "tp07-database"{ + description = "sous réseau database" + type = string + default = "tp07-database" +} + +variable "zone"{ + description = "region du projet" + type = string + default = "europe-west4-b" +} + +variable "instance_type"{ + description = "type d'instance" + type = string + default = "e2-small" } \ No newline at end of file diff --git a/terraform/modules/compute/main.tf b/terraform/modules/compute/main.tf index 5721de0..f393340 100644 --- a/terraform/modules/compute/main.tf +++ b/terraform/modules/compute/main.tf @@ -1,6 +1,6 @@ resource "google_compute_instance" "tp07-frontend" { name = "tp07-frontend" - machine_type = "e2-small" + machine_type = var.instance_type zone = var.region boot_disk { diff --git a/terraform/modules/compute/variables.tf b/terraform/modules/compute/variables.tf index e68c7c5..9275a0c 100644 --- a/terraform/modules/compute/variables.tf +++ b/terraform/modules/compute/variables.tf @@ -13,7 +13,12 @@ variable "tp07-database"{ type = string } -variable "region"{ +variable "zone"{ description = "region du projet" type = string +} + +variable "instance_type"{ + description = "type d'instance" + type = string } \ No newline at end of file