forked from Azure/bicep-registry-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into users/ahmad/3208_pls
- Loading branch information
Showing
5 changed files
with
163 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
avm/res/network/nat-gateway/tests/e2e/existingPip/dependencies.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@description('Optional. The location to deploy to.') | ||
param location string = resourceGroup().location | ||
|
||
@description('Required. The name of the Public IP to create.') | ||
param existingPipName string | ||
|
||
resource existingPip 'Microsoft.Network/publicIPAddresses@2023-04-01' = { | ||
name: existingPipName | ||
location: location | ||
sku: { | ||
name: 'Standard' | ||
tier: 'Regional' | ||
} | ||
properties: { | ||
publicIPAllocationMethod: 'Static' | ||
} | ||
zones: [ | ||
'1' | ||
'2' | ||
'3' | ||
] | ||
} | ||
|
||
@description('The resource ID of the existing Public IP.') | ||
output existingPipResourceId string = existingPip.id |
61 changes: 61 additions & 0 deletions
61
avm/res/network/nat-gateway/tests/e2e/existingPip/main.test.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
targetScope = 'subscription' | ||
|
||
metadata name = 'Using an existing Public IP' | ||
metadata description = 'This instance deploys the module using an existing Public IP address.' | ||
|
||
// ========== // | ||
// Parameters // | ||
// ========== // | ||
|
||
@description('Optional. The name of the resource group to deploy for testing purposes.') | ||
@maxLength(90) | ||
param resourceGroupName string = 'dep-${namePrefix}-network.natgateway-${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 = 'nngepip' | ||
|
||
@description('Optional. A token to inject into the name of each resource.') | ||
param namePrefix string = '#_namePrefix_#' | ||
|
||
// ============ // | ||
// Dependencies // | ||
// ============ // | ||
|
||
// General resources | ||
// ================= | ||
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { | ||
name: resourceGroupName | ||
location: resourceLocation | ||
} | ||
|
||
module nestedDependencies 'dependencies.bicep' = { | ||
scope: resourceGroup | ||
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies' | ||
params: { | ||
location: resourceLocation | ||
existingPipName: '${namePrefix}${serviceShort}001-existingpip1' | ||
|
||
} | ||
} | ||
|
||
|
||
// ============== // | ||
// Test Execution // | ||
// ============== // | ||
|
||
@batchSize(1) | ||
module testDeployment '../../../main.bicep' = [ | ||
for iteration in ['init', 'idem']: { | ||
scope: resourceGroup | ||
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}' | ||
params: { | ||
location: resourceLocation | ||
name: '${namePrefix}${serviceShort}001' | ||
zone: 1 | ||
publicIpResourceIds: [nestedDependencies.outputs.existingPipResourceId] | ||
} | ||
} | ||
] |