Skip to content

Commit

Permalink
feat: Updated avm/res/automation/automation-account to use the newe…
Browse files Browse the repository at this point in the history
…st solution module (Azure#3683)

## Description

Updated the module to use the newest version of the cross-referenced
module `br/public:avm/res/operations-management/solution:0.3.0`.

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.automation.automation-account](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.automation.automation-account.yml/badge.svg?branch=users%2Fkrbar%2FautomationAccountUpdate)](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.automation.automation-account.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.
- [x] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [x] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation

## Checklist

- [x] I'm sure there are no other open Pull Requests for the same
update/change
- [x] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [x] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->
  • Loading branch information
krbar authored Nov 6, 2024
1 parent a82f1b0 commit de5cf39
Show file tree
Hide file tree
Showing 6 changed files with 236 additions and 79 deletions.
103 changes: 83 additions & 20 deletions avm/res/automation/automation-account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,11 @@ module automationAccount 'br/public:avm/res/automation/automation-account:<versi
disableLocalAuth: true
gallerySolutions: [
{
name: 'Updates'
product: 'OMSGallery'
publisher: 'Microsoft'
name: '<name>'
plan: {
product: 'OMSGallery/Updates'
publisher: 'Microsoft'
}
}
]
jobSchedules: [
Expand Down Expand Up @@ -507,9 +509,11 @@ module automationAccount 'br/public:avm/res/automation/automation-account:<versi
"gallerySolutions": {
"value": [
{
"name": "Updates",
"product": "OMSGallery",
"publisher": "Microsoft"
"name": "<name>",
"plan": {
"product": "OMSGallery/Updates",
"publisher": "Microsoft"
}
}
]
},
Expand Down Expand Up @@ -784,9 +788,11 @@ param diagnosticSettings = [
param disableLocalAuth = true
param gallerySolutions = [
{
name: 'Updates'
product: 'OMSGallery'
publisher: 'Microsoft'
name: '<name>'
plan: {
product: 'OMSGallery/Updates'
publisher: 'Microsoft'
}
}
]
param jobSchedules = [
Expand Down Expand Up @@ -1025,9 +1031,10 @@ module automationAccount 'br/public:avm/res/automation/automation-account:<versi
disableLocalAuth: true
gallerySolutions: [
{
name: 'Updates'
product: 'OMSGallery'
publisher: 'Microsoft'
name: '<name>'
plan: {
product: 'OMSGallery/Updates'
}
}
]
jobSchedules: [
Expand Down Expand Up @@ -1235,9 +1242,10 @@ module automationAccount 'br/public:avm/res/automation/automation-account:<versi
"gallerySolutions": {
"value": [
{
"name": "Updates",
"product": "OMSGallery",
"publisher": "Microsoft"
"name": "<name>",
"plan": {
"product": "OMSGallery/Updates"
}
}
]
},
Expand Down Expand Up @@ -1461,9 +1469,10 @@ param diagnosticSettings = [
param disableLocalAuth = true
param gallerySolutions = [
{
name: 'Updates'
product: 'OMSGallery'
publisher: 'Microsoft'
name: '<name>'
plan: {
product: 'OMSGallery/Updates'
}
}
]
param jobSchedules = [
Expand Down Expand Up @@ -1946,7 +1955,61 @@ List of gallerySolutions to be created in the linked log analytics workspace.

- Required: No
- Type: array
- Default: `[]`

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`name`](#parameter-gallerysolutionsname) | string | Name of the solution.<p>For solutions authored by Microsoft, the name must be in the pattern: `SolutionType(WorkspaceName)`, for example: `AntiMalware(contoso-Logs)`.<p>For solutions authored by third parties, the name should be in the pattern: `SolutionType[WorkspaceName]`, for example `MySolution[contoso-Logs]`.<p>The solution type is case-sensitive. |
| [`plan`](#parameter-gallerysolutionsplan) | object | Plan for solution object supported by the OperationsManagement resource provider. |

### Parameter: `gallerySolutions.name`

Name of the solution.<p>For solutions authored by Microsoft, the name must be in the pattern: `SolutionType(WorkspaceName)`, for example: `AntiMalware(contoso-Logs)`.<p>For solutions authored by third parties, the name should be in the pattern: `SolutionType[WorkspaceName]`, for example `MySolution[contoso-Logs]`.<p>The solution type is case-sensitive.

- Required: Yes
- Type: string

### Parameter: `gallerySolutions.plan`

Plan for solution object supported by the OperationsManagement resource provider.

- Required: Yes
- Type: object

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`product`](#parameter-gallerysolutionsplanproduct) | string | The product name of the deployed solution.<p>For Microsoft published gallery solution it should be `OMSGallery/{solutionType}`, for example `OMSGallery/AntiMalware`.<p>For a third party solution, it can be anything.<p>This is case sensitive. |

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`name`](#parameter-gallerysolutionsplanname) | string | Name of the solution to be created.<p>For solutions authored by Microsoft, the name must be in the pattern: `SolutionType(WorkspaceName)`, for example: `AntiMalware(contoso-Logs)`.<p>For solutions authored by third parties, it can be anything.<p>The solution type is case-sensitive.<p>If not provided, the value of the `name` parameter will be used. |
| [`publisher`](#parameter-gallerysolutionsplanpublisher) | string | The publisher name of the deployed solution. For Microsoft published gallery solution, it is `Microsoft`, which is the default value. |

### Parameter: `gallerySolutions.plan.product`

The product name of the deployed solution.<p>For Microsoft published gallery solution it should be `OMSGallery/{solutionType}`, for example `OMSGallery/AntiMalware`.<p>For a third party solution, it can be anything.<p>This is case sensitive.

- Required: Yes
- Type: string

### Parameter: `gallerySolutions.plan.name`

Name of the solution to be created.<p>For solutions authored by Microsoft, the name must be in the pattern: `SolutionType(WorkspaceName)`, for example: `AntiMalware(contoso-Logs)`.<p>For solutions authored by third parties, it can be anything.<p>The solution type is case-sensitive.<p>If not provided, the value of the `name` parameter will be used.

- Required: No
- Type: string

### Parameter: `gallerySolutions.plan.publisher`

The publisher name of the deployed solution. For Microsoft published gallery solution, it is `Microsoft`, which is the default value.

- Required: No
- Type: string

### Parameter: `jobSchedules`

Expand Down Expand Up @@ -2650,7 +2713,7 @@ This section gives you an overview of all local-referenced module files (i.e., o
| Reference | Type |
| :-- | :-- |
| `br/public:avm/res/network/private-endpoint:0.7.1` | Remote reference |
| `br/public:avm/res/operations-management/solution:0.1.3` | Remote reference |
| `br/public:avm/res/operations-management/solution:0.3.0` | Remote reference |
| `br/public:avm/utl/types/avm-common-types:0.2.1` | Remote reference |

## Data Collection
Expand Down
23 changes: 18 additions & 5 deletions avm/res/automation/automation-account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ param variables array = []
param linkedWorkspaceResourceId string = ''

@description('Optional. List of gallerySolutions to be created in the linked log analytics workspace.')
param gallerySolutions array = []
param gallerySolutions gallerySolutionType[]?

@description('Optional. List of softwareUpdateConfigurations to be created in the automation account.')
param softwareUpdateConfigurations array = []
Expand Down Expand Up @@ -323,15 +323,14 @@ module automationAccount_linkedService 'modules/linked-service.bicep' = if (!emp
)
}

module automationAccount_solutions 'br/public:avm/res/operations-management/solution:0.1.3' = [
for (gallerySolution, index) in gallerySolutions: if (!empty(linkedWorkspaceResourceId)) {
module automationAccount_solutions 'br/public:avm/res/operations-management/solution:0.3.0' = [
for (gallerySolution, index) in gallerySolutions ?? []: if (!empty(linkedWorkspaceResourceId)) {
name: '${uniqueString(deployment().name, location)}-AutoAccount-Solution-${index}'
params: {
name: gallerySolution.name
location: location
logAnalyticsWorkspaceName: last(split(linkedWorkspaceResourceId, '/'))!
product: gallerySolution.?product
publisher: gallerySolution.?publisher
plan: gallerySolution.plan
enableTelemetry: enableTelemetry
}
// This is to support solution to law in different subscription and resource group than the automation account.
Expand Down Expand Up @@ -550,3 +549,17 @@ type credentialType = {
@sys.description('Optional. Description of the credential.')
description: string?
}

import { solutionPlanType } from 'br/public:avm/res/operations-management/solution:0.3.0'

@export()
type gallerySolutionType = {
@description('''Required. Name of the solution.
For solutions authored by Microsoft, the name must be in the pattern: `SolutionType(WorkspaceName)`, for example: `AntiMalware(contoso-Logs)`.
For solutions authored by third parties, the name should be in the pattern: `SolutionType[WorkspaceName]`, for example `MySolution[contoso-Logs]`.
The solution type is case-sensitive.''')
name: string

@description('Required. Plan for solution object supported by the OperationsManagement resource provider.')
plan: solutionPlanType
}
Loading

0 comments on commit de5cf39

Please sign in to comment.