Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVM Module Updates #22

Merged
merged 1 commit into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bicep-examples/conditions/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ param kvEnv string = 'prod'
// Environment variable for Key Vault SKU else if
var kvSku = kvEnv == 'prod' ? 'premium' : 'standard'

module KeyVault 'br/public:security/keyvault:1.0.2' = if (deployResource) {
module KeyVault 'br/public:avm/res/key-vault/vault:0.7.0' = if (deployResource) {
name: '${uniqueString(deployment().name, location)}-${kvName}'
params: {
name: kvName
location: location
skuName: kvSku
sku: kvSku
enableSoftDelete: true
}
}
Expand Down
12 changes: 6 additions & 6 deletions bicep-examples/consuming-modules/modules.bicep
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Rios Engineer - Public Bicep Registry Example
module public_registry 'br/public:compute/function-app:2.0.1' = {
name: 'public_registry_example'
// Rios Engineer - Public Bicep Registry Example (Azure Verified Modules)
module KeyVault 'br/public:avm/res/key-vault/vault:0.7.0' = {
name: 'avm_exmple'
params: {
name: 'example-func-001'
name: 'kvName'
location: 'uksouth'
storageAccountName: 'stsomestorageaccount001'
storageAccountResourceGroup: 'rg-some-rg-here'
sku: 'standard'
enableSoftDelete: true
}
}

Expand Down
6 changes: 3 additions & 3 deletions bicep-examples/dependencies/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var frontDoorRouteName = 'webapp-route'
// Azure App Service components

// vNet for integration
module vnet 'br/public:network/virtual-network:1.1.3' = {
module vnet 'br/public:avm/res/network/virtual-network:0.2.0' = {
name: '${uniqueString(deployment().name, location)}-webVnet'
scope: resourceGroup(workloadsSubId, rg_web_workload)
params: {
Expand All @@ -68,7 +68,7 @@ module vnet 'br/public:network/virtual-network:1.1.3' = {
}

// Log Analytics workspace
module logAnalytics 'br/public:storage/log-analytics-workspace:1.0.3' = {
module logAnalytics 'br/public:avm/res/operational-insights/workspace:0.5.0' = {
name: '${uniqueString(deployment().name, location)}-ala'
scope: resourceGroup(rg_web_workload)
params: {
Expand All @@ -84,7 +84,7 @@ module appInsights 'modules/appInsights/appinsights.bicep' = {
params: {
name: appInsightsName
location: location
workspaceResourceId: logAnalytics.outputs.id
workspaceResourceId: logAnalytics.outputs.logAnalyticsWorkspaceId
kind: 'web'
applicationType: 'web'
}
Expand Down
6 changes: 5 additions & 1 deletion bicep-examples/scoped-deployments/management-scope.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ param location string = 'uksouth'
@description('Subscription Id.')
param subId string = 'subscription-guid-here'

@description('Storage Account name.')
param stName string = 'stname0001'

// Deploy Storage Account to existing resource group in a subscription from management scope
module st_deploy 'br/public:storage/storage-account:3.0.1' = {
module st_deploy 'br/public:avm/res/storage/storage-account:0.11.1' = {
scope: resourceGroup(subId, rg)
name: 'st_deploy'
params:{
name: stName
kind: 'StorageV2'
location: location
}
Expand Down
4 changes: 2 additions & 2 deletions bicep-examples/scoped-deployments/subscription-scope.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ location: location

// Deploy storage account to newly created resource group

module st_deploy 'br/public:storage/storage-account:3.0.1' = {
module st_deploy 'br/public:avm/res/storage/storage-account:0.11.1' = {
scope: rg_deploy
name: 'storageDeployment'
params:{
Expand All @@ -25,7 +25,7 @@ module st_deploy 'br/public:storage/storage-account:3.0.1' = {

// Deploy storage account to existing resource group in a subscription, without changing target scope

module st_deploy2 'br/public:storage/storage-account:3.0.1' = {
module st_deploy2 'br/public:avm/res/storage/storage-account:0.11.1' = {
scope: resourceGroup('subscription-guid-here', 'rg-name-here')
name: 'storageDeployment'
params:{
Expand Down
6 changes: 5 additions & 1 deletion bicep-examples/test-framework/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ param location string
@description('Storage account resource SKU.')
param kind string

@description('Storage account name.')
param stName string

// Storage Account
module storage 'br/public:storage/storage-account:3.0.1' = {
module storage 'br/public:avm/res/storage/storage-account:0.11.1' = {
name: 'storage_deploy'
params:{
name: stName
kind: kind
location: location
}
Expand Down
4 changes: 1 addition & 3 deletions bicep-examples/test-framework/main.bicepparam
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using './main.bicep'

@description('Deployment location for resources.')
param location = 'uksouth'

@description('Storage account resource SKU.')
param kind = 'storageV2'
param stName = 'stbicepifydemo001'
2 changes: 2 additions & 0 deletions bicep-examples/test-framework/tests.bicep
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// Rios Engineer - Bicep Test Framework
test mainTest 'main.bicep' = {
params: {
stName: 'stbicepifydemo001'
kind: 'storageV2'
location: 'uksouth'
}
}

test mainTestFail 'main.bicep' = {
params: {
stName: 'stbicepifydemo001'
kind: 'BlobStorage'
location: 'northeurope'
}
Expand Down
Loading