Skip to content

Commit ae636f5

Browse files
feat: ResourceGroup - Updated UDTs to pending specs (#4108)
## Description Updated user-defined types with pending Azure/Azure-Verified-Modules#1738 & #4098. ## Pipeline Reference <!-- Insert your Pipeline Status Badge below --> | Pipeline | | -------- | [![avm.res.resources.resource-group](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.resources.resource-group.yml/badge.svg?branch=users%2Falsehr%2FresourceGroup_udt&event=workflow_dispatch)](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.resources.resource-group.yml) ## Type of Change <!-- Use the checkboxes [x] on the options that are relevant. --> - [ ] Update to CI Environment or utilities (Non-module affecting changes) - [x] 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
1 parent 1c6db4f commit ae636f5

File tree

5 files changed

+101
-152
lines changed

5 files changed

+101
-152
lines changed

avm/res/resources/resource-group/README.md

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This module deploys a Resource Group.
88
- [Usage examples](#Usage-examples)
99
- [Parameters](#Parameters)
1010
- [Outputs](#Outputs)
11+
- [Cross-referenced modules](#Cross-referenced-modules)
1112
- [Data Collection](#Data-Collection)
1213

1314
## Resource Types
@@ -43,10 +44,7 @@ This instance deploys the module with the minimum set of required parameters.
4344
module resourceGroup 'br/public:avm/res/resources/resource-group:<version>' = {
4445
name: 'resourceGroupDeployment'
4546
params: {
46-
// Required parameters
4747
name: 'avm-resources.resourcegroups-rrgmin-rg'
48-
// Non-required parameters
49-
location: '<location>'
5048
}
5149
}
5250
```
@@ -63,13 +61,8 @@ module resourceGroup 'br/public:avm/res/resources/resource-group:<version>' = {
6361
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
6462
"contentVersion": "1.0.0.0",
6563
"parameters": {
66-
// Required parameters
6764
"name": {
6865
"value": "avm-resources.resourcegroups-rrgmin-rg"
69-
},
70-
// Non-required parameters
71-
"location": {
72-
"value": "<location>"
7366
}
7467
}
7568
}
@@ -85,10 +78,7 @@ module resourceGroup 'br/public:avm/res/resources/resource-group:<version>' = {
8578
```bicep-params
8679
using 'br/public:avm/res/resources/resource-group:<version>'
8780
88-
// Required parameters
8981
param name = 'avm-resources.resourcegroups-rrgmin-rg'
90-
// Non-required parameters
91-
param location = '<location>'
9282
```
9383

9484
</details>
@@ -264,11 +254,6 @@ module resourceGroup 'br/public:avm/res/resources/resource-group:<version>' = {
264254
// Required parameters
265255
name: 'avm-resources.resourcegroups-rrgwaf-rg'
266256
// Non-required parameters
267-
location: '<location>'
268-
lock: {
269-
kind: 'CanNotDelete'
270-
name: 'myCustomLockName'
271-
}
272257
tags: {
273258
Environment: 'Non-Prod'
274259
'hidden-title': 'This is visible in the resource name'
@@ -295,15 +280,6 @@ module resourceGroup 'br/public:avm/res/resources/resource-group:<version>' = {
295280
"value": "avm-resources.resourcegroups-rrgwaf-rg"
296281
},
297282
// Non-required parameters
298-
"location": {
299-
"value": "<location>"
300-
},
301-
"lock": {
302-
"value": {
303-
"kind": "CanNotDelete",
304-
"name": "myCustomLockName"
305-
}
306-
},
307283
"tags": {
308284
"value": {
309285
"Environment": "Non-Prod",
@@ -328,11 +304,6 @@ using 'br/public:avm/res/resources/resource-group:<version>'
328304
// Required parameters
329305
param name = 'avm-resources.resourcegroups-rrgwaf-rg'
330306
// Non-required parameters
331-
param location = '<location>'
332-
param lock = {
333-
kind: 'CanNotDelete'
334-
name: 'myCustomLockName'
335-
}
336307
param tags = {
337308
Environment: 'Non-Prod'
338309
'hidden-title': 'This is visible in the resource name'
@@ -532,6 +503,14 @@ Tags of the storage account resource.
532503
| `name` | string | The name of the resource group. |
533504
| `resourceId` | string | The resource ID of the resource group. |
534505

506+
## Cross-referenced modules
507+
508+
This section gives you an overview of all local-referenced module files (i.e., other modules that are referenced in this module) and all remote-referenced files (i.e., Bicep modules that are referenced from a Bicep Registry or Template Specs).
509+
510+
| Reference | Type |
511+
| :-- | :-- |
512+
| `br/public:avm/utl/types/avm-common-types:0.4.1` | Remote reference |
513+
535514
## Data Collection
536515

537516
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the [repository](https://aka.ms/avm/telemetry). There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

avm/res/resources/resource-group/main.bicep

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ param name string
1010
@description('Optional. Location of the Resource Group. It uses the deployment\'s location when not provided.')
1111
param location string = deployment().location
1212

13+
import { lockType } from 'br/public:avm/utl/types/avm-common-types:0.4.1'
1314
@description('Optional. The lock settings of the service.')
14-
param lock lockType
15+
param lock lockType?
1516

17+
import { roleAssignmentType } from 'br/public:avm/utl/types/avm-common-types:0.4.1'
1618
@description('Optional. Array of role assignments to create.')
17-
param roleAssignments roleAssignmentType
19+
param roleAssignments roleAssignmentType[]?
1820

1921
@description('Optional. Tags of the storage account resource.')
2022
param tags object?
@@ -75,41 +77,3 @@ output resourceId string = resourceGroup.id
7577

7678
@description('The location the resource was deployed into.')
7779
output location string = resourceGroup.location
78-
79-
// =============== //
80-
// Definitions //
81-
// =============== //
82-
83-
type lockType = {
84-
@description('Optional. Specify the name of lock.')
85-
name: string?
86-
87-
@description('Optional. Specify the type of lock.')
88-
kind: ('CanNotDelete' | 'ReadOnly' | 'None')?
89-
}?
90-
91-
type roleAssignmentType = {
92-
@description('Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated.')
93-
name: string?
94-
95-
@description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
96-
roleDefinitionIdOrName: string
97-
98-
@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
99-
principalId: string
100-
101-
@description('Optional. The principal type of the assigned principal ID.')
102-
principalType: ('ServicePrincipal' | 'Group' | 'User' | 'ForeignGroup' | 'Device')?
103-
104-
@description('Optional. The description of the role assignment.')
105-
description: string?
106-
107-
@description('Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container".')
108-
condition: string?
109-
110-
@description('Optional. Version of the condition.')
111-
conditionVersion: '2.0'?
112-
113-
@description('Optional. The Resource Id of the delegated managed identity resource.')
114-
delegatedManagedIdentityResourceId: string?
115-
}[]?

avm/res/resources/resource-group/main.json

Lines changed: 88 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"metadata": {
66
"_generator": {
77
"name": "bicep",
8-
"version": "0.29.47.4906",
9-
"templateHash": "12280129054844550830"
8+
"version": "0.32.4.45862",
9+
"templateHash": "15310777892883158544"
1010
},
1111
"name": "Resource Groups",
1212
"description": "This module deploys a Resource Group.",
@@ -36,80 +36,87 @@
3636
}
3737
}
3838
},
39-
"nullable": true
39+
"metadata": {
40+
"description": "An AVM-aligned type for a lock.",
41+
"__bicep_imported_from!": {
42+
"sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.4.1"
43+
}
44+
}
4045
},
4146
"roleAssignmentType": {
42-
"type": "array",
43-
"items": {
44-
"type": "object",
45-
"properties": {
46-
"name": {
47-
"type": "string",
48-
"nullable": true,
49-
"metadata": {
50-
"description": "Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated."
51-
}
52-
},
53-
"roleDefinitionIdOrName": {
54-
"type": "string",
55-
"metadata": {
56-
"description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
57-
}
58-
},
59-
"principalId": {
60-
"type": "string",
61-
"metadata": {
62-
"description": "Required. The principal ID of the principal (user/group/identity) to assign the role to."
63-
}
64-
},
65-
"principalType": {
66-
"type": "string",
67-
"allowedValues": [
68-
"Device",
69-
"ForeignGroup",
70-
"Group",
71-
"ServicePrincipal",
72-
"User"
73-
],
74-
"nullable": true,
75-
"metadata": {
76-
"description": "Optional. The principal type of the assigned principal ID."
77-
}
78-
},
79-
"description": {
80-
"type": "string",
81-
"nullable": true,
82-
"metadata": {
83-
"description": "Optional. The description of the role assignment."
84-
}
85-
},
86-
"condition": {
87-
"type": "string",
88-
"nullable": true,
89-
"metadata": {
90-
"description": "Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase \"foo_storage_container\"."
91-
}
92-
},
93-
"conditionVersion": {
94-
"type": "string",
95-
"allowedValues": [
96-
"2.0"
97-
],
98-
"nullable": true,
99-
"metadata": {
100-
"description": "Optional. Version of the condition."
101-
}
102-
},
103-
"delegatedManagedIdentityResourceId": {
104-
"type": "string",
105-
"nullable": true,
106-
"metadata": {
107-
"description": "Optional. The Resource Id of the delegated managed identity resource."
108-
}
47+
"type": "object",
48+
"properties": {
49+
"name": {
50+
"type": "string",
51+
"nullable": true,
52+
"metadata": {
53+
"description": "Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated."
54+
}
55+
},
56+
"roleDefinitionIdOrName": {
57+
"type": "string",
58+
"metadata": {
59+
"description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
60+
}
61+
},
62+
"principalId": {
63+
"type": "string",
64+
"metadata": {
65+
"description": "Required. The principal ID of the principal (user/group/identity) to assign the role to."
66+
}
67+
},
68+
"principalType": {
69+
"type": "string",
70+
"allowedValues": [
71+
"Device",
72+
"ForeignGroup",
73+
"Group",
74+
"ServicePrincipal",
75+
"User"
76+
],
77+
"nullable": true,
78+
"metadata": {
79+
"description": "Optional. The principal type of the assigned principal ID."
80+
}
81+
},
82+
"description": {
83+
"type": "string",
84+
"nullable": true,
85+
"metadata": {
86+
"description": "Optional. The description of the role assignment."
87+
}
88+
},
89+
"condition": {
90+
"type": "string",
91+
"nullable": true,
92+
"metadata": {
93+
"description": "Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase \"foo_storage_container\"."
94+
}
95+
},
96+
"conditionVersion": {
97+
"type": "string",
98+
"allowedValues": [
99+
"2.0"
100+
],
101+
"nullable": true,
102+
"metadata": {
103+
"description": "Optional. Version of the condition."
104+
}
105+
},
106+
"delegatedManagedIdentityResourceId": {
107+
"type": "string",
108+
"nullable": true,
109+
"metadata": {
110+
"description": "Optional. The Resource Id of the delegated managed identity resource."
109111
}
110112
}
111113
},
112-
"nullable": true
114+
"metadata": {
115+
"description": "An AVM-aligned type for a role assignment.",
116+
"__bicep_imported_from!": {
117+
"sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.4.1"
118+
}
119+
}
113120
}
114121
},
115122
"parameters": {
@@ -128,12 +135,17 @@
128135
},
129136
"lock": {
130137
"$ref": "#/definitions/lockType",
138+
"nullable": true,
131139
"metadata": {
132140
"description": "Optional. The lock settings of the service."
133141
}
134142
},
135143
"roleAssignments": {
136-
"$ref": "#/definitions/roleAssignmentType",
144+
"type": "array",
145+
"items": {
146+
"$ref": "#/definitions/roleAssignmentType"
147+
},
148+
"nullable": true,
137149
"metadata": {
138150
"description": "Optional. Array of role assignments to create."
139151
}
@@ -209,8 +221,8 @@
209221
"metadata": {
210222
"_generator": {
211223
"name": "bicep",
212-
"version": "0.29.47.4906",
213-
"templateHash": "16740360506283584978"
224+
"version": "0.32.4.45862",
225+
"templateHash": "1203907446887412297"
214226
}
215227
},
216228
"definitions": {
@@ -295,8 +307,8 @@
295307
"metadata": {
296308
"_generator": {
297309
"name": "bicep",
298-
"version": "0.29.47.4906",
299-
"templateHash": "10992477577200576081"
310+
"version": "0.32.4.45862",
311+
"templateHash": "6029968255804453751"
300312
}
301313
},
302314
"definitions": {

avm/res/resources/resource-group/tests/e2e/defaults/main.test.bicep

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ module testDeployment '../../../main.bicep' = [
2626
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
2727
params: {
2828
name: 'avm-${namePrefix}-resources.resourcegroups-${serviceShort}-rg'
29-
location: resourceLocation
3029
}
3130
}
3231
]

avm/res/resources/resource-group/tests/e2e/waf-aligned/main.test.bicep

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@ param namePrefix string = '#_namePrefix_#'
2323
module testDeployment '../../../main.bicep' = {
2424
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}'
2525
params: {
26-
location: resourceLocation
2726
name: 'avm-${namePrefix}-resources.resourcegroups-${serviceShort}-rg'
28-
lock: {
29-
kind: 'CanNotDelete'
30-
name: 'myCustomLockName'
31-
}
3227
tags: {
3328
'hidden-title': 'This is visible in the resource name'
3429
Environment: 'Non-Prod'

0 commit comments

Comments
 (0)