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

[Fixes] Updated PE interface, nuallabel types & fixed readme bug #10

Merged
merged 8 commits into from
Sep 27, 2023
Merged
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
35 changes: 17 additions & 18 deletions avm/res/cognitive-services/account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ module account 'br/public:avm-res-cognitiveservices-account:1.0.0' = {
privateDnsZoneResourceIds: [
'<privateDNSZoneResourceId>'
]
service: 'account'
subnetResourceId: '<subnetResourceId>'
tags: {
Environment: 'Non-Prod'
Expand Down Expand Up @@ -290,7 +289,6 @@ module account 'br/public:avm-res-cognitiveservices-account:1.0.0' = {
"privateDnsZoneResourceIds": [
"<privateDNSZoneResourceId>"
],
"service": "account",
"subnetResourceId": "<subnetResourceId>",
"tags": {
"Environment": "Non-Prod",
Expand Down Expand Up @@ -876,14 +874,12 @@ module account 'br/public:avm-res-cognitiveservices-account:1.0.0' = {
List of allowed FQDN.
- Required: No
- Type: array
- Default: `[]`

### Parameter: `apiProperties`

The API properties for special APIs.
- Required: No
- Type: object
- Default: `{object}`

### Parameter: `customerManagedKey`

Expand Down Expand Up @@ -932,7 +928,6 @@ Optional. User assigned identity to use when fetching the customer managed key.
Subdomain name used for token-based authentication. Required if 'networkAcls' or 'privateEndpoints' are set.
- Required: No
- Type: string
- Default: `''`

### Parameter: `diagnosticSettings`

Expand Down Expand Up @@ -1142,7 +1137,6 @@ Optional. The resource ID(s) to assign to the resource. Required if a user assig
Resource migration token.
- Required: No
- Type: string
- Default: `''`

### Parameter: `name`

Expand All @@ -1169,15 +1163,16 @@ Configuration details for private endpoints. For security reasons, it is recomme
| [`applicationSecurityGroupResourceIds`](#parameter-privateendpointsapplicationsecuritygroupresourceids) | No | array | Optional. Application security groups in which the private endpoint IP configuration is included. |
| [`customDnsConfigs`](#parameter-privateendpointscustomdnsconfigs) | No | array | Optional. Custom DNS configurations. |
| [`customNetworkInterfaceName`](#parameter-privateendpointscustomnetworkinterfacename) | No | string | Optional. The custom name of the network interface attached to the private endpoint. |
| [`enableTelemetry`](#parameter-privateendpointsenabletelemetry) | No | bool | Optional. Enable telemetry via a Globally Unique Identifier (GUID). |
| [`enableTelemetry`](#parameter-privateendpointsenabletelemetry) | No | bool | Optional. Enable/Disable usage telemetry for module. |
| [`ipConfigurations`](#parameter-privateendpointsipconfigurations) | No | array | Optional. A list of IP configurations of the private endpoint. This will be used to map to the First Party Service endpoints. |
| [`location`](#parameter-privateendpointslocation) | No | string | Optional. The location to deploy the private endpoint to. |
| [`lock`](#parameter-privateendpointslock) | No | string | Optional. Specify the type of lock. |
| [`lock`](#parameter-privateendpointslock) | No | | Optional. Specify the type of lock. |
| [`manualPrivateLinkServiceConnections`](#parameter-privateendpointsmanualprivatelinkserviceconnections) | No | array | Optional. Manual PrivateLink Service Connections. |
| [`name`](#parameter-privateendpointsname) | No | string | Optional. The name of the private endpoint. |
| [`privateDnsZoneGroupName`](#parameter-privateendpointsprivatednszonegroupname) | No | string | Optional. The name of the private DNS zone group to create if `privateDnsZoneResourceIds` were provided. |
| [`privateDnsZoneResourceIds`](#parameter-privateendpointsprivatednszoneresourceids) | No | array | Optional. The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones. |
| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | array | Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
| [`service`](#parameter-privateendpointsservice) | Yes | string | Required. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob". |
| [`roleAssignments`](#parameter-privateendpointsroleassignments) | No | | Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
| [`service`](#parameter-privateendpointsservice) | No | string | Optional. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob". |
| [`subnetResourceId`](#parameter-privateendpointssubnetresourceid) | Yes | string | Required. Resource ID of the subnet where the endpoint needs to be created. |
| [`tags`](#parameter-privateendpointstags) | No | object | Optional. Tags to be applied on all resources/resource groups in this deployment. |

Expand Down Expand Up @@ -1218,7 +1213,7 @@ Optional. The custom name of the network interface attached to the private endpo

### Parameter: `privateEndpoints.enableTelemetry`

Optional. Enable telemetry via a Globally Unique Identifier (GUID).
Optional. Enable/Disable usage telemetry for module.

- Required: No
- Type: bool
Expand Down Expand Up @@ -1266,8 +1261,7 @@ Optional. The location to deploy the private endpoint to.
Optional. Specify the type of lock.

- Required: No
- Type: string
- Allowed: `[, CanNotDelete, ReadOnly]`
- Type:

### Parameter: `privateEndpoints.manualPrivateLinkServiceConnections`

Expand All @@ -1283,6 +1277,13 @@ Optional. The name of the private endpoint.
- Required: No
- Type: string

### Parameter: `privateEndpoints.privateDnsZoneGroupName`

Optional. The name of the private DNS zone group to create if `privateDnsZoneResourceIds` were provided.

- Required: No
- Type: string

### Parameter: `privateEndpoints.privateDnsZoneResourceIds`

Optional. The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones.
Expand All @@ -1295,13 +1296,13 @@ Optional. The private DNS zone groups to associate the private endpoint with. A
Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.

- Required: No
- Type: array
- Type:

### Parameter: `privateEndpoints.service`

Required. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob".
Optional. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob".

- Required: Yes
- Required: No
- Type: string

### Parameter: `privateEndpoints.subnetResourceId`
Expand Down Expand Up @@ -1421,14 +1422,12 @@ SKU of the Cognitive Services resource. Use 'Get-AzCognitiveServicesAccountSku'
Tags of the resource.
- Required: No
- Type: object
- Default: `{object}`

### Parameter: `userOwnedStorage`

The storage accounts for this resource.
- Required: No
- Type: array
- Default: `[]`


## Outputs
Expand Down
36 changes: 20 additions & 16 deletions avm/res/cognitive-services/account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ param diagnosticSettings diagnosticSettingType
param publicNetworkAccess string = ''

@description('Conditional. Subdomain name used for token-based authentication. Required if \'networkAcls\' or \'privateEndpoints\' are set.')
param customSubDomainName string = ''
param customSubDomainName string?

@description('Optional. A collection of rules governing the accessibility from specific network locations.')
param networkAcls object = {}
Expand All @@ -84,13 +84,13 @@ param lock lockType
param roleAssignments roleAssignmentType

@description('Optional. Tags of the resource.')
param tags object = {}
param tags object?

@description('Optional. List of allowed FQDN.')
param allowedFqdnList array = []
param allowedFqdnList array?

@description('Optional. The API properties for special APIs.')
param apiProperties object = {}
param apiProperties object?

@description('Optional. Allow only Azure AD authentication. Should be enabled for security reasons.')
param disableLocalAuth bool = true
Expand All @@ -102,7 +102,7 @@ param customerManagedKey customerManagedKeyType
param dynamicThrottlingEnabled bool = false

@description('Optional. Resource migration token.')
param migrationToken string = ''
param migrationToken string?

@description('Optional. Restore a soft-deleted cognitive service at deployment time. Will fail if no such soft-deleted resource exists.')
param restore bool = false
Expand All @@ -111,7 +111,7 @@ param restore bool = false
param restrictOutboundNetworkAccess bool = true

@description('Optional. The storage accounts for this resource.')
param userOwnedStorage array = []
param userOwnedStorage array?

@description('Optional. The managed identity definition for this resource.')
param managedIdentities managedIdentitiesType
Expand Down Expand Up @@ -202,7 +202,7 @@ resource cognitiveService 'Microsoft.CognitiveServices/accounts@2022-12-01' = {
name: sku
}
properties: {
customSubDomainName: !empty(customSubDomainName) ? customSubDomainName : null
customSubDomainName: customSubDomainName
networkAcls: !empty(networkAcls) ? {
defaultAction: contains(networkAcls, 'defaultAction') ? networkAcls.defaultAction : null
virtualNetworkRules: contains(networkAcls, 'virtualNetworkRules') ? networkAcls.virtualNetworkRules : []
Expand All @@ -221,10 +221,10 @@ resource cognitiveService 'Microsoft.CognitiveServices/accounts@2022-12-01' = {
keyVersion: !empty(customerManagedKey.?keyVersion ?? '') ? customerManagedKey!.keyVersion : last(split(cMKKeyVault::cMKKey.properties.keyUriWithVersion, '/'))
}
} : null
migrationToken: !empty(migrationToken) ? migrationToken : null
migrationToken: migrationToken
restore: restore
restrictOutboundNetworkAccess: restrictOutboundNetworkAccess
userOwnedStorage: !empty(userOwnedStorage) ? userOwnedStorage : null
userOwnedStorage: userOwnedStorage
dynamicThrottlingEnabled: dynamicThrottlingEnabled
}
}
Expand Down Expand Up @@ -268,14 +268,15 @@ module cognitiveService_privateEndpoints '../../network/private-endpoint/main.bi
name: '${uniqueString(deployment().name, location)}-CognitiveService-PrivateEndpoint-${index}'
params: {
groupIds: [
privateEndpoint.service
privateEndpoint.?service ?? 'account'
]
name: privateEndpoint.?name ?? 'pe-${last(split(cognitiveService.id, '/'))}-${privateEndpoint.service}-${index}'
name: privateEndpoint.?name ?? 'pe-${last(split(cognitiveService.id, '/'))}-${privateEndpoint.?service ?? 'vault'}-${index}'
serviceResourceId: cognitiveService.id
subnetResourceId: privateEndpoint.subnetResourceId
enableTelemetry: privateEndpoint.?enableTelemetry ?? enableTelemetry
location: privateEndpoint.?location ?? reference(split(privateEndpoint.subnetResourceId, '/subnets/')[0], '2020-06-01', 'Full').location
lock: privateEndpoint.?lock ?? lock
privateDnsZoneGroupName: privateEndpoint.?privateDnsZoneGroupName ?? 'default'
privateDnsZoneResourceIds: privateEndpoint.?privateDnsZoneResourceIds ?? []
roleAssignments: privateEndpoint.?roleAssignments ?? []
tags: privateEndpoint.?tags ?? {}
Expand Down Expand Up @@ -392,12 +393,15 @@ type privateEndpointType = {
@description('Optional. The location to deploy the private endpoint to.')
location: string?

@description('Required. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob".')
service: string
@description('Optional. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob".')
service: string?

@description('Required. Resource ID of the subnet where the endpoint needs to be created.')
subnetResourceId: string

@description('Optional. The name of the private DNS zone group to create if `privateDnsZoneResourceIds` were provided.')
privateDnsZoneGroupName: string?

@description('Optional. The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones.')
privateDnsZoneResourceIds: string[]?

Expand All @@ -422,18 +426,18 @@ type privateEndpointType = {
customNetworkInterfaceName: string?

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

@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleAssignments: roleAssignmentType[]?
roleAssignments: roleAssignmentType?

@description('Optional. Tags to be applied on all resources/resource groups in this deployment.')
tags: object?

@description('Optional. Manual PrivateLink Service Connections.')
manualPrivateLinkServiceConnections: array?

@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
@description('Optional. Enable/Disable usage telemetry for module.')
enableTelemetry: bool?
}[]?

Expand Down
Loading
Loading