Skip to content

Commit

Permalink
fix: Update avm/res/sql/server - Cross reference latest PE version (#…
Browse files Browse the repository at this point in the history
…4294)

## Description

Leverage latest private endpoint version

## Pipeline Reference

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

| Pipeline |
| -------- |
|
[![avm.res.sql.server](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.sql.server.yml/badge.svg?branch=users%2Ferikag%2Fsql_update_pe&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.sql.server.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:
- [ ] 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

## Checklist

- [ ] I'm sure there are no other open Pull Requests for the same
update/change
- [ ] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [ ] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->
  • Loading branch information
eriqua authored Jan 26, 2025
1 parent ab451a3 commit a2a5a43
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 69 deletions.
2 changes: 1 addition & 1 deletion avm/res/sql/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4574,7 +4574,7 @@ 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.9.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 |

## Notes
Expand Down
10 changes: 5 additions & 5 deletions avm/res/sql/server/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ module server_elasticPools 'elastic-pool/main.bicep' = [
}
]

module server_privateEndpoints 'br/public:avm/res/network/private-endpoint:0.9.1' = [
module server_privateEndpoints 'br/public:avm/res/network/private-endpoint:0.10.1' = [
for (privateEndpoint, index) in (privateEndpoints ?? []): {
name: '${uniqueString(deployment().name, location)}-server-PrivateEndpoint-${index}'
scope: !empty(privateEndpoint.?resourceGroupResourceId)
Expand Down Expand Up @@ -511,15 +511,15 @@ module secretsExport 'modules/keyVaultExport.bicep' = if (secretsExportConfigura
contains(secretsExportConfiguration!, 'sqlAdminPasswordSecretName')
? [
{
name: secretsExportConfiguration!.sqlAdminPasswordSecretName
name: secretsExportConfiguration!.?sqlAdminPasswordSecretName
value: administratorLoginPassword
}
]
: [],
contains(secretsExportConfiguration!, 'sqlAzureConnectionStringSercretName')
? [
{
name: secretsExportConfiguration!.sqlAzureConnectionStringSercretName
name: secretsExportConfiguration!.?sqlAzureConnectionStringSercretName
value: 'Server=${server.properties.fullyQualifiedDomainName}; Database=${!empty(databases) ? databases[0].name : ''}; User=${administratorLogin}; Password=${administratorLoginPassword}'
}
]
Expand Down Expand Up @@ -575,8 +575,8 @@ output privateEndpoints privateEndpointOutputType[] = [
for (pe, i) in (!empty(privateEndpoints) ? array(privateEndpoints) : []): {
name: server_privateEndpoints[i].outputs.name
resourceId: server_privateEndpoints[i].outputs.resourceId
groupId: server_privateEndpoints[i].outputs.groupId
customDnsConfigs: server_privateEndpoints[i].outputs.customDnsConfig
groupId: server_privateEndpoints[i].outputs.?groupId!
customDnsConfigs: server_privateEndpoints[i].outputs.customDnsConfigs
networkInterfaceResourceIds: server_privateEndpoints[i].outputs.networkInterfaceResourceIds
}
]
Expand Down
80 changes: 17 additions & 63 deletions avm/res/sql/server/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "1587400381998149524"
"templateHash": "3916165598658090160"
},
"name": "Azure SQL Servers",
"description": "This module deploys an Azure SQL Server."
Expand Down Expand Up @@ -3737,12 +3737,11 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "15164027369246485309"
"version": "0.33.13.18514",
"templateHash": "15954548978129725136"
},
"name": "Private Endpoints",
"description": "This module deploys a Private Endpoint.",
"owner": "Azure/module-maintainers"
"description": "This module deploys a Private Endpoint."
},
"definitions": {
"privateDnsZoneGroupType": {
Expand Down Expand Up @@ -3809,50 +3808,6 @@
"__bicep_export!": true
}
},
"manualPrivateLinkServiceConnectionType": {
"type": "object",
"properties": {
"name": {
"type": "string",
"metadata": {
"description": "Required. The name of the private link service connection."
}
},
"properties": {
"type": "object",
"properties": {
"groupIds": {
"type": "array",
"items": {
"type": "string"
},
"metadata": {
"description": "Required. The ID of a group obtained from the remote resource that this private endpoint should connect to. If used with private link service connection, this property must be defined as empty string array `[]`."
}
},
"privateLinkServiceId": {
"type": "string",
"metadata": {
"description": "Required. The resource id of private link service."
}
},
"requestMessage": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. A message passed to the owner of the remote resource with this connection request. Restricted to 140 chars."
}
}
},
"metadata": {
"description": "Required. Properties of private link service connection."
}
}
},
"metadata": {
"__bicep_export!": true
}
},
"privateLinkServiceConnectionType": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -3947,7 +3902,7 @@
"metadata": {
"description": "An AVM-aligned type for a lock.",
"__bicep_imported_from!": {
"sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.2.1"
"sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.5.1"
}
}
},
Expand Down Expand Up @@ -4045,7 +4000,7 @@
"metadata": {
"description": "An AVM-aligned type for a role assignment.",
"__bicep_imported_from!": {
"sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.2.1"
"sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.5.1"
}
}
}
Expand Down Expand Up @@ -4141,11 +4096,11 @@
"manualPrivateLinkServiceConnections": {
"type": "array",
"items": {
"$ref": "#/definitions/manualPrivateLinkServiceConnectionType"
"$ref": "#/definitions/privateLinkServiceConnectionType"
},
"nullable": true,
"metadata": {
"description": "Optional. A grouping of information about the connection to the remote resource. Used when the network admin does not have access to approve connections to the remote resource."
"description": "Conditional. A grouping of information about the connection to the remote resource. Used when the network admin does not have access to approve connections to the remote resource. Required if `privateLinkServiceConnections` is empty."
}
},
"privateLinkServiceConnections": {
Expand All @@ -4155,7 +4110,7 @@
},
"nullable": true,
"metadata": {
"description": "Optional. A grouping of information about the connection to the remote resource."
"description": "Conditional. A grouping of information about the connection to the remote resource. Required if `manualPrivateLinkServiceConnections` is empty."
}
},
"enableTelemetry": {
Expand Down Expand Up @@ -4192,7 +4147,7 @@
"condition": "[parameters('enableTelemetry')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2024-03-01",
"name": "[format('46d3xbcp.res.network-privateendpoint.{0}.{1}', replace('0.9.1', '.', '-'), substring(uniqueString(deployment().name, parameters('location')), 0, 4))]",
"name": "[format('46d3xbcp.res.network-privateendpoint.{0}.{1}', replace('0.10.1', '.', '-'), substring(uniqueString(deployment().name, parameters('location')), 0, 4))]",
"properties": {
"mode": "Incremental",
"template": {
Expand Down Expand Up @@ -4298,12 +4253,11 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "14591244586837935522"
"version": "0.33.13.18514",
"templateHash": "5440815542537978381"
},
"name": "Private Endpoint Private DNS Zone Groups",
"description": "This module deploys a Private Endpoint Private DNS Zone Group.",
"owner": "Azure/module-maintainers"
"description": "This module deploys a Private Endpoint Private DNS Zone Group."
},
"definitions": {
"privateDnsZoneGroupConfigType": {
Expand Down Expand Up @@ -4443,7 +4397,7 @@
},
"value": "[reference('privateEndpoint', '2023-11-01', 'full').location]"
},
"customDnsConfig": {
"customDnsConfigs": {
"type": "array",
"items": {
"$ref": "#/definitions/customDnsConfigType"
Expand Down Expand Up @@ -5608,7 +5562,7 @@
"value": "[last(split(coalesce(tryGet(parameters('secretsExportConfiguration'), 'keyVaultResourceId'), '//'), '/'))]"
},
"secretsToSet": {
"value": "[union(createArray(), if(contains(parameters('secretsExportConfiguration'), 'sqlAdminPasswordSecretName'), createArray(createObject('name', parameters('secretsExportConfiguration').sqlAdminPasswordSecretName, 'value', parameters('administratorLoginPassword'))), createArray()), if(contains(parameters('secretsExportConfiguration'), 'sqlAzureConnectionStringSercretName'), createArray(createObject('name', parameters('secretsExportConfiguration').sqlAzureConnectionStringSercretName, 'value', format('Server={0}; Database={1}; User={2}; Password={3}', reference('server').fullyQualifiedDomainName, if(not(empty(parameters('databases'))), parameters('databases')[0].name, ''), parameters('administratorLogin'), parameters('administratorLoginPassword')))), createArray()))]"
"value": "[union(createArray(), if(contains(parameters('secretsExportConfiguration'), 'sqlAdminPasswordSecretName'), createArray(createObject('name', tryGet(parameters('secretsExportConfiguration'), 'sqlAdminPasswordSecretName'), 'value', parameters('administratorLoginPassword'))), createArray()), if(contains(parameters('secretsExportConfiguration'), 'sqlAzureConnectionStringSercretName'), createArray(createObject('name', tryGet(parameters('secretsExportConfiguration'), 'sqlAzureConnectionStringSercretName'), 'value', format('Server={0}; Database={1}; User={2}; Password={3}', reference('server').fullyQualifiedDomainName, if(not(empty(parameters('databases'))), parameters('databases')[0].name, ''), parameters('administratorLogin'), parameters('administratorLoginPassword')))), createArray()))]"
}
},
"template": {
Expand Down Expand Up @@ -6019,8 +5973,8 @@
"input": {
"name": "[reference(format('server_privateEndpoints[{0}]', copyIndex())).outputs.name.value]",
"resourceId": "[reference(format('server_privateEndpoints[{0}]', copyIndex())).outputs.resourceId.value]",
"groupId": "[reference(format('server_privateEndpoints[{0}]', copyIndex())).outputs.groupId.value]",
"customDnsConfigs": "[reference(format('server_privateEndpoints[{0}]', copyIndex())).outputs.customDnsConfig.value]",
"groupId": "[tryGet(tryGet(reference(format('server_privateEndpoints[{0}]', copyIndex())).outputs, 'groupId'), 'value')]",
"customDnsConfigs": "[reference(format('server_privateEndpoints[{0}]', copyIndex())).outputs.customDnsConfigs.value]",
"networkInterfaceResourceIds": "[reference(format('server_privateEndpoints[{0}]', copyIndex())).outputs.networkInterfaceResourceIds.value]"
}
}
Expand Down

0 comments on commit a2a5a43

Please sign in to comment.