Skip to content

Commit

Permalink
feat: Relay-Namespace - Updated UDTs (#4305)
Browse files Browse the repository at this point in the history
## Description

- Updated relay-namespace to latest UDTs
- Updated PE implementation
- Fixed a small number of missing references in other, recently updated,
modules

## Pipeline Reference

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

| Pipeline |
| -------- |
|
[![avm.res.relay.namespace](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.relay.namespace.yml/badge.svg?branch=users%2Falsehr%2FrelayUdt&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.relay.namespace.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
  • Loading branch information
AlexanderSehr authored Jan 30, 2025
1 parent 28a4a2d commit d0a356d
Show file tree
Hide file tree
Showing 22 changed files with 825 additions and 781 deletions.
2 changes: 1 addition & 1 deletion avm/res/cache/redis/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ output systemAssignedMIPrincipalId string? = redis.?identity.?principalId
output location string = redis.location

@description('The private endpoints of the Redis Cache.')
output privateEndpoints array = [
output privateEndpoints privateEndpointOutputType[] = [
for (pe, i) in (!empty(privateEndpoints) ? array(privateEndpoints) : []): {
name: redis_privateEndpoints[i].outputs.name
resourceId: redis_privateEndpoints[i].outputs.resourceId
Expand Down
5 changes: 4 additions & 1 deletion avm/res/cache/redis/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.33.13.18514",
"templateHash": "14266403126769654218"
"templateHash": "17774807916018865720"
},
"name": "Redis Cache",
"description": "This module deploys a Redis Cache."
Expand Down Expand Up @@ -2252,6 +2252,9 @@
},
"privateEndpoints": {
"type": "array",
"items": {
"$ref": "#/definitions/privateEndpointOutputType"
},
"metadata": {
"description": "The private endpoints of the Redis Cache."
},
Expand Down
2 changes: 1 addition & 1 deletion avm/res/container-registry/registry/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ output credentialSetsResourceIds array = [
]

@description('The private endpoints of the Azure container registry.')
output privateEndpoints array = [
output privateEndpoints privateEndpointOutputType[] = [
for (pe, i) in (!empty(privateEndpoints) ? array(privateEndpoints) : []): {
name: registry_privateEndpoints[i].outputs.name
resourceId: registry_privateEndpoints[i].outputs.resourceId
Expand Down
5 changes: 4 additions & 1 deletion avm/res/container-registry/registry/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.33.13.18514",
"templateHash": "6908828280512036268"
"templateHash": "10147312156773531656"
},
"name": "Azure Container Registries (ACR)",
"description": "This module deploys an Azure Container Registry (ACR)."
Expand Down Expand Up @@ -2720,6 +2720,9 @@
},
"privateEndpoints": {
"type": "array",
"items": {
"$ref": "#/definitions/privateEndpointOutputType"
},
"metadata": {
"description": "The private endpoints of the Azure container registry."
},
Expand Down
2 changes: 1 addition & 1 deletion avm/res/db-for-postgre-sql/flexible-server/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ output location string = flexibleServer.location
output fqdn string = flexibleServer.properties.fullyQualifiedDomainName

@description('The private endpoints of the PostgreSQL Flexible server.')
output privateEndpoints array = [
output privateEndpoints privateEndpointOutputType[] = [
for (pe, i) in (!empty(privateEndpoints) ? array(privateEndpoints) : []): {
name: server_privateEndpoints[i].outputs.name
resourceId: server_privateEndpoints[i].outputs.resourceId
Expand Down
27 changes: 15 additions & 12 deletions avm/res/db-for-postgre-sql/flexible-server/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "5117660498106393139"
"version": "0.33.13.18514",
"templateHash": "12436555269178944742"
},
"name": "DBforPostgreSQL Flexible Servers",
"description": "This module deploys a DBforPostgreSQL Flexible Server."
Expand Down Expand Up @@ -1194,8 +1194,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "15358721384580155368"
"version": "0.33.13.18514",
"templateHash": "12559382321541199726"
},
"name": "DBforPostgreSQL Flexible Server Databases",
"description": "This module deploys a DBforPostgreSQL Flexible Server Database."
Expand Down Expand Up @@ -1307,8 +1307,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "1547810610444554016"
"version": "0.33.13.18514",
"templateHash": "533163168353951900"
},
"name": "DBforPostgreSQL Flexible Server Firewall Rules",
"description": "This module deploys a DBforPostgreSQL Flexible Server Firewall Rule."
Expand Down Expand Up @@ -1416,8 +1416,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "17791142604055425268"
"version": "0.33.13.18514",
"templateHash": "14381841795302215842"
},
"name": "DBforPostgreSQL Flexible Server Configurations",
"description": "This module deploys a DBforPostgreSQL Flexible Server Configuration."
Expand Down Expand Up @@ -1533,8 +1533,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "16643531997327278217"
"version": "0.33.13.18514",
"templateHash": "9438694500506305843"
},
"name": "DBforPostgreSQL Flexible Server Administrators",
"description": "This module deploys a DBforPostgreSQL Flexible Server Administrator."
Expand Down Expand Up @@ -1643,8 +1643,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "6141187485193116497"
"version": "0.33.13.18514",
"templateHash": "17600786812294347393"
},
"name": "DBforPostgreSQL Flexible Server Advanced Threat Protection",
"description": "This module deploys a DBforPostgreSQL Advanced Threat Protection."
Expand Down Expand Up @@ -2508,6 +2508,9 @@
},
"privateEndpoints": {
"type": "array",
"items": {
"$ref": "#/definitions/privateEndpointOutputType"
},
"metadata": {
"description": "The private endpoints of the PostgreSQL Flexible server."
},
Expand Down
28 changes: 6 additions & 22 deletions avm/res/relay/namespace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ This instance deploys the module with the minimum set of required parameters.
module namespace 'br/public:avm/res/relay/namespace:<version>' = {
name: 'namespaceDeployment'
params: {
// Required parameters
name: 'rnmin001'
// Non-required parameters
location: '<location>'
}
}
```
Expand All @@ -78,13 +75,8 @@ module namespace 'br/public:avm/res/relay/namespace:<version>' = {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
// Required parameters
"name": {
"value": "rnmin001"
},
// Non-required parameters
"location": {
"value": "<location>"
}
}
}
Expand All @@ -100,10 +92,7 @@ module namespace 'br/public:avm/res/relay/namespace:<version>' = {
```bicep-params
using 'br/public:avm/res/relay/namespace:<version>'
// Required parameters
param name = 'rnmin001'
// Non-required parameters
param location = '<location>'
```

</details>
Expand Down Expand Up @@ -648,7 +637,6 @@ module namespace 'br/public:avm/res/relay/namespace:<version>' = {
userMetadata: '[{\'key\':\'endpoint\',\'value\':\'db-server.constoso.com:1433\'}]'
}
]
location: '<location>'
networkRuleSets: {
defaultAction: 'Deny'
ipRules: [
Expand Down Expand Up @@ -758,9 +746,6 @@ module namespace 'br/public:avm/res/relay/namespace:<version>' = {
}
]
},
"location": {
"value": "<location>"
},
"networkRuleSets": {
"value": {
"defaultAction": "Deny",
Expand Down Expand Up @@ -868,7 +853,6 @@ param hybridConnections = [
userMetadata: '[{\'key\':\'endpoint\',\'value\':\'db-server.constoso.com:1433\'}]'
}
]
param location = '<location>'
param networkRuleSets = {
defaultAction: 'Deny'
ipRules: [
Expand Down Expand Up @@ -1220,7 +1204,7 @@ Configuration details for private endpoints. For security reasons, it is recomme
| [`name`](#parameter-privateendpointsname) | string | The name of the Private Endpoint. |
| [`privateDnsZoneGroup`](#parameter-privateendpointsprivatednszonegroup) | object | The private DNS Zone Group to configure for the Private Endpoint. |
| [`privateLinkServiceConnectionName`](#parameter-privateendpointsprivatelinkserviceconnectionname) | string | The name of the private link connection to create. |
| [`resourceGroupName`](#parameter-privateendpointsresourcegroupname) | string | Specify if you want to deploy the Private Endpoint into a different Resource Group than the main resource. |
| [`resourceGroupResourceId`](#parameter-privateendpointsresourcegroupresourceid) | string | The resource ID of the Resource Group the Private Endpoint will be created in. If not specified, the Resource Group of the provided Virtual Network Subnet is used. |
| [`roleAssignments`](#parameter-privateendpointsroleassignments) | array | Array of role assignments to create. |
| [`service`](#parameter-privateendpointsservice) | string | The subresource to deploy the Private Endpoint for. For example "vault" for a Key Vault Private Endpoint. |
| [`tags`](#parameter-privateendpointstags) | object | Tags to be applied on all resources/Resource Groups in this deployment. |
Expand Down Expand Up @@ -1473,9 +1457,9 @@ The name of the private link connection to create.
- Required: No
- Type: string

### Parameter: `privateEndpoints.resourceGroupName`
### Parameter: `privateEndpoints.resourceGroupResourceId`

Specify if you want to deploy the Private Endpoint into a different Resource Group than the main resource.
The resource ID of the Resource Group the Private Endpoint will be created in. If not specified, the Resource Group of the provided Virtual Network Subnet is used.

- Required: No
- Type: string
Expand All @@ -1496,7 +1480,7 @@ Array of role assignments to create.
- `'Owner'`
- `'Private DNS Zone Contributor'`
- `'Reader'`
- `'Role Based Access Control Administrator (Preview)'`
- `'Role Based Access Control Administrator'`

**Required parameters**

Expand Down Expand Up @@ -1753,8 +1737,8 @@ 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/utl/types/avm-common-types:0.2.1` | Remote reference |
| `br/public:avm/res/network/private-endpoint:0.10.1` | Remote reference |
| `br/public:avm/utl/types/avm-common-types:0.5.1` | Remote reference |

## Data Collection

Expand Down
4 changes: 2 additions & 2 deletions avm/res/relay/namespace/authorization-rule/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "18419508106540588848"
"version": "0.33.13.18514",
"templateHash": "15268013886112846705"
},
"name": "Relay Namespace Authorization Rules",
"description": "This module deploys a Relay Namespace Authorization Rule."
Expand Down
9 changes: 9 additions & 0 deletions avm/res/relay/namespace/hybrid-connection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This module deploys a Relay Namespace Hybrid Connection.
- [Resource Types](#Resource-Types)
- [Parameters](#Parameters)
- [Outputs](#Outputs)
- [Cross-referenced modules](#Cross-referenced-modules)

## Resource Types

Expand Down Expand Up @@ -251,3 +252,11 @@ The principal type of the assigned principal ID.
| `name` | string | The name of the deployed hybrid connection. |
| `resourceGroupName` | string | The resource group of the deployed hybrid connection. |
| `resourceId` | string | The resource ID of the deployed hybrid connection. |

## Cross-referenced modules

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).

| Reference | Type |
| :-- | :-- |
| `br/public:avm/utl/types/avm-common-types:0.5.1` | Remote reference |
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "12152842818030875993"
"version": "0.33.13.18514",
"templateHash": "15677572676731388129"
},
"name": "Hybrid Connection Authorization Rules",
"description": "This module deploys a Hybrid Connection Authorization Rule."
Expand Down
44 changes: 4 additions & 40 deletions avm/res/relay/namespace/hybrid-connection/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ param authorizationRules array = [
}
]

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

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

var builtInRoleNames = {
'Azure Relay Listener': subscriptionResourceId(
Expand Down Expand Up @@ -144,41 +146,3 @@ output resourceId string = hybridConnection.id

@description('The resource group of the deployed hybrid connection.')
output resourceGroupName string = resourceGroup().name

// =============== //
// Definitions //
// =============== //

type lockType = {
@description('Optional. Specify the name of lock.')
name: string?

@description('Optional. Specify the type of lock.')
kind: ('CanNotDelete' | 'ReadOnly' | 'None')?
}?

type roleAssignmentType = {
@description('Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated.')
name: string?

@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\'.')
roleDefinitionIdOrName: string

@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
principalId: string

@description('Optional. The principal type of the assigned principal ID.')
principalType: ('ServicePrincipal' | 'Group' | 'User' | 'ForeignGroup' | 'Device')?

@description('Optional. The description of the role assignment.')
description: string?

@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".')
condition: string?

@description('Optional. Version of the condition.')
conditionVersion: '2.0'?

@description('Optional. The Resource Id of the delegated managed identity resource.')
delegatedManagedIdentityResourceId: string?
}[]?
Loading

0 comments on commit d0a356d

Please sign in to comment.