diff --git a/.github/actions/create-sap-btp-kyma/action.yaml b/.github/actions/create-sap-btp-kyma/action.yaml index fb2c30d..96ff938 100644 --- a/.github/actions/create-sap-btp-kyma/action.yaml +++ b/.github/actions/create-sap-btp-kyma/action.yaml @@ -37,6 +37,10 @@ inputs: description: 'Minimum numbers of worker nodes the new kyma environment shoud start with' required: false default: '3' + btp_kyma_administrators: + description: 'String representation of the kyma admin list' + required: false + default: "[]" outputs: subaccount_id: @@ -46,6 +50,24 @@ outputs: runs: using: 'composite' steps: + - name: ensure terraform cli + shell: bash + run: | + if ! which terraform; then + sudo apt-get update && sudo apt-get install -y gnupg software-properties-common + wget -O- https://apt.releases.hashicorp.com/gpg | \ + gpg --dearmor | \ + sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg > /dev/null + gpg --no-default-keyring \ + --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg \ + --fingerprint + echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \ + https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \ + sudo tee /etc/apt/sources.list.d/hashicorp.list + sudo apt update + sudo apt-get install terraform + fi + terraform -help - name: Create btp resources id: create-btp-resources run: | @@ -68,4 +90,5 @@ runs: TF_VAR_BTP_KYMA_REGION: ${{ inputs.btp_kyma_region }} TF_VAR_BTP_KYMA_MODULES_STRINGIFIED: ${{ inputs.btp_kyma_modules }} TF_VAR_BTP_KYMA_AUTOSCALER_MIN: ${{ inputs.btp_kyma_autoscaler_min }} + TF_VAR_BTP_KYMA_CUSTOM_ADMINISTRATORS: ${{ inputs.btp_kyma_administrators }} \ No newline at end of file diff --git a/.github/actions/create-sap-btp-kyma/main.tf b/.github/actions/create-sap-btp-kyma/main.tf index e722e67..ff72934 100644 --- a/.github/actions/create-sap-btp-kyma/main.tf +++ b/.github/actions/create-sap-btp-kyma/main.tf @@ -35,6 +35,7 @@ module "kyma" { BTP_NEW_SUBACCOUNT_REGION = var.BTP_NEW_SUBACCOUNT_REGION BTP_KYMA_MODULES = jsondecode(var.BTP_KYMA_MODULES_STRINGIFIED) BTP_KYMA_AUTOSCALER_MIN = var.BTP_KYMA_AUTOSCALER_MIN + BTP_KYMA_CUSTOM_ADMINISTRATORS = jsondecode(var.BTP_KYMA_CUSTOM_ADMINISTRATORS) } output "subaccount_id" { diff --git a/.github/actions/create-sap-btp-kyma/variables.tf b/.github/actions/create-sap-btp-kyma/variables.tf index d7fce01..55aa344 100644 --- a/.github/actions/create-sap-btp-kyma/variables.tf +++ b/.github/actions/create-sap-btp-kyma/variables.tf @@ -51,4 +51,9 @@ variable "BTP_KYMA_MODULES_STRINGIFIED" { variable "BTP_KYMA_AUTOSCALER_MIN" { type = number default = 3 +} + +variable "BTP_KYMA_CUSTOM_ADMINISTRATORS" { + type = string + description = "Emails of kyma admins stringified array" } \ No newline at end of file