Skip to content

Commit

Permalink
feat: AI-Platform-Baseline - Updated UDTs to pending specs (#4099)
Browse files Browse the repository at this point in the history
## Description

Updated user-defined types with pending [new
specs](Azure/Azure-Verified-Modules#1738) &
[static
tests](#4098).

## Pipeline Reference

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

| Pipeline |
| -------- |

[![avm.ptn.ai-platform.baseline](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.ptn.ai-platform.baseline.yml/badge.svg?branch=users%2Falsehr%2Favm.ptn.ai-platform.baseline_udt&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.ptn.ai-platform.baseline.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 2, 2025
1 parent 1ce2f15 commit a0c48e2
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 45 deletions.
64 changes: 40 additions & 24 deletions avm/ptn/ai-platform/baseline/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -618,12 +618,14 @@ output virtualMachineName string = createVirtualMachine ? virtualMachine.outputs
// ================ //

@export()
@description('The type for a log analytics configuration.')
type logAnalyticsConfigurationType = {
@description('Optional. The name of the Log Analytics workspace.')
name: string?
}

@export()
@description('The type for a key vault configuration.')
type keyVaultConfigurationType = {
@description('Optional. The name of the key vault.')
name: string?
Expand All @@ -633,6 +635,7 @@ type keyVaultConfigurationType = {
}

@export()
@description('The type for a storage account configuration.')
type storageAccountConfigurationType = {
@description('Optional. The name of the storage account.')
name: string?
Expand All @@ -653,6 +656,7 @@ type storageAccountConfigurationType = {
}

@export()
@description('The type for a container registry configuration.')
type containerRegistryConfigurationType = {
@description('Optional. The name of the container registry.')
name: string?
Expand All @@ -662,12 +666,14 @@ type containerRegistryConfigurationType = {
}

@export()
@description('The type for an application insights configuration.')
type applicationInsightsConfigurationType = {
@description('Optional. The name of the Application Insights resource.')
name: string?
}

@export()
@description('The type for a workspace configuration.')
type workspaceConfigurationType = {
@description('Optional. The name of the AI Studio workspace hub.')
name: string?
Expand All @@ -685,6 +691,7 @@ type workspaceConfigurationType = {
networkOutboundRules: networkOutboundRuleType?
}

@description('The type for a virtual network subnet configuration.')
type virtualNetworkSubnetConfigurationType = {
@description('Optional. The name of the subnet to create.')
name: string?
Expand All @@ -697,6 +704,7 @@ type virtualNetworkSubnetConfigurationType = {
}

@export()
@description('The type for a virtual network configuration.')
type virtualNetworkConfigurationType = {
@description('Optional. Whether to create an associated virtual network. Defaults to \'true\'.')
enabled: bool?
Expand All @@ -712,6 +720,7 @@ type virtualNetworkConfigurationType = {
}

@export()
@description('The type for a bastion configuration.')
type bastionConfigurationType = {
@description('Optional. Whether to create a Bastion host in the virtual network. Defaults to \'true\'.')
enabled: bool?
Expand Down Expand Up @@ -747,7 +756,8 @@ type bastionConfigurationType = {
scaleUnits: int?
}

type nicConfigurationConfigurationType = {
@description('The type for a NIC configuration.')
type nicConfigurationType = {
@description('Optional. The name of the network interface.')
name: string?

Expand All @@ -761,6 +771,7 @@ type nicConfigurationConfigurationType = {
networkSecurityGroupResourceId: string?
}

@description('The type for an OS disk.')
type osDiskType = {
@description('Optional. The disk name.')
name: string?
Expand Down Expand Up @@ -795,6 +806,7 @@ type osDiskType = {
}

@export()
@description('The type for a virtual machine configuration.')
type virtualMachineConfigurationType = {
@description('Optional. Whether to create a virtual machine in the associated virtual network. Defaults to \'true\'.')
enabled: bool?
Expand All @@ -817,7 +829,7 @@ type virtualMachineConfigurationType = {
adminPassword: string?

@description('Optional. Configuration for the virtual machine network interface.')
nicConfigurationConfiguration: nicConfigurationConfigurationType?
nicConfigurationConfiguration: nicConfigurationType?

@description('Optional. OS image reference. In case of marketplace images, it\'s the combination of the publisher, offer, sku, version attributes. In case of custom images it\'s the resource ID of the custom image.')
imageReference: object?
Expand All @@ -841,62 +853,66 @@ type virtualMachineConfigurationType = {
maintenanceConfigurationResourceId: string?
}

@description('The type for an outbound rule.')
@discriminator('type')
type OutboundRuleType = FqdnOutboundRuleType | PrivateEndpointOutboundRule | ServiceTagOutboundRule
type outboundRuleType = fqdnOutboundRuleType | privateEndpointOutboundRuleType | serviceTagOutboundRuleType

type FqdnOutboundRuleType = {
@sys.description('Required. Type of a managed network Outbound Rule of the workspace hub. Only supported when \'isolationMode\' is \'AllowOnlyApprovedOutbound\'.')
@description('The type for a FQDN outbound rule.')
type fqdnOutboundRuleType = {
@description('Required. Type of a managed network Outbound Rule of the workspace hub. Only supported when \'isolationMode\' is \'AllowOnlyApprovedOutbound\'.')
type: 'FQDN'

@sys.description('Required. Fully Qualified Domain Name to allow for outbound traffic.')
@description('Required. Fully Qualified Domain Name to allow for outbound traffic.')
destination: string

@sys.description('Optional. Category of a managed network Outbound Rule of the workspace hub.')
@description('Optional. Category of a managed network Outbound Rule of the workspace hub.')
category: 'Dependency' | 'Recommended' | 'Required' | 'UserDefined'?
}

type PrivateEndpointOutboundRule = {
@sys.description('Required. Type of a managed network Outbound Rule of the workspace hub.')
@description('The type for a private endpoint outbound rule.')
type privateEndpointOutboundRuleType = {
@description('Required. Type of a managed network Outbound Rule of the workspace hub.')
type: 'PrivateEndpoint'

@sys.description('Required. Service Tag destination for a Service Tag Outbound Rule for the managed network of the workspace hub.')
@description('Required. Service Tag destination for a Service Tag Outbound Rule for the managed network of the workspace hub.')
destination: {
@sys.description('Required. The resource ID of the target resource for the private endpoint.')
@description('Required. The resource ID of the target resource for the private endpoint.')
serviceResourceId: string

@sys.description('Optional. Whether the private endpoint can be used by jobs running on Spark.')
@description('Optional. Whether the private endpoint can be used by jobs running on Spark.')
sparkEnabled: bool?

@sys.description('Required. The sub resource to connect for the private endpoint.')
@description('Required. The sub resource to connect for the private endpoint.')
subresourceTarget: string
}

@sys.description('Optional. Category of a managed network Outbound Rule of the workspace hub.')
@description('Optional. Category of a managed network Outbound Rule of the workspace hub.')
category: 'Dependency' | 'Recommended' | 'Required' | 'UserDefined'?
}

type ServiceTagOutboundRule = {
@sys.description('Required. Type of a managed network Outbound Rule of the workspace hub. Only supported when \'isolationMode\' is \'AllowOnlyApprovedOutbound\'.')
@description('The type for an service tag outbound rule.')
type serviceTagOutboundRuleType = {
@description('Required. Type of a managed network Outbound Rule of the workspace hub. Only supported when \'isolationMode\' is \'AllowOnlyApprovedOutbound\'.')
type: 'ServiceTag'

@sys.description('Required. Service Tag destination for a Service Tag Outbound Rule for the managed network of the workspace hub.')
@description('Required. Service Tag destination for a Service Tag Outbound Rule for the managed network of the workspace hub.')
destination: {
@sys.description('Required. The name of the service tag to allow.')
@description('Required. The name of the service tag to allow.')
portRanges: string

@sys.description('Required. The protocol to allow. Provide an asterisk(*) to allow any protocol.')
@description('Required. The protocol to allow. Provide an asterisk(*) to allow any protocol.')
protocol: 'TCP' | 'UDP' | 'ICMP' | '*'

@sys.description('Required. Which ports will be allow traffic by this rule. Provide an asterisk(*) to allow any port.')
@description('Required. Which ports will be allow traffic by this rule. Provide an asterisk(*) to allow any port.')
serviceTag: string
}

@sys.description('Optional. Category of a managed network Outbound Rule of the workspace hub.')
@description('Optional. Category of a managed network Outbound Rule of the workspace hub.')
category: 'Dependency' | 'Recommended' | 'Required' | 'UserDefined'?
}

@sys.description('Optional. Outbound rules for the managed network of the workspace hub.')
@description('The type for outbound rules for the managed network of the workspace hub.')
type networkOutboundRuleType = {
@sys.description('Required. The outbound rule. The name of the rule is the object key.')
*: OutboundRuleType
@description('Required. The outbound rule. The name of the rule is the object key.')
*: outboundRuleType
}
Loading

0 comments on commit a0c48e2

Please sign in to comment.