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

fix: avm.res.virtual-machine-images.image-template upgrade common types to latest and update type to not nullable to fix failing static validation #3663

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
96 changes: 48 additions & 48 deletions avm/res/virtual-machine-images/image-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ module imageTemplate 'br/public:avm/res/virtual-machine-images/image-template:<v
type: 'PlatformImage'
version: 'latest'
}
name: 'vmiitmin001'
// Non-required parameters
location: '<location>'
managedIdentities: {
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
name: 'vmiitmin001'
// Non-required parameters
location: '<location>'
}
}
```
Expand Down Expand Up @@ -100,19 +100,19 @@ module imageTemplate 'br/public:avm/res/virtual-machine-images/image-template:<v
"version": "latest"
}
},
"name": {
"value": "vmiitmin001"
},
// Non-required parameters
"location": {
"value": "<location>"
},
"managedIdentities": {
"value": {
"userAssignedResourceIds": [
"<managedIdentityResourceId>"
]
}
},
"name": {
"value": "vmiitmin001"
},
// Non-required parameters
"location": {
"value": "<location>"
}
}
}
Expand Down Expand Up @@ -142,14 +142,14 @@ param imageSource = {
type: 'PlatformImage'
version: 'latest'
}
param name = 'vmiitmin001'
// Non-required parameters
param location = '<location>'
param managedIdentities = {
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
param name = 'vmiitmin001'
// Non-required parameters
param location = '<location>'
```

