From b6084a6a39f8ed7f2ec9e95444a11dfb24d7f862 Mon Sep 17 00:00:00 2001 From: "Kwiatosz, Krzysztof" Date: Mon, 9 Sep 2024 14:50:58 +0200 Subject: [PATCH] module list configurable --- examples/kyma-on-btp-new-sa/main.tf | 1 + examples/kyma-on-btp-new-sa/variables.tf | 22 ++++++++++++++++++++++ main.tf | 15 +-------------- variables.tf | 22 ++++++++++++++++++++++ 4 files changed, 46 insertions(+), 14 deletions(-) diff --git a/examples/kyma-on-btp-new-sa/main.tf b/examples/kyma-on-btp-new-sa/main.tf index 903cf74..489c486 100644 --- a/examples/kyma-on-btp-new-sa/main.tf +++ b/examples/kyma-on-btp-new-sa/main.tf @@ -37,4 +37,5 @@ module "kyma" { BTP_BOT_PASSWORD = var.BTP_BOT_PASSWORD BTP_PROVIDER_SUBACCOUNT_ID = var.BTP_PROVIDER_SUBACCOUNT_ID BTP_NEW_SUBACCOUNT_REGION = var.BTP_NEW_SUBACCOUNT_REGION + BTP_KYMA_MODULES = var.BTP_KYMA_MODULES } diff --git a/examples/kyma-on-btp-new-sa/variables.tf b/examples/kyma-on-btp-new-sa/variables.tf index 55a635f..2736d74 100644 --- a/examples/kyma-on-btp-new-sa/variables.tf +++ b/examples/kyma-on-btp-new-sa/variables.tf @@ -67,3 +67,25 @@ variable "BTP_PROVIDER_SUBACCOUNT_ID" { description = "Subaccount ID" default = null } + +variable "BTP_KYMA_MODULES" { + type = list(object({ + name = string + channel = string + })) + default = [ + { + name = "istio" + channel = "fast" + }, + { + name = "api-gateway" + channel = "fast" + }, + { + name = "btp-operator" + channel = "fast" + } + ] + description = "The list of kyma modules to install" +} diff --git a/main.tf b/main.tf index d40e88c..bc5d74a 100644 --- a/main.tf +++ b/main.tf @@ -20,20 +20,7 @@ resource "btp_subaccount_environment_instance" "kyma" { plan_name = btp_subaccount_entitlement.kyma.plan_name parameters = jsonencode({ modules = { - list = [ - { - name = "api-gateway" - channel = "fast" - }, - { - name = "istio" - channel = "fast" - }, - { - name = "btp-operator" - channel = "fast" - } - ] + list = var.BTP_KYMA_MODULES } oidc = { groupsClaim = "groups" diff --git a/variables.tf b/variables.tf index 0d9b4be..c740b2a 100644 --- a/variables.tf +++ b/variables.tf @@ -63,3 +63,25 @@ variable "BTP_PROVIDER_SUBACCOUNT_ID" { default = null } +variable "BTP_KYMA_MODULES" { + type = list(object({ + name = string + channel = string + })) + default = [ + { + name = "istio" + channel = "fast" + }, + { + name = "api-gateway" + channel = "fast" + }, + { + name = "btp-operator" + channel = "fast" + } + ] + description = "The list of kyma modules to install" +} +