Skip to content

Commit 70a0a49

Browse files
committed
Updated avm modules
1 parent 831ae8b commit 70a0a49

3 files changed

Lines changed: 62 additions & 11 deletions

File tree

infra/main.bicep

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,23 @@ module avmApplicationInsights 'br/public:avm/res/insights/component:0.6.0' = {
231231
// }
232232

233233
// // ========== Container Registry ========== //
234-
module avmContainerRegistry 'br/public:avm/res/container-registry/registry:0.9.1' = {
235-
name: format(deployment_param.resource_name_format_string, abbrs.containers.containerRegistry)
234+
module avmContainerRegistry 'modules/container-registry.bicep' = {
235+
//name: format(deployment_param.resource_name_format_string, abbrs.containers.containerRegistry)
236236
params: {
237-
name: '${abbrs.containers.containerRegistry}${replace(deployment_param.solution_prefix, '-', '')}'
238-
location: deployment_param.resource_group_location
239-
acrSku: 'Basic'
240-
publicNetworkAccess: 'Enabled'
241-
zoneRedundancy: 'Disabled'
237+
containerRegistryParams: {
238+
acrName: '${abbrs.containers.containerRegistry}${replace(deployment_param.solution_prefix, '-', '')}'
239+
location: deployment_param.resource_group_location
240+
acrSku: 'Basic'
241+
publicNetworkAccess: 'Enabled'
242+
zoneRedundancy: 'Disabled'
243+
}
244+
defaultDeploymentParams: deployment_param
242245
}
243246
}
247+
248+
249+
250+
244251
// module containerRegistry 'deploy_container_registry.bicep' = {
245252
// name: 'deploy_container_registry'
246253
// params: {
@@ -649,7 +656,7 @@ module avmContainerApp 'br/public:avm/res/app/container-app:0.16.0' = {
649656
containers: [
650657
{
651658
name: '${abbrs.containers.containerApp}${deployment_param.solution_prefix}'
652-
image: '${deployment_param.public_container_image_endpoint}/contentprocessor:dblee'
659+
image: '${deployment_param.public_container_image_endpoint}/contentprocessor:latest'
653660

654661
resources: {
655662
cpu: '4'
@@ -686,7 +693,7 @@ module avmContainerApp_API 'br/public:avm/res/app/container-app:0.16.0' = {
686693
{
687694
server: deployment_param.public_container_image_endpoint
688695
image: 'contentprocessorapi'
689-
imageTag: 'dblee'
696+
imageTag: 'latest'
690697
}
691698
]
692699
: null
@@ -701,7 +708,7 @@ module avmContainerApp_API 'br/public:avm/res/app/container-app:0.16.0' = {
701708
containers: [
702709
{
703710
name: '${abbrs.containers.containerApp}${deployment_param.solution_prefix}-api'
704-
image: '${deployment_param.public_container_image_endpoint}/contentprocessorapi:dblee'
711+
image: '${deployment_param.public_container_image_endpoint}/contentprocessorapi:latest'
705712
resources: {
706713
cpu: '4'
707714
memory: '8.0Gi'
@@ -1076,7 +1083,7 @@ module avmRoleAssignment_container_app_web 'br/public:avm/ptn/authorization/reso
10761083
params: {
10771084
resourceId: avmAppConfig.outputs.resourceId
10781085
principalId: avmContainerApp_Web.outputs.?systemAssignedMIPrincipalId
1079-
roleDefinitionId: '516239f1-63e1-4d78-a4de-a74fb236a071' // Built-in
1086+
roleDefinitionId: '516239f1-63e1-4d78-a4de-a74fb236a071' // Built-in
10801087
roleName: 'App Configuration Data Reader'
10811088
principalType: 'ServicePrincipal'
10821089
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
metadata name = 'Container Registry Module'
2+
// AVM-compliant Azure Container Registry deployment
3+
4+
import {
5+
container_registry_param_type
6+
default_deployment_param_type
7+
} from './types.bicep'
8+
9+
param containerRegistryParams container_registry_param_type
10+
param defaultDeploymentParams default_deployment_param_type
11+
12+
module avmContainerRegistry 'br/public:avm/res/container-registry/registry:0.9.1' = {
13+
name: 'deploy_container_registry'
14+
params: {
15+
name: containerRegistryParams.acrName
16+
location: containerRegistryParams.location
17+
acrSku: containerRegistryParams.acrSku
18+
publicNetworkAccess: containerRegistryParams.publicNetworkAccess
19+
zoneRedundancy: containerRegistryParams.zoneRedundancy
20+
21+
22+
}
23+
}
24+
25+
26+
27+
output resourceId string = avmContainerRegistry.outputs.resourceId

infra/modules/types.bicep

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,23 @@ type app_insights_param_type = {
146146
@description('Search version for the Log Analytics Workspace resource')
147147
searchVersion: 1
148148
}
149+
}
150+
151+
type container_registry_sku_type = 'Basic' | 'Standard' | 'Premium'
152+
type public_network_access_type = 'Enabled' | 'Disabled'
153+
type zone_redundancy_type = 'Enabled' | 'Disabled'
149154

150155

156+
@export()
157+
type container_registry_param_type = {
158+
@description('Name of the Azure Container Registry')
159+
acrName: string
160+
@description('Location for the Azure Container Registry')
161+
location: string
162+
@description('SKU for the Azure Container Registry')
163+
acrSku: container_registry_sku_type
164+
@description('Public network access setting for the Azure Container Registry')
165+
publicNetworkAccess: public_network_access_type
166+
@description('Zone redundancy setting for the Azure Container Registry')
167+
zoneRedundancy: zone_redundancy_type
151168
}

0 commit comments

Comments
 (0)