Skip to content

Commit

Permalink
Merge branch 'Azure:main' into userassignedidentity
Browse files Browse the repository at this point in the history
  • Loading branch information
elanzel authored Nov 23, 2023
2 parents 25746b5 + 4948e8f commit 5f6d23c
Show file tree
Hide file tree
Showing 18 changed files with 2,581 additions and 17 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/avm.res.event-grid.system-topic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: "avm.res.event-grid.system-topic"

on:
schedule:
- cron: "0 12 1/15 * *" # Bi-Weekly Test (on 1st & 15th of month)
workflow_dispatch:
inputs:
staticValidation:
type: boolean
description: "Execute static validation"
required: false
default: true
deploymentValidation:
type: boolean
description: "Execute deployment validation"
required: false
default: true
removeDeployment:
type: boolean
description: "Remove deployed module"
required: false
default: true

push:
branches:
- main
paths:
- ".github/actions/templates/avm-**"
- ".github/workflows/avm.template.module.yml"
- ".github/workflows/avm.res.event-grid.system-topic.yml"
- "avm/res/event-grid/system-topic/**"
- "avm/utilities/pipelines/**"
- "!*/**/README.md"

env:
modulePath: "avm/res/event-grid/system-topic"
workflowPath: ".github/workflows/avm.res.event-grid.system-topic.yml"

concurrency:
group: ${{ github.workflow }}

jobs:
###########################
# Initialize pipeline #
###########################
job_initialize_pipeline:
runs-on: ubuntu-20.04
name: "Initialize pipeline"
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Set input parameters to output variables"
id: get-workflow-param
uses: ./.github/actions/templates/avm-getWorkflowInput
with:
workflowPath: "${{ env.workflowPath}}"
- name: "Get parameter file paths"
id: get-module-test-file-paths
uses: ./.github/actions/templates/avm-getModuleTestFiles
with:
modulePath: "${{ env.modulePath }}"
outputs:
workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }}
moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }}
modulePath: "${{ env.modulePath }}"

##############################
# Call reusable workflow #
##############################
call-workflow-passing-data:
name: "Module"
needs:
- job_initialize_pipeline
uses: ./.github/workflows/avm.template.module.yml
with:
workflowInput: "${{ needs.job_initialize_pipeline.outputs.workflowInput }}"
moduleTestFilePaths: "${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}"
modulePath: "${{ needs.job_initialize_pipeline.outputs.modulePath}}"
secrets: inherit
11 changes: 7 additions & 4 deletions avm/res/event-grid/domain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The following section provides usage examples for the module, which were used to
- [Using only defaults](#example-1-using-only-defaults)
- [Using large parameter set](#example-2-using-large-parameter-set)
- [Using private endpoint](#example-3-using-private-endpoint)
- [Using large parameter set](#example-4-using-large-parameter-set)
- [WAF-aligned](#example-4-waf-aligned)

### Example 1: _Using only defaults_

Expand All @@ -53,6 +53,7 @@ module domain 'br/public:avm/res/event-grid/domain:<version>' = {
// Non-required parameters
location: '<location>'
managedIdentities: '<managedIdentities>'
privateEndpoints: '<privateEndpoints>'
}
}
```
Expand All @@ -79,6 +80,9 @@ module domain 'br/public:avm/res/event-grid/domain:<version>' = {
},
"managedIdentities": {
"value": "<managedIdentities>"
},
"privateEndpoints": {
"value": "<privateEndpoints>"
}
}
}
Expand Down Expand Up @@ -343,9 +347,9 @@ module domain 'br/public:avm/res/event-grid/domain:<version>' = {
</details>
<p>

### Example 4: _Using large parameter set_
### Example 4: _WAF-aligned_

This instance deploys the module with most of its features enabled.
This instance deploys the module in alignment with the best-practices of the Azure Well-Architected Framework.


<details>
Expand Down Expand Up @@ -1021,7 +1025,6 @@ Tags of the resource.
The topic names which are associated with the domain.
- Required: No
- Type: array
- Default: `[]`


## Outputs
Expand Down
5 changes: 2 additions & 3 deletions avm/res/event-grid/domain/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ param tags object?
param enableTelemetry bool = true

@description('Optional. The topic names which are associated with the domain.')
param topics array = []
param topics array?

@description('Optional. The managed identity definition for this resource.')
param managedIdentities managedIdentitiesType
Expand Down Expand Up @@ -103,7 +103,7 @@ resource domain 'Microsoft.EventGrid/domains@2023-06-01-preview' = {
}
}

module domain_topics 'topic/main.bicep' = [for (topic, index) in topics: {
module domain_topics 'topic/main.bicep' = [for (topic, index) in (topics ?? []): {
name: '${uniqueString(deployment().name, location)}-topics-${index}'
params: {
domainName: domain.name
Expand Down Expand Up @@ -198,7 +198,6 @@ output location string = domain.location
@description('The principal ID of the system assigned identity.')
output systemAssignedMIPrincipalId string = (managedIdentities.?systemAssigned ?? false) && contains(domain.identity, 'principalId') ? domain.identity.principalId : ''


// =============== //
// Definitions //
// =============== //
Expand Down
8 changes: 4 additions & 4 deletions avm/res/event-grid/domain/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": "14065805912865127191"
"templateHash": "4425094317153715056"
},
"name": "Event Grid Domains",
"description": "This module deploys an Event Grid Domain.",
Expand Down Expand Up @@ -496,7 +496,7 @@
},
"topics": {
"type": "array",
"defaultValue": [],
"nullable": true,
"metadata": {
"description": "Optional. The topic names which are associated with the domain."
}
Expand Down Expand Up @@ -628,7 +628,7 @@
"domain_topics": {
"copy": {
"name": "domain_topics",
"count": "[length(parameters('topics'))]"
"count": "[length(coalesce(parameters('topics'), createArray()))]"
},
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
Expand All @@ -643,7 +643,7 @@
"value": "[parameters('name')]"
},
"name": {
"value": "[parameters('topics')[copyIndex()]]"
"value": "[coalesce(parameters('topics'), createArray())[copyIndex()]]"
}
},
"template": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
targetScope = 'subscription'

metadata name = 'Using large parameter set'
metadata description = 'This instance deploys the module with most of its features enabled.'
metadata name = 'WAF-aligned'
metadata description = 'This instance deploys the module in alignment with the best-practices of the Azure Well-Architected Framework.'

// ========== //
// Parameters //
Expand Down Expand Up @@ -108,7 +108,3 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
]
}
}]




Loading

0 comments on commit 5f6d23c

Please sign in to comment.