Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
segraef committed Dec 22, 2023
1 parent 501b99d commit 59d6380
Show file tree
Hide file tree
Showing 27 changed files with 64 additions and 112 deletions.
7 changes: 4 additions & 3 deletions avm/res/cache/redis/tests/e2e/defaults/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
location: location
}
}
}]
7 changes: 4 additions & 3 deletions avm/res/cache/redis/tests/e2e/max/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ module diagnosticDependencies '../../../../../../utilities/e2e-template-assets/t
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
location: location
Expand Down Expand Up @@ -116,4 +117,4 @@ module testDeployment '../../../main.bicep' = {
resourceType: 'Redis Cache'
}
}
}
}]
7 changes: 4 additions & 3 deletions avm/res/cache/redis/tests/e2e/waf-aligned/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ module diagnosticDependencies '../../../../../../utilities/e2e-template-assets/t
// Test Execution //
// ============== //

module testDeployment '../../../main.bicep' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}'
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
location: location
Expand Down Expand Up @@ -112,4 +113,4 @@ module testDeployment '../../../main.bicep' = {
resourceType: 'Redis Cache'
}
}
}
}]
2 changes: 1 addition & 1 deletion avm/res/compute/disk/tests/e2e/defaults/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata description = 'This instance deploys the module with the minimum set of

@description('Optional. The name of the resource group to deploy for testing purposes.')
@maxLength(90)
param resourceGroupName string = 'dep-${namePrefix}-compute.images-${serviceShort}-rg'
param resourceGroupName string = 'dep-${namePrefix}-compute.disk-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param location string = deployment().location
Expand Down
2 changes: 1 addition & 1 deletion avm/res/compute/disk/tests/e2e/image/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata description = 'This instance deploys the module with an image reference

@description('Optional. The name of the resource group to deploy for testing purposes.')
@maxLength(90)
param resourceGroupName string = 'dep-${namePrefix}-compute.images-${serviceShort}-rg'
param resourceGroupName string = 'dep-${namePrefix}-compute.disks-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param location string = deployment().location
Expand Down
2 changes: 1 addition & 1 deletion avm/res/compute/disk/tests/e2e/import/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata description = 'This instance deploys the module with a custom image tha

@description('Optional. The name of the resource group to deploy for testing purposes.')
@maxLength(90)
param resourceGroupName string = 'dep-${namePrefix}-compute.images-${serviceShort}-rg'
param resourceGroupName string = 'dep-${namePrefix}-compute.disks-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param location string = deployment().location
Expand Down
2 changes: 1 addition & 1 deletion avm/res/compute/disk/tests/e2e/max/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata description = 'This instance deploys the module with most of its featur

@description('Optional. The name of the resource group to deploy for testing purposes.')
@maxLength(90)
param resourceGroupName string = 'dep-${namePrefix}-compute.images-${serviceShort}-rg'
param resourceGroupName string = 'dep-${namePrefix}-compute.disks-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param location string = deployment().location
Expand Down
2 changes: 1 addition & 1 deletion avm/res/compute/disk/tests/e2e/waf-aligned/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata description = 'This instance deploys the module in alignment with the b

@description('Optional. The name of the resource group to deploy for testing purposes.')
@maxLength(90)
param resourceGroupName string = 'dep-${namePrefix}-compute.images-${serviceShort}-rg'
param resourceGroupName string = 'dep-${namePrefix}-compute.disks-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param location string = deployment().location
Expand Down
7 changes: 5 additions & 2 deletions avm/res/compute/image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ The following section provides usage examples for the module, which were used to
>**Note**: To reference the module, please use the following syntax `br/public:avm/res/compute/image:<version>`.
- [Defaults](#example-1-defaults)
- [Using only defaults](#example-1-using-only-defaults)
- [Using large parameter set](#example-2-using-large-parameter-set)
- [WAF-aligned](#example-3-waf-aligned)

### Example 1: _Defaults_
### Example 1: _Using only defaults_

This instance deploys the module with the minimum set of required parameters.


<details>

Expand Down
2 changes: 1 addition & 1 deletion avm/res/compute/image/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,4 +323,4 @@
"value": "[reference('image', '2022-11-01', 'full').location]"
}
}
}
}
7 changes: 5 additions & 2 deletions avm/res/compute/image/tests/e2e/defaults/main.test.bicep
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
targetScope = 'subscription'

metadata name = 'Using only defaults'
metadata description = 'This instance deploys the module with the minimum set of required parameters.'

// ========== //
// Parameters //
// ========== //

@description('Optional. The name of the resource group to deploy for testing purposes.')
@maxLength(90)
// e.g., for a module 'network/private-endpoint' you could use 'dep-dev-network.privateendpoints-${serviceShort}-rg'
param resourceGroupName string = 'dep-${namePrefix}-<provider>-<resourceType>-${serviceShort}-rg'
param resourceGroupName string = 'dep-${namePrefix}-compute.images-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param location string = deployment().location
Expand All @@ -17,7 +20,7 @@ param location string = deployment().location
param serviceShort string = 'cimin'

