From 9e9fa77e953bf7d899227e8bc9ced3bc3afb59ad Mon Sep 17 00:00:00 2001 From: "Kwiatosz, Krzysztof" Date: Fri, 29 Nov 2024 15:47:16 +0100 Subject: [PATCH] introduce autoscaler config --- README.md | 4 ++++ examples/kyma-on-btp-new-sa/main.tf | 2 ++ main.tf | 2 ++ variables.tf | 10 ++++++++++ 4 files changed, 18 insertions(+) diff --git a/README.md b/README.md index d74f39f..b55167a 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,10 @@ Terraform module that creates kyma runtime in SAP BTP platform. | BTP_BACKEND_URL | false | https://cli.btp.cloud.sap | URL of the BTP backend API (on canary environment this has to be set to `https://cpcli.cf.sap.hana.ondemand.com`). | | BTP_KYMA_PLAN | false | azure | Use one of a valid kyma plans that you are entitled to use (One of: `azure`, `gcp`, `aws`,`sap-converged-cloud`) | | BTP_KYMA_REGION | false | westeurope | Use a valid kyma region that matches your selected kyma plan | +| BTP_KYMA_AUTOSCALER_MIN | false | 3 | Minimum number of nodes | +| BTP_KYMA_AUTOSCALER_MAX | false | 10 | Maximum number of nodes | + + ### Required Providers diff --git a/examples/kyma-on-btp-new-sa/main.tf b/examples/kyma-on-btp-new-sa/main.tf index e55d47f..06eebc8 100644 --- a/examples/kyma-on-btp-new-sa/main.tf +++ b/examples/kyma-on-btp-new-sa/main.tf @@ -48,6 +48,8 @@ module "kyma" { BTP_NEW_SUBACCOUNT_REGION = var.BTP_NEW_SUBACCOUNT_REGION BTP_KYMA_MODULES = var.BTP_KYMA_MODULES BTP_KYMA_CUSTOM_ADMINISTRATORS = var.BTP_KYMA_CUSTOM_ADMINISTRATORS + BTP_KYMA_AUTOSCALER_MIN = 1 + BTP_KYMA_AUTOSCALER_MAX = 2 } output "subaccount_id" { diff --git a/main.tf b/main.tf index f8ef6b2..fea7cb0 100644 --- a/main.tf +++ b/main.tf @@ -26,6 +26,8 @@ resource "btp_subaccount_environment_instance" "kyma" { name = "${local.subaccount_name}-kyma" region = var.BTP_KYMA_REGION administrators = var.BTP_KYMA_CUSTOM_ADMINISTRATORS + autoScalerMin = var.BTP_KYMA_AUTOSCALER_MIN + autoScalerMax = var.BTP_KYMA_AUTOSCALER_MAX }) timeouts = { create = "60m" diff --git a/variables.tf b/variables.tf index 0b3fce1..fa96197 100644 --- a/variables.tf +++ b/variables.tf @@ -78,3 +78,13 @@ variable "BTP_KYMA_MODULES" { description = "The list of kyma modules to install" } +variable "BTP_KYMA_AUTOSCALER_MIN" { + type: number + default: 3 +} + +variable "BTP_KYMA_AUTOSCALER_MAX" { + type: number + default: 10 +} +