Skip to content

Commit

Permalink
fix: Virtual-Network-Subnet - Updated NetworkPolicy AllowdSets (#3590)
Browse files Browse the repository at this point in the history
## Description

Updated allowed sets for 
- `privateEndpointNetworkPolicies`
- `privateLinkServiceNetworkPolicies`

Closes #3586

## Pipeline Reference

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

| Pipeline |
| -------- |
|
[![avm.res.network.virtual-network](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.network.virtual-network.yml/badge.svg?branch=users%2Falsehr%2FsubnetPolicyTypes&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.network.virtual-network.yml)
|

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [ ] Update to CI Environment or utilities (Non-module affecting
changes)
- [ ] Azure Verified Module updates:
- [x] 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 Oct 18, 2024
1 parent 6736202 commit a116415
Show file tree
Hide file tree
Showing 7 changed files with 437 additions and 511 deletions.
8 changes: 4 additions & 4 deletions avm/res/network/virtual-network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ The diagnostic settings of the service.
| [`logCategoriesAndGroups`](#parameter-diagnosticsettingslogcategoriesandgroups) | array | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to `[]` to disable log collection. |
| [`marketplacePartnerResourceId`](#parameter-diagnosticsettingsmarketplacepartnerresourceid) | string | The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. |
| [`metricCategories`](#parameter-diagnosticsettingsmetriccategories) | array | The name of metrics that will be streamed. "allMetrics" includes all possible metrics for the resource. Set to `[]` to disable metric collection. |
| [`name`](#parameter-diagnosticsettingsname) | string | The name of diagnostic setting. |
| [`name`](#parameter-diagnosticsettingsname) | string | The name of the diagnostic setting. |
| [`storageAccountResourceId`](#parameter-diagnosticsettingsstorageaccountresourceid) | string | Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
| [`workspaceResourceId`](#parameter-diagnosticsettingsworkspaceresourceid) | string | Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |

Expand Down Expand Up @@ -1288,7 +1288,7 @@ Enable or disable the category explicitly. Default is `true`.

### Parameter: `diagnosticSettings.name`

The name of diagnostic setting.
The name of the diagnostic setting.

- Required: No
- Type: string
Expand Down Expand Up @@ -1716,9 +1716,10 @@ enable or disable apply network policies on private endpoint in the subnet.
- Allowed:
```Bicep
[
''
'Disabled'
'Enabled'
'NetworkSecurityGroupEnabled'
'RouteTableEnabled'
]
```

Expand All @@ -1731,7 +1732,6 @@ enable or disable apply network policies on private link service in the subnet.
- Allowed:
```Bicep
[
''
'Disabled'
'Enabled'
]
Expand Down
93 changes: 9 additions & 84 deletions avm/res/network/virtual-network/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ param vnetEncryptionEnforcement string = 'AllowUnencrypted'
@description('Optional. The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes. Default value 0 will set the property to null.')
param flowTimeoutInMinutes int = 0

import { diagnosticSettingFullType } from 'br/public:avm/utl/types/avm-common-types:0.1.0'
@description('Optional. The diagnostic settings of the service.')
param diagnosticSettings diagnosticSettingType
param diagnosticSettings diagnosticSettingFullType[]?

import { lockType } from 'br/public:avm/utl/types/avm-common-types:0.1.0'
@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.1.0'
@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
param roleAssignments roleAssignmentType[]?

@description('Optional. Tags of the resource.')
param tags object?
Expand Down Expand Up @@ -298,84 +301,6 @@ output location string = virtualNetwork.location
// 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?
}[]?

type diagnosticSettingType = {
@description('Optional. The name of diagnostic setting.')
name: string?

@description('Optional. The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to `[]` to disable log collection.')
logCategoriesAndGroups: {
@description('Optional. Name of a Diagnostic Log category for a resource type this setting is applied to. Set the specific logs to collect here.')
category: string?

@description('Optional. Name of a Diagnostic Log category group for a resource type this setting is applied to. Set to `allLogs` to collect all logs.')
categoryGroup: string?

@description('Optional. Enable or disable the category explicitly. Default is `true`.')
enabled: bool?
}[]?

@description('Optional. The name of metrics that will be streamed. "allMetrics" includes all possible metrics for the resource. Set to `[]` to disable metric collection.')
metricCategories: {
@description('Required. Name of a Diagnostic Metric category for a resource type this setting is applied to. Set to `AllMetrics` to collect all metrics.')
category: string

@description('Optional. Enable or disable the category explicitly. Default is `true`.')
enabled: bool?
}[]?

@description('Optional. A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type.')
logAnalyticsDestinationType: ('Dedicated' | 'AzureDiagnostics')?

@description('Optional. Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
workspaceResourceId: string?

@description('Optional. Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
storageAccountResourceId: string?

@description('Optional. Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to.')
eventHubAuthorizationRuleResourceId: string?

@description('Optional. Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
eventHubName: string?

@description('Optional. The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.')
marketplacePartnerResourceId: string?
}[]?

type peeringType = {
@description('Optional. The Name of VNET Peering resource. If not provided, default value will be peer-localVnetName-remoteVnetName.')
name: string?
Expand Down Expand Up @@ -443,13 +368,13 @@ type subnetType = {
networkSecurityGroupResourceId: string?

@description('Optional. enable or disable apply network policies on private endpoint in the subnet.')
privateEndpointNetworkPolicies: ('Disabled' | 'Enabled' | '')?
privateEndpointNetworkPolicies: ('Disabled' | 'Enabled' | 'NetworkSecurityGroupEnabled' | 'RouteTableEnabled')?

@description('Optional. enable or disable apply network policies on private link service in the subnet.')
privateLinkServiceNetworkPolicies: ('Disabled' | 'Enabled' | '')?
privateLinkServiceNetworkPolicies: ('Disabled' | 'Enabled')?

@description('Optional. Array of role assignments to create.')
roleAssignments: roleAssignmentType
roleAssignments: roleAssignmentType[]?

@description('Optional. The resource ID of the route table to assign to the subnet.')
routeTableResourceId: string?
Expand Down
Loading

0 comments on commit a116415

Please sign in to comment.