Skip to content

Commit f2159b2

Browse files
fix: regions provider version (#263)
# 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.
1 parent f4c2bc1 commit f2159b2

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/ALZ/Private/Config-Helpers/Get-AzureRegionData.ps1

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,24 @@ terraform {
99
required_providers {
1010
azapi = {
1111
source = "azure/azapi"
12-
version = "~> 1.14"
12+
version = "~> 2.0"
1313
}
1414
}
1515
}
1616
17-
data "azapi_client_config" "current" {}
18-
19-
data "azapi_resource_action" "locations" {
20-
type = "Microsoft.Resources/subscriptions@2022-12-01"
21-
action = "locations"
22-
method = "GET"
23-
resource_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}"
24-
response_export_values = ["value"]
17+
module "regions" {
18+
source = "Azure/avm-utl-regions/azurerm"
19+
version = "0.3.0"
20+
use_cached_data = false
21+
availability_zones_filter = false
22+
recommended_filter = false
2523
}
2624
2725
locals {
28-
regions = { for region in jsondecode(data.azapi_resource_action.locations.output).value : region.name => {
29-
display_name = region.displayName
30-
zones = try([ for zone in region.availabilityZoneMappings : zone.logicalZone ], [])
31-
} if region.metadata.regionType == "Physical"
26+
regions = { for region in module.regions.regions_by_name : region.name => {
27+
display_name = region.display_name
28+
zones = region.zones == null ? [] : region.zones
29+
}
3230
}
3331
}
3432

0 commit comments

Comments
 (0)