Skip to content

Commit

Permalink
fix: Added fixed uksouth and ukwest locations for `avm.res.network.tr…
Browse files Browse the repository at this point in the history
…afficmanagerprofile` (Azure#3354)

## Description
This pull request introduces fixed locations (uksouth and ukwest) used
to deploy App Service plans in the waf test case due to sku family
limitations

Fixes Azure#3205
Closes Azure#3205 



## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |

[![avm.res.network.trafficmanagerprofile](https://github.com/lsnoddy/bicep-registry-modules/actions/workflows/avm.res.network.trafficmanagerprofile.yml/badge.svg?branch=users%2Flsnoddy%2Ftrafficmanagerprovile)](https://github.com/lsnoddy/bicep-registry-modules/actions/workflows/avm.res.network.trafficmanagerprofile.yml)
|          |

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [x] Update to CI Environment or utilities (Non-module affecting
changes)
- [ ] Azure Verified Module updates:
- [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation

## Checklist

- [x] I'm sure there are no other open Pull Requests for the same
update/change
- [x] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [x] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->
  • Loading branch information
lsnoddy authored Sep 27, 2024
1 parent 95ee1a3 commit abd95ca
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
8 changes: 4 additions & 4 deletions avm/res/network/trafficmanagerprofile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ module trafficmanagerprofile 'br/public:avm/res/network/trafficmanagerprofile:<v
{
name: 'webApp01Endpoint'
properties: {
endpointLocation: 'eastus'
endpointLocation: '<endpointLocation>'
endpointStatus: 'Enabled'
priority: 1
targetResourceId: '<targetResourceId>'
Expand All @@ -268,7 +268,7 @@ module trafficmanagerprofile 'br/public:avm/res/network/trafficmanagerprofile:<v
{
name: 'webApp02Endpoint'
properties: {
endpointLocation: 'westus'
endpointLocation: '<endpointLocation>'
endpointStatus: 'Enabled'
priority: 2
targetResourceId: '<targetResourceId>'
Expand Down Expand Up @@ -334,7 +334,7 @@ module trafficmanagerprofile 'br/public:avm/res/network/trafficmanagerprofile:<v
{
"name": "webApp01Endpoint",
"properties": {
"endpointLocation": "eastus",
"endpointLocation": "<endpointLocation>",
"endpointStatus": "Enabled",
"priority": 1,
"targetResourceId": "<targetResourceId>",
Expand All @@ -345,7 +345,7 @@ module trafficmanagerprofile 'br/public:avm/res/network/trafficmanagerprofile:<v
{
"name": "webApp02Endpoint",
"properties": {
"endpointLocation": "westus",
"endpointLocation": "<endpointLocation>",
"endpointStatus": "Enabled",
"priority": 2,
"targetResourceId": "<targetResourceId>",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/network/trafficmanagerprofile/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "2090813965996228671"
"version": "0.30.23.60470",
"templateHash": "5539048151819308545"
},
"name": "Traffic Manager Profiles",
"description": "This module deploys a Traffic Manager Profile.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ metadata description = 'This instance deploys the module in alignment with the b
@maxLength(90)
param resourceGroupName string = 'dep-${namePrefix}-network.trafficmanagerprofiles-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param resourceLocation string = deployment().location
#disable-next-line no-hardcoded-location
var enforcedLocation01 = 'uksouth'

#disable-next-line no-hardcoded-location
var enforcedLocation02 = 'ukwest'

@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.')
param serviceShort string = 'ntmpwaf'
Expand All @@ -28,35 +31,35 @@ param namePrefix string = '#_namePrefix_#'
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: resourceLocation
location: enforcedLocation01
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
name: '${uniqueString(deployment().name, enforcedLocation01)}-nestedDependencies'
params: {
managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}'
location: resourceLocation
location: enforcedLocation01
serverFarmName01: 'dep-${namePrefix}-sf-${serviceShort}01'
serverFarmName02: 'dep-${namePrefix}-sf-${serviceShort}02'
webApp01Name: 'dep-${namePrefix}-wa-${serviceShort}01'
webApp02Name: 'dep-${namePrefix}-wa-${serviceShort}02'
location01: 'eastus'
location02: 'westus'
location01: enforcedLocation01
location02: enforcedLocation02
}
}

// Diagnostics
// ===========
module diagnosticDependencies '../../../../../../utilities/e2e-template-assets/templates/diagnostic.dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-diagnosticDependencies'
name: '${uniqueString(deployment().name, enforcedLocation01)}-diagnosticDependencies'
params: {
storageAccountName: 'dep${namePrefix}diasa${serviceShort}01'
logAnalyticsWorkspaceName: 'dep-${namePrefix}-law-${serviceShort}'
eventHubNamespaceEventHubName: 'dep-${namePrefix}-evh-${serviceShort}'
eventHubNamespaceName: 'dep-${namePrefix}-evhns-${serviceShort}'
location: resourceLocation
location: enforcedLocation01
}
}

Expand All @@ -67,7 +70,7 @@ module diagnosticDependencies '../../../../../../utilities/e2e-template-assets/t
module testDeployment '../../../main.bicep' = [
for iteration in ['init', 'idem']: {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
name: '${uniqueString(deployment().name, enforcedLocation01)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
location: 'global'
Expand Down Expand Up @@ -107,7 +110,7 @@ module testDeployment '../../../main.bicep' = [
targetResourceId: nestedDependencies.outputs.webApp01ResourceId
weight: 1
priority: 1
endpointLocation: 'eastus'
endpointLocation: '${enforcedLocation01}'
endpointStatus: 'Enabled'
}
}
Expand All @@ -118,7 +121,7 @@ module testDeployment '../../../main.bicep' = [
targetResourceId: nestedDependencies.outputs.webApp02ResourceId
weight: 1
priority: 2
endpointLocation: 'westus'
endpointLocation: '${enforcedLocation02}'
endpointStatus: 'Enabled'
}
}
Expand Down

0 comments on commit abd95ca

Please sign in to comment.