From cdd94445ffe4b2c41022a954c06bc4fde58a33c3 Mon Sep 17 00:00:00 2001 From: "Kwiatosz, Krzysztof" Date: Mon, 9 Sep 2024 10:21:48 +0200 Subject: [PATCH 1/4] explain prerequisites --- examples/kyma-on-btp-basic/README.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/examples/kyma-on-btp-basic/README.md b/examples/kyma-on-btp-basic/README.md index 4b360eb..8970dff 100644 --- a/examples/kyma-on-btp-basic/README.md +++ b/examples/kyma-on-btp-basic/README.md @@ -1,4 +1,6 @@ -# Run +# Prerequisites + +## Ensure CLI tools Ensure you have opentofu (or terraform CLI installed). The sample scripts relly on `tofu` command, but its 100% compatible with `terraform` CLI. @@ -8,7 +10,21 @@ Ensure the tofu CLI is installed by calling: brew install opentofu ``` -Save a new version of the template file `examples/kyma-on-btp-basic/local-template.tfvars` as `examples/kyma-on-btp-basic/local.tfvars`. Provide values for input variables. +## Ensure bot user access + +In order to make automatic management of btp resources possible you need to ensure the following: + - establish trust between BTP global account and your custom IAS tenant + - add the bot user to the custom IAS tenant + - assign global account administrator role collection to the bot user (this example needs it to create subaccount. It is not required if subaccount is reused) + - if you decide to use provider subaccount in order to create disposable references to existing, shared instances of stateful services (via `BTP_PROVIDER_SUBACCOUNT_ID` environment variable ) the bot user would need to have `Subaccount Viewer` role collection assigned in the provider subaccount. + +## Ensure Input Variables + +Save a new version of the template file `examples/kyma-on-btp-basic/local-template.tfvars` as `examples/kyma-on-btp-basic/local.tfvars`. Provide values for input variables + + +# Run + Run the example: From b78423c1cbb36b337560b91dfc9430f1bdbb8dbb Mon Sep 17 00:00:00 2001 From: "Kwiatosz, Krzysztof" Date: Mon, 9 Sep 2024 10:29:17 +0200 Subject: [PATCH 2/4] use terraform --- .github/workflows/pull-e2e-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-e2e-test.yml b/.github/workflows/pull-e2e-test.yml index 911a3f1..a5a118e 100644 --- a/.github/workflows/pull-e2e-test.yml +++ b/.github/workflows/pull-e2e-test.yml @@ -7,13 +7,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: opentofu/setup-opentofu@v1 + # - uses: opentofu/setup-opentofu@v1 - name: Create kyma runtime on btp working-directory: examples/kyma-on-btp-basic run: | - tofu init - tofu apply -auto-approve - tofu destroy -auto-approve + terraform init + terraform apply -auto-approve + terraform destroy -auto-approve env: TF_VAR_BTP_SUBACCOUNT: btp-test-PR-${{ github.event.number }}-${{ github.run_attempt }} TF_VAR_BTP_SA_REGION: ${{ secrets.sa_region }} From cafa4879261816eb95ef74511d086e80bb5a88a5 Mon Sep 17 00:00:00 2001 From: "Kwiatosz, Krzysztof" Date: Mon, 9 Sep 2024 10:38:30 +0200 Subject: [PATCH 3/4] case sens --- .github/workflows/pull-e2e-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pull-e2e-test.yml b/.github/workflows/pull-e2e-test.yml index a5a118e..47b97b0 100644 --- a/.github/workflows/pull-e2e-test.yml +++ b/.github/workflows/pull-e2e-test.yml @@ -7,7 +7,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - # - uses: opentofu/setup-opentofu@v1 - name: Create kyma runtime on btp working-directory: examples/kyma-on-btp-basic run: | @@ -17,7 +16,7 @@ jobs: env: TF_VAR_BTP_SUBACCOUNT: btp-test-PR-${{ github.event.number }}-${{ github.run_attempt }} TF_VAR_BTP_SA_REGION: ${{ secrets.sa_region }} - TF_VAR_BTP_GLOBAL_ACCOUNT: ${{ secrets.global_account }} + TF_VAR_BTP_GLOBAL_ACCOUNT: ${{ secrets.GLOBAL_ACCOUNT }} TF_VAR_BTP_BOT_USER: ${{ secrets.username }} TF_VAR_BTP_BOT_PASSWORD: ${{ secrets.password }} TF_VAR_BTP_KYMA_PLAN: ${{ secrets.kyma_plan }} From 25a86214b4ac58b308f0931e67422b813b5c85d4 Mon Sep 17 00:00:00 2001 From: "Kwiatosz, Krzysztof" Date: Mon, 9 Sep 2024 10:41:10 +0200 Subject: [PATCH 4/4] case sens --- .github/workflows/pull-e2e-test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-e2e-test.yml b/.github/workflows/pull-e2e-test.yml index 47b97b0..2a818a1 100644 --- a/.github/workflows/pull-e2e-test.yml +++ b/.github/workflows/pull-e2e-test.yml @@ -1,6 +1,7 @@ name: pull-e2e-test on: - pull_request: + push: + branches: [ "main", "release-*" ] jobs: btp-integration-tests: @@ -16,7 +17,7 @@ jobs: env: TF_VAR_BTP_SUBACCOUNT: btp-test-PR-${{ github.event.number }}-${{ github.run_attempt }} TF_VAR_BTP_SA_REGION: ${{ secrets.sa_region }} - TF_VAR_BTP_GLOBAL_ACCOUNT: ${{ secrets.GLOBAL_ACCOUNT }} + TF_VAR_BTP_GLOBAL_ACCOUNT: ${{ secrets.global_account }} TF_VAR_BTP_BOT_USER: ${{ secrets.username }} TF_VAR_BTP_BOT_PASSWORD: ${{ secrets.password }} TF_VAR_BTP_KYMA_PLAN: ${{ secrets.kyma_plan }}