Skip to content

Commit

Permalink
fix: Added a fixed uksouth location for `avm.res.dev-ops-infrastructu…
Browse files Browse the repository at this point in the history
…re.pool` (#3351)

## Description

This pull request introduces a fixed location (uksouth) used to run the
validation deployments.

## Pipeline Reference

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

| Pipeline |
| -------- |
|
[![avm.res.dev-ops-infrastructure.pool](https://github.com/johnlokerse/bicep-registry-modules/actions/workflows/avm.res.dev-ops-infrastructure.pool.yml/badge.svg?branch=johnlokerse%2Fenforce-location-mdp)](https://github.com/johnlokerse/bicep-registry-modules/actions/workflows/avm.res.dev-ops-infrastructure.pool.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
johnlokerse authored Sep 26, 2024
1 parent 717e7fd commit 0324570
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 26 deletions.
4 changes: 2 additions & 2 deletions avm/res/dev-ops-infrastructure/pool/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.3.12046",
"templateHash": "15191897376801297199"
"version": "0.30.23.60470",
"templateHash": "3502193398932835678"
},
"name": "Managed DevOps Pool",
"description": "This module deploys the Managed DevOps Pool resource.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,26 @@ metadata description = 'This instance deploys the module with the minimum set of
@maxLength(90)
param resourceGroupName string = 'dep-${namePrefix}-dev-ops-infrastructure.pool-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param resourceLocation string = deployment().location

@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 = 'mdpmin'

@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

@description('Required. Name of the Azure DevOps Organization. This value is tenant-specific and must be stored in the CI Key Vault in a secret named \'CI-AzureDevOpsOrganizationName\'.')
@description('Required. Name of the Azure DevOps organization. This value is tenant-specific and must be stored in the CI Key Vault in a secret named \'CI-AzureDevOpsOrganizationName\'.')
@secure()
param azureDevOpsOrganizationName string = ''

// The Managed DevOps Pools resource is not available in all regions
#disable-next-line no-hardcoded-location
var enforcedLocation = 'uksouth'

// ============ //
// Dependencies //
// ============ //
module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
name: '${uniqueString(deployment().name, enforcedLocation)}-nestedDependencies'
params: {
devCenterName: 'dep-${namePrefix}-dc-${serviceShort}'
devCenterProjectName: 'dep-${namePrefix}-dcp-${serviceShort}'
Expand All @@ -40,7 +41,7 @@ module nestedDependencies 'dependencies.bicep' = {
// ================= //
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: resourceLocation
location: enforcedLocation
}

// ============== //
Expand All @@ -50,10 +51,10 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
module testDeployment '../../../main.bicep' = [
for iteration in ['init', 'idem']: {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
name: '${uniqueString(deployment().name, enforcedLocation)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
location: resourceLocation
location: enforcedLocation
agentProfile: {
kind: 'Stateless'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ metadata description = 'This instance deploys the module with most of its featur
@maxLength(90)
param resourceGroupName string = 'dep-${namePrefix}-dev-ops-infrastructure.pool-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param resourceLocation string = deployment().location

@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 = 'mdpmax'

@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

@description('Required. Name of the Azure DevOps Organization. This value is tenant-specific and must be stored in the CI Key Vault in a secret named \'CI-AzureDevOpsOrganizationName\'.')
@description('Required. Name of the Azure DevOps organization. This value is tenant-specific and must be stored in the CI Key Vault in a secret named \'CI-AzureDevOpsOrganizationName\'.')
@secure()
param azureDevOpsOrganizationName string = ''

Expand All @@ -32,12 +29,16 @@ param azureDevOpsProjectName string = ''
@secure()
param devOpsInfrastructureObjectID string = ''

// The Managed DevOps Pools resource is not available in all regions
#disable-next-line no-hardcoded-location
var enforcedLocation = 'uksouth'

// ============ //
// Dependencies //
// ============ //
module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
name: '${uniqueString(deployment().name, enforcedLocation)}-nestedDependencies'
params: {
devCenterName: 'dep-${namePrefix}-dc-${serviceShort}'
devCenterProjectName: 'dep-${namePrefix}-dcp-${serviceShort}'
Expand All @@ -51,7 +52,7 @@ module nestedDependencies 'dependencies.bicep' = {
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: resourceLocation
location: enforcedLocation
}

// ============== //
Expand All @@ -62,10 +63,10 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
module testDeployment '../../../main.bicep' = [
for iteration in ['init', 'idem']: {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
name: '${uniqueString(deployment().name, enforcedLocation)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
location: resourceLocation
location: enforcedLocation
agentProfile: {
kind: 'Stateless'
resourcePredictions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ metadata description = 'This instance deploys the module in alignment with the b
@maxLength(90)
param resourceGroupName string = 'dep-${namePrefix}-dev-ops-infrastructure.pool-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param resourceLocation string = deployment().location

@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 = 'mdpwaf'

@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

@description('Required. Name of the Azure DevOps Organization. This value is tenant-specific and must be stored in the CI Key Vault in a secret named \'CI-AzureDevOpsOrganizationName\'.')
@description('Required. Name of the Azure DevOps organization. This value is tenant-specific and must be stored in the CI Key Vault in a secret named \'CI-AzureDevOpsOrganizationName\'.')
@secure()
param azureDevOpsOrganizationName string = ''

Expand All @@ -32,12 +29,16 @@ param azureDevOpsProjectName string = ''
@secure()
param devOpsInfrastructureObjectID string = ''

// The Managed DevOps Pools resource is not available in all regions
#disable-next-line no-hardcoded-location
var enforcedLocation = 'uksouth'

// ============ //
// Dependencies //
// ============ //
module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
name: '${uniqueString(deployment().name, enforcedLocation)}-nestedDependencies'
params: {
devCenterName: 'dep-${namePrefix}-dc-${serviceShort}'
devCenterProjectName: 'dep-${namePrefix}-dcp-${serviceShort}'
Expand All @@ -51,7 +52,7 @@ module nestedDependencies 'dependencies.bicep' = {
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: resourceLocation
location: enforcedLocation
}

// ============== //
Expand All @@ -62,10 +63,10 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
module testDeployment '../../../main.bicep' = [
for iteration in ['init', 'idem']: {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
name: '${uniqueString(deployment().name, enforcedLocation)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
location: resourceLocation
location: enforcedLocation
agentProfile: {
kind: 'Stateless'
resourcePredictions: {
Expand Down

0 comments on commit 0324570

Please sign in to comment.