Skip to content

Commit

Permalink
feat: Added custom location overwrite (#1721)
Browse files Browse the repository at this point in the history
## Description

- Added custom location overwrite
- This is important if you want to rerun / test the same resource
deployment more than once (e.g. because you disabled the removal the
first time around) and don't want the location rotation to complicate
the effort


![image](https://github.com/Azure/bicep-registry-modules/assets/5365358/92be6ccc-e85d-40c3-a7fc-827760be26e0)


![image](https://github.com/Azure/bicep-registry-modules/assets/5365358/1a5c7b28-fffa-4d7d-8ec6-344917def61c)

## Pipeline Reference

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

| Pipeline |
| -------- |
|
[![avm.res.key-vault.vault](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml/badge.svg?branch=users%2Falsehr%2FoverwriteDefaultLocation&event=workflow_dispatch)](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml)
|


![image](https://github.com/Azure/bicep-registry-modules/assets/5365358/cd7b541f-7317-49b7-b0be-bd28fac327f3)

## Type of Change

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

- [x] Update to CI Environment or utlities (Non-module effecting
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

---------

Co-authored-by: Erika Gressi <[email protected]>
  • Loading branch information
AlexanderSehr and eriqua authored May 3, 2024
1 parent 697ea31 commit 0bd86c2
Show file tree
Hide file tree
Showing 135 changed files with 544 additions and 12 deletions.
17 changes: 13 additions & 4 deletions .github/actions/templates/avm-validateModuleDeployment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
## |======================================================================================================================================================================================|
## | Parameter | Required | Default | Description | Example |
## |----------------------------|----------|---------|-------------------------------------------------------|----------------------------------------------------------------------------|
## | modulePath | true | '' | The path to the module file directory | 'modules/api-management/service/main.bicep'
## | templateFilePath | true | '' | The path to the template file to use for deployment | 'modules/api-management/service/tests/e2e/maix/main.test.bicep' |
## | modulePath | true | '' | The path to the module file directory | 'modules/api-management/service/main.bicep' |
## | templateFilePath | true | '' | The path to the template file to use for deployment | 'modules/api-management/service/tests/e2e/maix/main.test.bicep' |
## | deploymentMetadataLocation | true | '' | The location to store the deployment metadata | 'WestEurope' |
## | subscriptionId | false | '' | The subscriptionId to deploy to | '1a97b80a-4dda-4f50-ab53-349e29344654' |
## | managementGroupId | false | '' | The managementGroupId to deploy to | '1a97b80a-4dda-4f50-ab53-349e29344654' |
## | customTokens | false | '' | Additional token pairs in json format. | '{"tokenName":"tokenValue"}' |
## | removeDeployment | false | 'true' | Set "true" to set module up for removal | 'true' |
## | customLocation | false | | Custom location overwrite, if needed | 'WestEurope' |
## |======================================================================================================================================================================================|
##
#########################################################
Expand Down Expand Up @@ -51,6 +52,9 @@ inputs:
description: 'Set "true" to set module up for removal'
default: "true"
required: false
customLocation:
description: "Custom location overwrite, if needed"
required: false

runs:
using: "composite"
Expand All @@ -73,7 +77,7 @@ runs:
Write-Output '::group::Get Recommended Regions'
# Load used functions
. (Join-Path $env:GITHUB_WORKSPACE 'avm' 'utilities' 'pipelines' 'e2eValidation' 'regionSelector' 'Get-AzAvailableResourceLocation.ps1')
. (Join-Path $env:GITHUB_WORKSPACE 'avm' 'utilities' 'pipelines' 'e2eValidation' 'regionSelector' 'Get-AvailableResourceLocation.ps1')
# Set function input parameters
$functionInput = @{
Expand All @@ -84,7 +88,12 @@ runs:
Write-Verbose "Invoke function with" -Verbose
Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose
$resourceLocation = Get-AzAvailableResourceLocation @functionInput -Verbose
if([String]::IsNullOrEmpty('${{ inputs.customLocation }}')) {
$resourceLocation = Get-AvailableResourceLocation @functionInput -Verbose
} else {
$resourceLocation = '${{ inputs.customLocation }}'
Write-Verbose 'Using specified location [${{ inputs.customLocation }}]' -Verbose
}
Write-Verbose ('{0}-{1}' -f 'resourceLocation', $resourceLocation) -Verbose
Write-Output ('{0}={1}' -f 'resourceLocation', $resourceLocation) >> $env:GITHUB_OUTPUT
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.ptn.authorization.policy-assignment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.ptn.authorization.role-assignment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.ptn.policy-insights.remediation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.ptn.security.security-center.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.aad.domain-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.analysis-services.server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.api-management.service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.app.container-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.app.managed-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.automation.automation-account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.batch.batch-account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.cache.redis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.cdn.profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.cognitive-services.account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.compute.availability-set.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.compute.disk-encryption-set.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.compute.disk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.compute.gallery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.compute.image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.compute.ssh-public-key.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.compute.virtual-machine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.consumption.budget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.container-registry.registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.data-factory.factory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.data-protection.backup-vault.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/avm.res.databricks.access-connector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Remove deployed module"
required: false
default: true
customLocation:
type: string
description: "Default location overwrite (e.g., eastus)"
required: false
push:
branches:
- main
Expand Down
Loading

0 comments on commit 0bd86c2

Please sign in to comment.