@description('Optional. A token to inject into the name of each resource. This value can be automatically injected by the CI.')
param namePrefix string = '#_namePrefix_#'
param namePrefix string = 'wsdfv'

// ============ //
// Dependencies //
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
location: location
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-nestedDependencies'
params: {
managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}'
location: location
}
}

// ============== //
// Test Execution //
// ============== //
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
location: location
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-nestedDependencies'
params: {
managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}'
location: location
}
}

// ============== //
// Test Execution //
// ============== //
Expand All @@ -56,9 +47,6 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
}
managedIdentities: {
systemAssigned: true
userAssignedResourceIds: [
nestedDependencies.outputs.managedIdentityResourceId
]
}
tags: {
'hidden-title': 'This is visible in the resource name'
Expand Down
3 changes: 0 additions & 3 deletions avm/res/databricks/workspace/tests/e2e/max/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ param location 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 = 'dwmax'

@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
param enableDefaultTelemetry bool = true

@description('Generated. Used as a basis for unique resource names.')
param baseTime string = utcNow('u')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ resource getPairedRegionScript 'Microsoft.Resources/deploymentScripts@2020-10-01
azPowerShellVersion: '8.0'
retentionInterval: 'P1D'
arguments: '-Location \\"${location}\\"'
scriptContent: loadTextContent('../../../../../.shared/.scripts/Get-PairedRegion.ps1')
scriptContent: loadTextContent('../../../../../../utilities/e2e-template-assets/scripts/.scripts/Get-PairedRegion.ps1')
}
dependsOn: [
roleAssignment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ param resourceGroupName string = 'dep-${namePrefix}-dbformysql.flexibleservers-$
param location 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 = 'dfmsfsp'
param serviceShort string = 'dfmsfsmax'

@description('Optional. The password to leverage for the login.')
@secure()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
targetScope = 'subscription'

metadata name = 'Deploys in connectivity mode "Private Access"'
metadata description = 'This instance deploys the module with connectivity mode "Private Access".'

// ========== //
// Parameters //
// ========== //
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
targetScope = 'subscription'

metadata name = 'WAF-aligned'
metadata description = 'This instance deploys the module in alignment with the best-practices of the Azure Well-Architected Framework.'

// ========== //
// Parameters //
// ========== //

@description('Optional. The name of the resource group to deploy for testing purposes.')
@maxLength(90)
// e.g., for a module 'network/private-endpoint' you could use 'dep-dev-network.privateendpoints-${serviceShort}-rg'
param resourceGroupName string = 'dep-${namePrefix}-<provider>-<resourceType>-${serviceShort}-rg'
param resourceGroupName string = 'dep-${namePrefix}-dbformysql.flexibleservers-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param location string = deployment().location
Expand All @@ -16,6 +19,10 @@ param location string = deployment().location
// e.g., for a module 'network/private-endpoint' you could use 'npe' as a prefix and then 'waf' as a suffix for the waf-aligned test
param serviceShort string = 'dfmsfswaf'

@description('Optional. The password to leverage for the login.')
@secure()
param password string = newGuid()

@description('Optional. A token to inject into the name of each resource. This value can be automatically injected by the CI.')
param namePrefix string = '#_namePrefix_#'

Expand All @@ -39,7 +46,20 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
params: {
// You parameters go here
name: '${namePrefix}${serviceShort}001'
location: location
administratorLogin: 'adminUserName'
administratorLoginPassword: password
skuName: 'Standard_B1ms'
tier: 'Burstable'
lock: {
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
tags: {
'hidden-title': 'This is visible in the resource name'
Environment: 'Non-Prod'
Role: 'DeploymentValidation'
}
}
}]

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
location: location
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-nestedDependencies'
params: {
managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}'
location: location
}
}

// ============== //
// Test Execution //
// ============== //
Expand All @@ -61,10 +52,5 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
Role: 'DeploymentValidation'
}
sku: 'F0'
managedIdentities: {
userAssignedResourceIds: [
nestedDependencies.outputs.managedIdentityResourceId
]
}
}
}]
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
targetScope = 'subscription'

metadata name = 'Using large parameter set'
metadata description = 'This instance deploys the module with most of its features enabled.'

// ========== //
// Parameters //
// ========== //
Expand All @@ -12,7 +15,7 @@ param resourceGroupName string = 'dep-${namePrefix}-netapp.netappaccounts-${serv
param location 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 = 'nanaanfs41'
param serviceShort string = 'nanaamax'

@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
targetScope = 'subscription'

metadata name = 'Using nfs31 parameter set'
metadata description = 'This instance deploys the module with nfs31.'

// ========== //
// Parameters //
// ========== //
Expand Down
Loading

0 comments on commit 59d6380

Please sign in to comment.