diff --git a/README.md b/README.md index fd19fac126f2cfd93fbcd84fba77dec9852cd102..fa59f452d6f92de6357a60ffa7c773099e11aae3 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Fork the project from [this repository](https://forge.grandlyon.com/systemes-din Go to the `Settings` menu, `CI/CD` and look for the `Variables` submenu. Once it's done, you will need to create the variable bellow : - **ENVIRONMENT** : Environment of the deployment, contained in domains, subdomains and resources name convention, should match the project name. -- **TF_VAR_INSTANCES_COUNT** : Number of instances to create. +- **TF_VAR_INSTANCE_COUNT** : Number of instances to create. - **TF_VAR_LETSENCRYPT_EMAIL** : Lets encrypt mail for renewal. - **TF_VAR_PROJECT_DOMAIN** : External domain from Scaleway. Example : `<PROJECT_DOMAIN>.alpha.grandlyon.com` - **TF_VAR_SCW_ACCESS_KEY** : Scaleway Access Key. diff --git a/terraform/main.tf b/terraform/main.tf index f41e2aa481e5f89d4e9f17d56002f72a95e875de..b32beee8b99b1ac6c0ad65111b4f20e631657917 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -3,7 +3,7 @@ ############ resource "scaleway_instance_ip" "public_ip" { - count = var.INSTANCES_COUNT + count = var.INSTANCE_COUNT project_id = var.SCW_PROJECT_ID } @@ -12,7 +12,7 @@ resource "scaleway_instance_ip" "public_ip" { ################ resource "scaleway_domain_record" "subdomain_record" { - count = var.INSTANCES_COUNT + count = var.INSTANCE_COUNT dns_zone = var.PROJECT_DOMAIN name = "${var.ENVIRONMENT}-${count.index}" type = "A" @@ -21,7 +21,7 @@ resource "scaleway_domain_record" "subdomain_record" { } resource "scaleway_domain_record" "host_subdomain_record" { - count = var.INSTANCES_COUNT + count = var.INSTANCE_COUNT dns_zone = var.PROJECT_DOMAIN name = "*.${var.ENVIRONMENT}-${count.index}" type = "A" @@ -56,7 +56,7 @@ resource "scaleway_instance_security_group" "www" { ############################## resource "scaleway_instance_server" "user_instance_server" { - count = var.INSTANCES_COUNT + count = var.INSTANCE_COUNT project_id = var.SCW_PROJECT_ID name = "instance${count.index}-${var.ENVIRONMENT}" type = "DEV1-L" diff --git a/terraform/variables-gitlab.tf b/terraform/variables-gitlab.tf index 6c31d72e31aac81dc3e0d800806fc51e060d1f58..16dff3cee52ff4972045dcde8f8c8dd4e948151a 100644 --- a/terraform/variables-gitlab.tf +++ b/terraform/variables-gitlab.tf @@ -36,7 +36,7 @@ variable "USER_PASSWORD" { description = "User password for accessing services" } -variable "INSTANCES_COUNT" { +variable "INSTANCE_COUNT" { type = number description = "Number of instances to create" }