diff --git a/IaC/main.tf b/IaC/main.tf index c00b279..80bbddf 100644 --- a/IaC/main.tf +++ b/IaC/main.tf @@ -36,6 +36,10 @@ resource "random_id" "artifacts_bucket_name_suffix" { byte_length = 5 } +resource "random_password" "password" { + length = 16 +} + module "network" { source = "./modules/network" network_name = var.network_name @@ -44,7 +48,7 @@ module "network" { module "mlflow" { source = "./modules/mlflow" artifacts_bucket_name = "${var.artifacts_bucket}-${random_id.artifacts_bucket_name_suffix.hex}" - db_password_value = var.db_password_value + db_password_value = random_password.password.result server_docker_image = var.mlflow_docker_image project_id = var.project_id consent_screen_support_email = var.consent_screen_support_email diff --git a/IaC/variables.tf b/IaC/variables.tf index fb02068..4f02f74 100644 --- a/IaC/variables.tf +++ b/IaC/variables.tf @@ -24,10 +24,6 @@ variable "artifacts_bucket" { type = string default = "oneclick-mlflow-store" } -variable "db_password_value" { - description = "Database password to connect to your instance" - type = string -} variable "mlflow_docker_image" { description = "Docker image used in container registry" type = string @@ -48,4 +44,4 @@ variable "storage_uniform" { type = bool description = "Wether or not uniform level acces is to be activated for the buckets" default = true -} \ No newline at end of file +} diff --git a/Makefile b/Makefile index 2fc5ccf..2e90b24 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ +ifeq ($(SHELL),/bin/sh) + SHELL:=/bin/bash +endif pre-requesites: - source vars_base && cd Iac/prerequesites && terraform init && terraform apply + source vars_base && cd IaC/prerequesites && terraform init && terraform apply build-docker: source vars_base && cd tracking_server && docker build -t $${TF_VAR_mlflow_docker_image} -f tracking.Dockerfile . @@ -8,16 +11,16 @@ push-docker: source vars_base && docker push $${TF_VAR_mlflow_docker_image} init-terraform: - source vars_base && cd Iac && terraform init -backend-config="bucket=$${TF_VAR_backend_bucket}" + source vars_base && cd IaC && terraform init -backend-config="bucket=$${TF_VAR_backend_bucket}" apply-terraform: - source vars_base && cd Iac && terraform apply + source vars_base && cd IaC && terraform apply plan-terraform: - source vars_base && cd Iac && terraform plan + source vars_base && cd IaC && terraform plan destroy-terraform: - source vars_base && cd Iac && terraform destroy + source vars_base && cd IaC && terraform destroy apply: init-terraform apply-terraform