diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..8353143 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,30 @@ +name: "CI TF Test" + +on: + push: + branches: + - main + pull_request: + branches: + - main + types: [opened, synchronize, reopened] + workflow_dispatch: # allows manual build + +env: + ARM_TENANT_ID: ${{ secrets.REPO_AZURE_DSB_TENANT_ID }} + ARM_SUBSCRIPTION_ID: ${{ secrets.REPO_AZURE_SUBSCRIPTION_ID }} + ARM_CLIENT_ID: ${{ secrets.REPO_AZURE_TERRAFORM_USER_SERVICE_PRINCIPAL }} + ARM_USE_OIDC: true + ARM_USE_AZUREAD: true + TF_IN_AUTOMATION: true + +jobs: + tf: + uses: dsb-norge/github-actions-terraform/.github/workflows/terraform-module-ci.yaml@tf-test + secrets: inherit + permissions: + contents: read # required for checkout action. + id-token: write # required for Azre passwodless login + pull-requests: write # required for commenting on PR + with: + terraform-version: "1.9.x" \ No newline at end of file diff --git a/examples/01-basic/main.tf b/examples/01-basic/main.tf index 2a7f470..dd20af4 100644 --- a/examples/01-basic/main.tf +++ b/examples/01-basic/main.tf @@ -5,7 +5,7 @@ provider "azurerm" { module "consumption_budget" { source = "../../" - app_short_name = "my-azure-app" + app_short_name = "my-budget-basic" subscription = "sub-name" environment = "prod" consumption_budget_amount = 9000 # in local currency of subscription location diff --git a/examples/02-full/main.tf b/examples/02-full/main.tf index a3d282b..7aa7f65 100644 --- a/examples/02-full/main.tf +++ b/examples/02-full/main.tf @@ -5,7 +5,7 @@ provider "azurerm" { module "consumption_budget" { source = "../../" - app_short_name = "my-azure-app" + app_short_name = "my-budget-full" subscription = "sub-name" environment = "prod" consumption_budget_amount = 9000 # in local currency of subscription location diff --git a/tests/unit-tests.tftest.hcl b/tests/unit-tests.tftest.hcl index bce74db..e90da45 100644 --- a/tests/unit-tests.tftest.hcl +++ b/tests/unit-tests.tftest.hcl @@ -216,8 +216,8 @@ run "it_should_output_resource_id_for_cost_anomaly_alert" { cost_anomaly_alert_email_receivers = ["vaild.dummy@epost.her"] } - assert { - condition = length(output.cost_anomaly_alert_id) > 0 - error_message = "Cost anomaly alert id outpout is missing" - } + assert { + condition = length(output.cost_anomaly_alert_id) > 0 + error_message = "Cost anomaly alert id outpout is missing" + } }