From 8218210ecc50afb9ffb6fa24ea34acd955d5b7c1 Mon Sep 17 00:00:00 2001 From: Jared Holgate Date: Mon, 1 Jul 2024 13:39:11 +0100 Subject: [PATCH] upgrade to v6 of CAF module (#155) ## Overview/Summary Update to target v6 of the CAF module ## This PR fixes/adds/changes/removes N/A ### Breaking Changes See CAF module release notes ## Testing Evidence Please provide any testing evidence to show that your Pull Request works/fixes as described and planned (include screenshots, if appropriate). ## As part of this Pull Request I have - [x] Checked for duplicate [Pull Requests](https://github.com/Azure/alz-terraform-accelerator/pulls) - [x] Associated it with relevant [issues](https://github.com/Azure/alz-terraform-accelerator/issues), for tracking and closure. - [x] Ensured my code/branch is up-to-date with the latest changes in the `main` [branch](https://github.com/Azure/alz-terraform-accelerator/tree/main) - [x] Performed testing and provided evidence. - [x] Updated relevant and associated documentation. --- .github/workflows/scorecard.yml | 11 ++++++----- templates/basic/main.tf | 2 +- templates/basic/terraform.tf | 16 ++++++++++++++-- templates/complete/main.tf | 2 +- templates/complete/terraform.tf | 16 ++++++++++++++-- templates/hubnetworking/main.tf | 2 +- templates/hubnetworking/terraform.tf | 14 +++++++++++++- 7 files changed, 50 insertions(+), 13 deletions(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 05dbb956..a4eae6a0 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -1,3 +1,4 @@ +--- # This workflow uses actions that are not certified by GitHub. They are provided # by a third-party and are governed by separate terms of service, privacy # policy, and support documentation. @@ -12,7 +13,7 @@ on: schedule: - cron: '24 16 * * 1' push: - branches: [ "main" ] + branches: ["main"] # Declare default permissions as read only. permissions: read-all @@ -32,12 +33,12 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 + uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 with: results_file: results.sarif results_format: sarif @@ -59,7 +60,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20 + uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20 with: name: SARIF file path: results.sarif @@ -68,6 +69,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard (optional). # Commenting out will disable upload of results to your repo's Code Scanning dashboard - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9 + uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9 with: sarif_file: results.sarif diff --git a/templates/basic/main.tf b/templates/basic/main.tf index 2751d66b..de2abd6a 100644 --- a/templates/basic/main.tf +++ b/templates/basic/main.tf @@ -1,6 +1,6 @@ module "enterprise_scale" { source = "Azure/caf-enterprise-scale/azurerm" - version = "~> 5.2.0" + version = "~> 6.0.0" disable_telemetry = true diff --git a/templates/basic/terraform.tf b/templates/basic/terraform.tf index f840fe1a..21bf88e4 100644 --- a/templates/basic/terraform.tf +++ b/templates/basic/terraform.tf @@ -1,11 +1,23 @@ terraform { - required_version = "~> 1.6" + required_version = "~> 1.8" required_providers { - azurerm = "~> 3.88" + azurerm = { + source = "hashicorp/azurerm" + version = "~> 3.107" + } + azapi = { + source = "Azure/azapi" + version = "~> 1.13" + } } # backend "azurerm" {} } +provider "azapi" { + skip_provider_registration = true + subscription_id = var.subscription_id_management +} + provider "azurerm" { skip_provider_registration = true features {} diff --git a/templates/complete/main.tf b/templates/complete/main.tf index 706c9308..54f73891 100644 --- a/templates/complete/main.tf +++ b/templates/complete/main.tf @@ -1,6 +1,6 @@ module "enterprise_scale" { source = "Azure/caf-enterprise-scale/azurerm" - version = "~> 5.2.0" + version = "~> 6.0.0" count = length(local.archetypes) > 0 ? 1 : 0 diff --git a/templates/complete/terraform.tf b/templates/complete/terraform.tf index 3310cf42..788d0588 100644 --- a/templates/complete/terraform.tf +++ b/templates/complete/terraform.tf @@ -1,11 +1,23 @@ terraform { - required_version = "~> 1.6" + required_version = "~> 1.8" required_providers { - azurerm = "~> 3.88" + azurerm = { + source = "hashicorp/azurerm" + version = "~> 3.107" + } + azapi = { + source = "Azure/azapi" + version = "~> 1.13" + } } # backend "azurerm" {} } +provider "azapi" { + skip_provider_registration = true + subscription_id = var.subscription_id_management +} + provider "azurerm" { skip_provider_registration = true features {} diff --git a/templates/hubnetworking/main.tf b/templates/hubnetworking/main.tf index 0659a80d..d37508ea 100644 --- a/templates/hubnetworking/main.tf +++ b/templates/hubnetworking/main.tf @@ -1,6 +1,6 @@ module "enterprise_scale" { source = "Azure/caf-enterprise-scale/azurerm" - version = "~> 5.2.0" + version = "~> 6.0.0" disable_telemetry = true diff --git a/templates/hubnetworking/terraform.tf b/templates/hubnetworking/terraform.tf index 199d2758..887baed5 100644 --- a/templates/hubnetworking/terraform.tf +++ b/templates/hubnetworking/terraform.tf @@ -1,11 +1,23 @@ terraform { required_version = "~> 1.6" required_providers { - azurerm = "~> 3.88" + azurerm = { + source = "hashicorp/azurerm" + version = "~> 3.107" + } + azapi = { + source = "Azure/azapi" + version = "~> 1.13" + } } # backend "azurerm" {} } +provider "azapi" { + skip_provider_registration = true + subscription_id = var.subscription_id_management +} + provider "azurerm" { skip_provider_registration = true features {}