</details>
Expand Down Expand Up @@ -194,6 +194,11 @@ module imageTemplate 'br/public:avm/res/virtual-machine-images/image-template:<v
type: 'PlatformImage'
version: 'latest'
}
managedIdentities: {
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
name: 'vmiitmax001'
// Non-required parameters
buildTimeoutInMinutes: 60
Expand Down Expand Up @@ -222,11 +227,6 @@ module imageTemplate 'br/public:avm/res/virtual-machine-images/image-template:<v
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
managedIdentities: {
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
optimizeVmBoot: 'Enabled'
osDiskSizeGB: 127
roleAssignments: [
Expand Down Expand Up @@ -318,6 +318,13 @@ module imageTemplate 'br/public:avm/res/virtual-machine-images/image-template:<v
"version": "latest"
}
},
"managedIdentities": {
"value": {
"userAssignedResourceIds": [
"<managedIdentityResourceId>"
]
}
},
"name": {
"value": "vmiitmax001"
},
Expand Down Expand Up @@ -356,13 +363,6 @@ module imageTemplate 'br/public:avm/res/virtual-machine-images/image-template:<v
"name": "myCustomLockName"
}
},
"managedIdentities": {
"value": {
"userAssignedResourceIds": [
"<managedIdentityResourceId>"
]
}
},
"optimizeVmBoot": {
"value": "Enabled"
},
Expand Down Expand Up @@ -466,6 +466,11 @@ param imageSource = {
type: 'PlatformImage'
version: 'latest'
}
param managedIdentities = {
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
param name = 'vmiitmax001'
// Non-required parameters
param buildTimeoutInMinutes = 60
Expand Down Expand Up @@ -494,11 +499,6 @@ param lock = {
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
param managedIdentities = {
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
param optimizeVmBoot = 'Enabled'
param osDiskSizeGB = 127
param roleAssignments = [
Expand Down Expand Up @@ -576,6 +576,11 @@ module imageTemplate 'br/public:avm/res/virtual-machine-images/image-template:<v
type: 'PlatformImage'
version: 'latest'
}
managedIdentities: {
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
name: 'vmiitwaf001'
// Non-required parameters
customizationSteps: [
Expand All @@ -585,11 +590,6 @@ module imageTemplate 'br/public:avm/res/virtual-machine-images/image-template:<v
}
]
location: '<location>'
managedIdentities: {
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
subnetResourceId: '<subnetResourceId>'
tags: {
Environment: 'Non-Prod'
Expand Down Expand Up @@ -630,6 +630,13 @@ module imageTemplate 'br/public:avm/res/virtual-machine-images/image-template:<v
"version": "latest"
}
},
"managedIdentities": {
"value": {
"userAssignedResourceIds": [
"<managedIdentityResourceId>"
]
}
},
"name": {
"value": "vmiitwaf001"
},
Expand All @@ -645,13 +652,6 @@ module imageTemplate 'br/public:avm/res/virtual-machine-images/image-template:<v
"location": {
"value": "<location>"
},
"managedIdentities": {
"value": {
"userAssignedResourceIds": [
"<managedIdentityResourceId>"
]
}
},
"subnetResourceId": {
"value": "<subnetResourceId>"
},
Expand Down Expand Up @@ -690,6 +690,11 @@ param imageSource = {
type: 'PlatformImage'
version: 'latest'
}
param managedIdentities = {
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
param name = 'vmiitwaf001'
// Non-required parameters
param customizationSteps = [
Expand All @@ -699,11 +704,6 @@ param customizationSteps = [
}
]
param location = '<location>'
param managedIdentities = {
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
param subnetResourceId = '<subnetResourceId>'
param tags = {
Environment: 'Non-Prod'
Expand Down Expand Up @@ -769,7 +769,7 @@ Image source definition in object format.

The managed identity definition for this resource.

- Required: No
- Required: Yes
- Type: object

**Optional parameters**
Expand Down
8 changes: 4 additions & 4 deletions avm/res/virtual-machine-images/image-template/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ param customizationSteps array?
@description('Optional. Resource ID of the staging resource group in the same subscription and location as the image template that will be used to build the image.</p>If this field is empty, a resource group with a random name will be created.</p>If the resource group specified in this field doesn\'t exist, it will be created with the same name.</p>If the resource group specified exists, it must be empty and in the same region as the image template.</p>The resource group created will be deleted during template deletion if this field is empty or the resource group specified doesn\'t exist,</p>but if the resource group specified exists the resources created in the resource group will be deleted during template deletion and the resource group itself will remain.')
param stagingResourceGroupResourceId string?

import { lockType } from 'br/public:avm/utl/types/avm-common-types:0.2.0'
import { lockType } from 'br/public:avm/utl/types/avm-common-types:0.2.1'
@description('Optional. The lock settings of the service.')
param lock lockType?

Expand All @@ -44,7 +44,7 @@ param baseTime string = utcNow('yyyy-MM-dd-HH-mm-ss')
@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

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

Expand All @@ -54,9 +54,9 @@ param distributions distributionType[]
@description('Optional. List of User-Assigned Identities associated to the Build VM for accessing Azure resources such as Key Vaults from your customizer scripts. Be aware, the user assigned identities specified in the \'managedIdentities\' parameter must have the \'Managed Identity Operator\' role assignment on all the user assigned identities specified in this parameter for Azure Image Builder to be able to associate them to the build VM.')
param vmUserAssignedIdentities array = []

import { managedIdentityOnlyUserAssignedType } from 'br/public:avm/utl/types/avm-common-types:0.2.0'
import { managedIdentityOnlyUserAssignedType } from 'br/public:avm/utl/types/avm-common-types:0.2.1'
@description('Required. The managed identity definition for this resource.')
param managedIdentities managedIdentityOnlyUserAssignedType?
param managedIdentities managedIdentityOnlyUserAssignedType

@description('Optional. Configuration options and list of validations to be performed on the resulting image.')
param validationProcess validationProcessType?
Expand Down
9 changes: 4 additions & 5 deletions avm/res/virtual-machine-images/image-template/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "11745682874369411361"
"templateHash": "9021236296601587261"
},
"name": "Virtual Machine Image Templates",
"description": "This module deploys a Virtual Machine Image Template that can be consumed by Azure Image Builder (AIB).",
Expand Down Expand Up @@ -333,7 +333,7 @@
"metadata": {
"description": "An AVM-aligned type for a lock.",
"__bicep_imported_from!": {
"sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.2.0"
"sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.2.1"
}
}
},
Expand All @@ -354,7 +354,7 @@
"metadata": {
"description": "An AVM-aligned type for a managed identity configuration. To be used if only user-assigned identities are supported by the resource provider.",
"__bicep_imported_from!": {
"sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.2.0"
"sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.2.1"
}
}
},
Expand Down Expand Up @@ -429,7 +429,7 @@
"metadata": {
"description": "An AVM-aligned type for a role assignment.",
"__bicep_imported_from!": {
"sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.2.0"
"sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.2.1"
}
}
}
Expand Down Expand Up @@ -554,7 +554,6 @@
},
"managedIdentities": {
"$ref": "#/definitions/managedIdentityOnlyUserAssignedType",
"nullable": true,
"metadata": {
"description": "Required. The managed identity definition for this resource."
}
Expand Down