Skip to content

Commit

Permalink
fix: regions provider version
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredfholgate committed Dec 11, 2024
1 parent f4c2bc1 commit f27b840
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/ALZ/Private/Config-Helpers/Get-AzureRegionData.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,23 @@ 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 f27b840

Please sign in to comment.