Skip to content

Commit

Permalink
fix: Removed excess 's' from MI UDT definition (#627)
Browse files Browse the repository at this point in the history
## Description

<!--Why this PR? What is changed? What is the effect? etc.-->

- Fixed typo in the UDT of Managed Identities
- Updated affected modules accordingly
- Regenerated all JSON templates & readmes

## Updating an existing module

<!--Run through the checklist if your PR updates an existing module.-->

- [x] This is a bug fix:
- [ ] 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.
- [ ] I have run `brm validate` locally to verify the module files.
- [x] I have run deployment tests locally to ensure the module is
deployable.
- [ ] I have read the [Updating an existing
module](https://github.com/Azure/bicep-registry-modules/blob/main/CONTRIBUTING.md#updating-an-existing-module)
section in the contributing guide and updated the `version.json` file
properly:
- [ ] The PR contains backwards compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`.
- [ ] The PR contains backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] The PR contains breaking changes, and I have bumped the MAJOR
version in `version.json`.
- [ ] I have updated the examples in README with the latest module
version number.

### Pipeline references
<!-- For module/pipeline changes, please create and attach the status
badge of your successful run. -->

| Pipeline |
| - |
|
[![avm.res.batch.batch-account](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.batch.batch-account.yml/badge.svg?branch=users%2Fkrbar%2FidentityUDTfix)](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.batch.batch-account.yml)
|
|
[![avm.res.cognitive-services.account](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.cognitive-services.account.yml/badge.svg?branch=users%2Fkrbar%2FidentityUDTfix)](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.cognitive-services.account.yml)
|
|
[![avm.res.logic.workflow](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.logic.workflow.yml/badge.svg?branch=users%2Fkrbar%2FidentityUDTfix)](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.logic.workflow.yml)
|
|
[![avm.res.operational-insights.workspace](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.operational-insights.workspace.yml/badge.svg?branch=users%2Fkrbar%2FidentityUDTfix)](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.operational-insights.workspace.yml)
- error is unrelated to the PR |
  • Loading branch information
krbar authored Nov 14, 2023
1 parent 0ea942e commit d8f7136
Show file tree
Hide file tree
Showing 23 changed files with 63 additions and 63 deletions.
8 changes: 4 additions & 4 deletions avm/res/batch/batch-account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ module batchAccount 'br/public:avm/res/batch/batch-account:<version>' = {
}
location: '<location>'
managedIdentities: {
userAssignedResourcesIds: [
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
Expand Down Expand Up @@ -202,7 +202,7 @@ module batchAccount 'br/public:avm/res/batch/batch-account:<version>' = {
},
"managedIdentities": {
"value": {
"userAssignedResourcesIds": [
"userAssignedResourceIds": [
"<managedIdentityResourceId>"
]
}
Expand Down Expand Up @@ -843,7 +843,7 @@ The managed identity definition for this resource.
| Name | Required | Type | Description |
| :-- | :-- | :--| :-- |
| [`systemAssigned`](#parameter-managedidentitiessystemassigned) | No | bool | Optional. Enables system assigned managed identity on the resource. |
| [`userAssignedResourcesIds`](#parameter-managedidentitiesuserassignedresourcesids) | No | array | Optional. The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption. |
| [`userAssignedResourceIds`](#parameter-managedidentitiesuserassignedresourceids) | No | array | Optional. The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption. |

### Parameter: `managedIdentities.systemAssigned`

Expand All @@ -852,7 +852,7 @@ Optional. Enables system assigned managed identity on the resource.
- Required: No
- Type: bool

### Parameter: `managedIdentities.userAssignedResourcesIds`
### Parameter: `managedIdentities.userAssignedResourceIds`

Optional. The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption.

Expand Down
6 changes: 3 additions & 3 deletions avm/res/batch/batch-account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ param customerManagedKey customerManagedKeyType
@description('Optional. The managed identity definition for this resource.')
param managedIdentities managedIdentitiesType

var formattedUserAssignedIdentities = reduce(map((managedIdentities.?userAssignedResourcesIds ?? []), (id) => { '${id}': {} }), {}, (cur, next) => union(cur, next)) // Converts the flat array to an object like { '${id1}': {}, '${id2}': {} }
var formattedUserAssignedIdentities = reduce(map((managedIdentities.?userAssignedResourceIds ?? []), (id) => { '${id}': {} }), {}, (cur, next) => union(cur, next)) // Converts the flat array to an object like { '${id1}': {}, '${id2}': {} }
var identity = !empty(managedIdentities) ? {
type: (managedIdentities.?systemAssigned ?? false) ? 'SystemAssigned' : (!empty(managedIdentities.?userAssignedResourcesIds ?? {}) ? 'UserAssigned' : null)
type: (managedIdentities.?systemAssigned ?? false) ? 'SystemAssigned' : (!empty(managedIdentities.?userAssignedResourceIds ?? {}) ? 'UserAssigned' : null)
userAssignedIdentities: !empty(formattedUserAssignedIdentities) ? formattedUserAssignedIdentities : null
} : null

Expand Down Expand Up @@ -382,7 +382,7 @@ type managedIdentitiesType = {
systemAssigned: bool?

@description('Optional. The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption.')
userAssignedResourcesIds: string[]?
userAssignedResourceIds: string[]?
}?

type customerManagedKeyType = {
Expand Down
8 changes: 4 additions & 4 deletions avm/res/batch/batch-account/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
"templateHash": "5985605470006145752"
"templateHash": "11850231744835953417"
},
"name": "Batch Accounts",
"description": "This module deploys a Batch Account.",
Expand Down Expand Up @@ -345,7 +345,7 @@
"description": "Optional. Enables system assigned managed identity on the resource."
}
},
"userAssignedResourcesIds": {
"userAssignedResourceIds": {
"type": "array",
"items": {
"type": "string"
Expand Down Expand Up @@ -609,8 +609,8 @@
}
}
],
"formattedUserAssignedIdentities": "[reduce(map(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourcesIds'), createArray()), lambda('id', createObject(format('{0}', lambdaVariables('id')), createObject()))), createObject(), lambda('cur', 'next', union(lambdaVariables('cur'), lambdaVariables('next'))))]",
"identity": "[if(not(empty(parameters('managedIdentities'))), createObject('type', if(coalesce(tryGet(parameters('managedIdentities'), 'systemAssigned'), false()), 'SystemAssigned', if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourcesIds'), createObject()))), 'UserAssigned', null())), 'userAssignedIdentities', if(not(empty(variables('formattedUserAssignedIdentities'))), variables('formattedUserAssignedIdentities'), null())), null())]",
"formattedUserAssignedIdentities": "[reduce(map(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createArray()), lambda('id', createObject(format('{0}', lambdaVariables('id')), createObject()))), createObject(), lambda('cur', 'next', union(lambdaVariables('cur'), lambdaVariables('next'))))]",
"identity": "[if(not(empty(parameters('managedIdentities'))), createObject('type', if(coalesce(tryGet(parameters('managedIdentities'), 'systemAssigned'), false()), 'SystemAssigned', if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createObject()))), 'UserAssigned', null())), 'userAssignedIdentities', if(not(empty(variables('formattedUserAssignedIdentities'))), variables('formattedUserAssignedIdentities'), null())), null())]",
"builtInRoleNames": {
"Contributor": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')]",
"Owner": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')]",
Expand Down
2 changes: 1 addition & 1 deletion avm/res/batch/batch-account/tests/e2e/encr/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
poolAllocationMode: 'BatchService'
storageAuthenticationMode: 'BatchAccountManagedIdentity'
managedIdentities: {
userAssignedResourcesIds: [
userAssignedResourceIds: [
nestedDependencies.outputs.managedIdentityResourceId
]
}
Expand Down
2 changes: 1 addition & 1 deletion avm/res/batch/batch-account/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
"version": "0.2",
"version": "0.3",
"pathFilters": [
"./main.json"
]
Expand Down
16 changes: 8 additions & 8 deletions avm/res/cognitive-services/account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ module account 'br/public:avm/res/cognitive-services/account:<version>' = {
}
managedIdentities: {
systemAssigned: true
userAssignedResourcesIds: [
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
Expand Down Expand Up @@ -326,7 +326,7 @@ module account 'br/public:avm/res/cognitive-services/account:<version>' = {
"managedIdentities": {
"value": {
"systemAssigned": true,
"userAssignedResourcesIds": [
"userAssignedResourceIds": [
"<managedIdentityResourceId>"
]
}
Expand Down Expand Up @@ -423,7 +423,7 @@ module account 'br/public:avm/res/cognitive-services/account:<version>' = {
lock: '<lock>'
managedIdentities: {
systemAssigned: true
userAssignedResourcesIds: [
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
Expand Down Expand Up @@ -498,7 +498,7 @@ module account 'br/public:avm/res/cognitive-services/account:<version>' = {
"managedIdentities": {
"value": {
"systemAssigned": true,
"userAssignedResourcesIds": [
"userAssignedResourceIds": [
"<managedIdentityResourceId>"
]
}
Expand Down Expand Up @@ -702,7 +702,7 @@ module account 'br/public:avm/res/cognitive-services/account:<version>' = {
location: '<location>'
lock: '<lock>'
managedIdentities: {
userAssignedResourcesIds: [
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
Expand Down Expand Up @@ -766,7 +766,7 @@ module account 'br/public:avm/res/cognitive-services/account:<version>' = {
},
"managedIdentities": {
"value": {
"userAssignedResourcesIds": [
"userAssignedResourceIds": [
"<managedIdentityResourceId>"
]
}
Expand Down Expand Up @@ -1283,7 +1283,7 @@ The managed identity definition for this resource.
| Name | Required | Type | Description |
| :-- | :-- | :--| :-- |
| [`systemAssigned`](#parameter-managedidentitiessystemassigned) | No | bool | Optional. Enables system assigned managed identity on the resource. |
| [`userAssignedResourcesIds`](#parameter-managedidentitiesuserassignedresourcesids) | No | array | Optional. The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption. |
| [`userAssignedResourceIds`](#parameter-managedidentitiesuserassignedresourceids) | No | array | Optional. The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption. |

### Parameter: `managedIdentities.systemAssigned`

Expand All @@ -1292,7 +1292,7 @@ Optional. Enables system assigned managed identity on the resource.
- Required: No
- Type: bool

### Parameter: `managedIdentities.userAssignedResourcesIds`
### Parameter: `managedIdentities.userAssignedResourceIds`

Optional. The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption.

Expand Down
6 changes: 3 additions & 3 deletions avm/res/cognitive-services/account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ param managedIdentities managedIdentitiesType
@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

var formattedUserAssignedIdentities = reduce(map((managedIdentities.?userAssignedResourcesIds ?? []), (id) => { '${id}': {} }), {}, (cur, next) => union(cur, next)) // Converts the flat array to an object like { '${id1}': {}, '${id2}': {} }
var formattedUserAssignedIdentities = reduce(map((managedIdentities.?userAssignedResourceIds ?? []), (id) => { '${id}': {} }), {}, (cur, next) => union(cur, next)) // Converts the flat array to an object like { '${id1}': {}, '${id2}': {} }
var identity = !empty(managedIdentities) ? {
type: (managedIdentities.?systemAssigned ?? false) ? (!empty(managedIdentities.?userAssignedResourcesIds ?? {}) ? 'SystemAssigned,UserAssigned' : 'SystemAssigned') : (!empty(managedIdentities.?userAssignedResourcesIds ?? {}) ? 'UserAssigned' : null)
type: (managedIdentities.?systemAssigned ?? false) ? (!empty(managedIdentities.?userAssignedResourceIds ?? {}) ? 'SystemAssigned,UserAssigned' : 'SystemAssigned') : (!empty(managedIdentities.?userAssignedResourceIds ?? {}) ? 'UserAssigned' : null)
userAssignedIdentities: !empty(formattedUserAssignedIdentities) ? formattedUserAssignedIdentities : null
} : null

Expand Down Expand Up @@ -442,7 +442,7 @@ type managedIdentitiesType = {
systemAssigned: bool?

@description('Optional. The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption.')
userAssignedResourcesIds: string[]?
userAssignedResourceIds: string[]?
}?

type customerManagedKeyType = {
Expand Down
8 changes: 4 additions & 4 deletions avm/res/cognitive-services/account/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
"templateHash": "12255564723872519506"
"templateHash": "6109702100666638123"
},
"name": "Cognitive Services",
"description": "This module deploys a Cognitive Service.",
Expand Down Expand Up @@ -345,7 +345,7 @@
"description": "Optional. Enables system assigned managed identity on the resource."
}
},
"userAssignedResourcesIds": {
"userAssignedResourceIds": {
"type": "array",
"items": {
"type": "string"
Expand Down Expand Up @@ -620,8 +620,8 @@
}
},
"variables": {
"formattedUserAssignedIdentities": "[reduce(map(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourcesIds'), createArray()), lambda('id', createObject(format('{0}', lambdaVariables('id')), createObject()))), createObject(), lambda('cur', 'next', union(lambdaVariables('cur'), lambdaVariables('next'))))]",
"identity": "[if(not(empty(parameters('managedIdentities'))), createObject('type', if(coalesce(tryGet(parameters('managedIdentities'), 'systemAssigned'), false()), if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourcesIds'), createObject()))), 'SystemAssigned,UserAssigned', 'SystemAssigned'), if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourcesIds'), createObject()))), 'UserAssigned', null())), 'userAssignedIdentities', if(not(empty(variables('formattedUserAssignedIdentities'))), variables('formattedUserAssignedIdentities'), null())), null())]",
"formattedUserAssignedIdentities": "[reduce(map(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createArray()), lambda('id', createObject(format('{0}', lambdaVariables('id')), createObject()))), createObject(), lambda('cur', 'next', union(lambdaVariables('cur'), lambdaVariables('next'))))]",
"identity": "[if(not(empty(parameters('managedIdentities'))), createObject('type', if(coalesce(tryGet(parameters('managedIdentities'), 'systemAssigned'), false()), if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createObject()))), 'SystemAssigned,UserAssigned', 'SystemAssigned'), if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createObject()))), 'UserAssigned', null())), 'userAssignedIdentities', if(not(empty(variables('formattedUserAssignedIdentities'))), variables('formattedUserAssignedIdentities'), null())), null())]",
"builtInRoleNames": {
"Cognitive Services Contributor": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '25fbc0a9-bd7c-42a3-aa1a-3b75d497ee68')]",
"Cognitive Services Custom Vision Contributor": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'c1ff6cc2-c111-46fe-8896-e0ef812ad9f3')]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
sku: 'S0'
managedIdentities: {
systemAssigned: true
userAssignedResourcesIds: [
userAssignedResourceIds: [
nestedDependencies.outputs.managedIdentityResourceId
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
sku: 'S0'
managedIdentities: {
systemAssigned: true
userAssignedResourcesIds: [
userAssignedResourceIds: [
nestedDependencies.outputs.managedIdentityResourceId
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
publicNetworkAccess: 'Enabled'
sku: 'S0'
managedIdentities: {
userAssignedResourcesIds: [
userAssignedResourceIds: [
nestedDependencies.outputs.managedIdentityResourceId
]
}
Expand Down
2 changes: 1 addition & 1 deletion avm/res/cognitive-services/account/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
"version": "0.2",
"version": "0.3",
"pathFilters": [
"./main.json"
]
Expand Down
12 changes: 6 additions & 6 deletions avm/res/logic/workflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ module workflow 'br/public:avm/res/logic/workflow:<version>' = {
name: 'myCustomLockName'
}
managedIdentities: {
userAssignedResourcesIds: [
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
Expand Down Expand Up @@ -225,7 +225,7 @@ module workflow 'br/public:avm/res/logic/workflow:<version>' = {
},
"managedIdentities": {
"value": {
"userAssignedResourcesIds": [
"userAssignedResourceIds": [
"<managedIdentityResourceId>"
]
}
Expand Down Expand Up @@ -324,7 +324,7 @@ module workflow 'br/public:avm/res/logic/workflow:<version>' = {
name: 'myCustomLockName'
}
managedIdentities: {
userAssignedResourcesIds: [
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
Expand Down Expand Up @@ -412,7 +412,7 @@ module workflow 'br/public:avm/res/logic/workflow:<version>' = {
},
"managedIdentities": {
"value": {
"userAssignedResourcesIds": [
"userAssignedResourceIds": [
"<managedIdentityResourceId>"
]
}
Expand Down Expand Up @@ -716,7 +716,7 @@ The managed identity definition for this resource. Only one type of identity is
| Name | Required | Type | Description |
| :-- | :-- | :--| :-- |
| [`systemAssigned`](#parameter-managedidentitiessystemassigned) | No | bool | Optional. Enables system assigned managed identity on the resource. |
| [`userAssignedResourcesIds`](#parameter-managedidentitiesuserassignedresourcesids) | No | array | Optional. The resource ID(s) to assign to the resource. |
| [`userAssignedResourceIds`](#parameter-managedidentitiesuserassignedresourceids) | No | array | Optional. The resource ID(s) to assign to the resource. |

### Parameter: `managedIdentities.systemAssigned`

Expand All @@ -725,7 +725,7 @@ Optional. Enables system assigned managed identity on the resource.
- Required: No
- Type: bool

### Parameter: `managedIdentities.userAssignedResourcesIds`
### Parameter: `managedIdentities.userAssignedResourceIds`

Optional. The resource ID(s) to assign to the resource.

Expand Down
6 changes: 3 additions & 3 deletions avm/res/logic/workflow/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ param workflowStaticResults object?
@description('Optional. The definitions for one or more triggers that instantiate your workflow. You can define more than one trigger, but only with the Workflow Definition Language, not visually through the Logic Apps Designer.')
param workflowTriggers object?

var formattedUserAssignedIdentities = reduce(map((managedIdentities.?userAssignedResourcesIds ?? []), (id) => { '${id}': {} }), {}, (cur, next) => union(cur, next)) // Converts the flat array to an object like { '${id1}': {}, '${id2}': {} }
var formattedUserAssignedIdentities = reduce(map((managedIdentities.?userAssignedResourceIds ?? []), (id) => { '${id}': {} }), {}, (cur, next) => union(cur, next)) // Converts the flat array to an object like { '${id1}': {}, '${id2}': {} }

var identity = !empty(managedIdentities) ? {
type: (managedIdentities.?systemAssigned ?? false) ? 'SystemAssigned' : (!empty(managedIdentities.?userAssignedResourcesIds ?? {}) ? 'UserAssigned' : null)
type: (managedIdentities.?systemAssigned ?? false) ? 'SystemAssigned' : (!empty(managedIdentities.?userAssignedResourceIds ?? {}) ? 'UserAssigned' : null)
userAssignedIdentities: !empty(formattedUserAssignedIdentities) ? formattedUserAssignedIdentities : null
} : null

Expand Down Expand Up @@ -270,7 +270,7 @@ type managedIdentitiesType = {
systemAssigned: bool?

@description('Optional. The resource ID(s) to assign to the resource.')
userAssignedResourcesIds: string[]?
userAssignedResourceIds: string[]?
}?

type roleAssignmentType = {
Expand Down
Loading

0 comments on commit d8f7136

Please sign in to comment.