Skip to content

Commit

Permalink
fix: regions provider version (#263)
Browse files Browse the repository at this point in the history
# Pull Request

## Issue

#213 

## Description

Fix the regions provider version and use the AVM

e2e test run for this branch:
https://github.com/Azure/accelerator-bootstrap-modules/actions/runs/12273987111

## License

By submitting this pull request, I confirm that my contribution is made
under the terms of the projects associated license.
  • Loading branch information
jaredfholgate authored Dec 11, 2024
1 parent f4c2bc1 commit f2159b2
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/ALZ/Private/Config-Helpers/Get-AzureRegionData.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,24 @@ terraform {
required_providers {
azapi = {
source = "azure/azapi"
version = "~> 1.14"
version = "~> 2.0"
}
}
}
data "azapi_client_config" "current" {}
data "azapi_resource_action" "locations" {
type = "Microsoft.Resources/subscriptions@2022-12-01"
action = "locations"
method = "GET"
resource_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}"
response_export_values = ["value"]
module "regions" {
source = "Azure/avm-utl-regions/azurerm"
version = "0.3.0"
use_cached_data = false
availability_zones_filter = false
recommended_filter = false
}
locals {
regions = { for region in jsondecode(data.azapi_resource_action.locations.output).value : region.name => {
display_name = region.displayName
zones = try([ for zone in region.availabilityZoneMappings : zone.logicalZone ], [])
} if region.metadata.regionType == "Physical"
regions = { for region in module.regions.regions_by_name : region.name => {
display_name = region.display_name
zones = region.zones == null ? [] : region.zones
}
}
}
Expand Down

0 comments on commit f2159b2

Please sign in to comment.