Skip to content

Commit

Permalink
feat: Updated DB-For-Postgre-SQL-Flexible Server CMK implementation (#…
Browse files Browse the repository at this point in the history
…3739)

## Description

- Updated DB-For-Postgre-SQL-Flexible Server CMK implementation
- Implemented AVM-Common-Types

Linked to 
- Update CMK implementations as per
#2842 (comment)
- Docs Update: Azure/Azure-Verified-Modules#1683
- UDT update: #3724

## Pipeline Reference

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

| Pipeline |
| -------- |
|
[![avm.res.db-for-postgre-sql.flexible-server](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.db-for-postgre-sql.flexible-server.yml/badge.svg?branch=users%2Falsehr%2FcmkUpdateDBForPostgreSQLFlexibleServer&event=workflow_dispatch)](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.db-for-postgre-sql.flexible-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)
- [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 Dec 20, 2024
1 parent 91bcdf9 commit 6dafe6d
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 76 deletions.
36 changes: 18 additions & 18 deletions avm/res/db-for-postgre-sql/flexible-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module flexibleServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:<ver
name: 'flexibleServerDeployment'
params: {
// Required parameters
name: 'dfpsfsmin001'
name: 'dfpsmin001'
skuName: 'Standard_D2s_v3'
tier: 'GeneralPurpose'
// Non-required parameters
Expand Down Expand Up @@ -85,7 +85,7 @@ module flexibleServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:<ver
"parameters": {
// Required parameters
"name": {
"value": "dfpsfsmin001"
"value": "dfpsmin001"
},
"skuName": {
"value": "Standard_D2s_v3"
Expand Down Expand Up @@ -118,7 +118,7 @@ module flexibleServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:<ver
using 'br/public:avm/res/db-for-postgre-sql/flexible-server:<version>'
// Required parameters
param name = 'dfpsfsmin001'
param name = 'dfpsmin001'
param skuName = 'Standard_D2s_v3'
param tier = 'GeneralPurpose'
// Non-required parameters
Expand Down Expand Up @@ -281,7 +281,7 @@ module flexibleServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:<ver
name: 'flexibleServerDeployment'
params: {
// Required parameters
name: 'dfpsfspvt001'
name: 'dfpspvt001'
skuName: 'Standard_D2s_v3'
tier: 'GeneralPurpose'
// Non-required parameters
Expand Down Expand Up @@ -367,7 +367,7 @@ module flexibleServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:<ver
"parameters": {
// Required parameters
"name": {
"value": "dfpsfspvt001"
"value": "dfpspvt001"
},
"skuName": {
"value": "Standard_D2s_v3"
Expand Down Expand Up @@ -477,7 +477,7 @@ module flexibleServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:<ver
using 'br/public:avm/res/db-for-postgre-sql/flexible-server:<version>'
// Required parameters
param name = 'dfpsfspvt001'
param name = 'dfpspvt001'
param skuName = 'Standard_D2s_v3'
param tier = 'GeneralPurpose'
// Non-required parameters
Expand Down Expand Up @@ -564,7 +564,7 @@ module flexibleServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:<ver
name: 'flexibleServerDeployment'
params: {
// Required parameters
name: 'dfpsfspe001'
name: 'dfpspe001'
skuName: 'Standard_D2ds_v5'
tier: 'GeneralPurpose'
// Non-required parameters
Expand Down Expand Up @@ -614,7 +614,7 @@ module flexibleServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:<ver
"parameters": {
// Required parameters
"name": {
"value": "dfpsfspe001"
"value": "dfpspe001"
},
"skuName": {
"value": "Standard_D2ds_v5"
Expand Down Expand Up @@ -680,7 +680,7 @@ module flexibleServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:<ver
using 'br/public:avm/res/db-for-postgre-sql/flexible-server:<version>'
// Required parameters
param name = 'dfpsfspe001'
param name = 'dfpspe001'
param skuName = 'Standard_D2ds_v5'
param tier = 'GeneralPurpose'
// Non-required parameters
Expand Down Expand Up @@ -731,7 +731,7 @@ module flexibleServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:<ver
name: 'flexibleServerDeployment'
params: {
// Required parameters
name: 'dfpsfspub001'
name: 'dfpspub001'
skuName: 'Standard_D2s_v3'
tier: 'GeneralPurpose'
// Non-required parameters
Expand Down Expand Up @@ -837,7 +837,7 @@ module flexibleServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:<ver
"parameters": {
// Required parameters
"name": {
"value": "dfpsfspub001"
"value": "dfpspub001"
},
"skuName": {
"value": "Standard_D2s_v3"
Expand Down Expand Up @@ -973,7 +973,7 @@ module flexibleServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:<ver
using 'br/public:avm/res/db-for-postgre-sql/flexible-server:<version>'
// Required parameters
param name = 'dfpsfspub001'
param name = 'dfpspub001'
param skuName = 'Standard_D2s_v3'
param tier = 'GeneralPurpose'
// Non-required parameters
Expand Down Expand Up @@ -1080,7 +1080,7 @@ module flexibleServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:<ver
name: 'flexibleServerDeployment'
params: {
// Required parameters
name: 'dfpsfswaf001'
name: 'dfpswaf001'
skuName: 'Standard_D2s_v3'
tier: 'GeneralPurpose'
// Non-required parameters
Expand Down Expand Up @@ -1154,7 +1154,7 @@ module flexibleServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:<ver
"parameters": {
// Required parameters
"name": {
"value": "dfpsfswaf001"
"value": "dfpswaf001"
},
"skuName": {
"value": "Standard_D2s_v3"
Expand Down Expand Up @@ -1250,7 +1250,7 @@ module flexibleServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:<ver
using 'br/public:avm/res/db-for-postgre-sql/flexible-server:<version>'
// Required parameters
param name = 'dfpsfswaf001'
param name = 'dfpswaf001'
param skuName = 'Standard_D2s_v3'
param tier = 'GeneralPurpose'
// Non-required parameters
Expand Down Expand Up @@ -1542,7 +1542,7 @@ The customer managed key definition.

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`keyVersion`](#parameter-customermanagedkeykeyversion) | string | The version of the customer managed key to reference for encryption. If not provided, using 'latest'. |
| [`keyVersion`](#parameter-customermanagedkeykeyversion) | string | The version of the customer managed key to reference for encryption. If not provided, the deployment will use the latest version available at deployment time. |
| [`userAssignedIdentityResourceId`](#parameter-customermanagedkeyuserassignedidentityresourceid) | string | User assigned identity to use when fetching the customer managed key. Required if no system assigned identity is available for use. |

### Parameter: `customerManagedKey.keyName`
Expand All @@ -1565,7 +1565,7 @@ The resource ID of a key vault to reference a customer managed key for encryptio

### Parameter: `customerManagedKey.keyVersion`

The version of the customer managed key to reference for encryption. If not provided, using 'latest'.
The version of the customer managed key to reference for encryption. If not provided, the deployment will use the latest version available at deployment time.

- Required: No
- Type: string
Expand Down Expand Up @@ -2704,7 +2704,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.8.0` | Remote reference |
| `br/public:avm/utl/types/avm-common-types:0.2.1` | Remote reference |
| `br/public:avm/utl/types/avm-common-types:0.4.0` | Remote reference |

## Data Collection

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ resource configuration 'Microsoft.DBforPostgreSQL/flexibleServers/configurations
name: name
parent: flexibleServer
properties: {
source: !empty(source) ? source : null
value: !empty(value) ? value : null
source: source
value: value
}
}

Expand Down
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": "8692991969370260536"
"templateHash": "4946690157452229101"
},
"name": "DBforPostgreSQL Flexible Server Configurations",
"description": "This module deploys a DBforPostgreSQL Flexible Server Configuration.",
Expand Down Expand Up @@ -52,8 +52,8 @@
"apiVersion": "2024-08-01",
"name": "[format('{0}/{1}', parameters('flexibleServerName'), parameters('name'))]",
"properties": {
"source": "[if(not(empty(parameters('source'))), parameters('source'), null())]",
"value": "[if(not(empty(parameters('value'))), parameters('value'), null())]"
"source": "[parameters('source')]",
"value": "[parameters('value')]"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ resource database 'Microsoft.DBforPostgreSQL/flexibleServers/databases@2024-08-0
name: name
parent: flexibleServer
properties: {
collation: !empty(collation) ? collation : null
charset: !empty(charset) ? charset : null
collation: collation
charset: charset
}
}

Expand Down
6 changes: 3 additions & 3 deletions avm/res/db-for-postgre-sql/flexible-server/database/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": "12665965031871834086"
"templateHash": "6268235914904773219"
},
"name": "DBforPostgreSQL Flexible Server Databases",
"description": "This module deploys a DBforPostgreSQL Flexible Server Database.",
Expand Down Expand Up @@ -52,8 +52,8 @@
"apiVersion": "2024-08-01",
"name": "[format('{0}/{1}', parameters('flexibleServerName'), parameters('name'))]",
"properties": {
"collation": "[if(not(empty(parameters('collation'))), parameters('collation'), null())]",
"charset": "[if(not(empty(parameters('charset'))), parameters('charset'), null())]"
"collation": "[parameters('collation')]",
"charset": "[parameters('charset')]"
}
}
},
Expand Down
24 changes: 12 additions & 12 deletions avm/res/db-for-postgre-sql/flexible-server/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,18 @@ param highAvailability string = 'ZoneRedundant'
@description('Optional. The mode to create a new PostgreSQL server.')
param createMode string = 'Default'

import { managedIdentityOnlyUserAssignedType } from 'br/public:avm/utl/types/avm-common-types:0.4.0'
@description('Conditional. The managed identity definition for this resource. Required if \'cMKKeyName\' is not empty.')
param managedIdentities managedIdentityOnlyUserAssignedType?

@allowed([
'Disabled'
'Enabled'
])
@description('Optional. Specifies the state of the Threat Protection, whether it is enabled or disabled or a state has not been applied yet on the specific server.')
param serverThreatProtection string = 'Enabled'

import { managedIdentityOnlyUserAssignedType } from 'br/public:avm/utl/types/avm-common-types:0.2.1'
@description('Conditional. The managed identity definition for this resource. Required if \'cMKKeyName\' is not empty.')
param managedIdentities managedIdentityOnlyUserAssignedType?

import { customerManagedKeyType } from 'br/public:avm/utl/types/avm-common-types:0.2.1'
import { customerManagedKeyType } from 'br/public:avm/utl/types/avm-common-types:0.4.0'
@description('Optional. The customer managed key definition.')
param customerManagedKey customerManagedKeyType?

Expand Down Expand Up @@ -156,14 +156,14 @@ param databases array = []
@description('Optional. The configurations to create in the server.')
param configurations array = []

@description('Optional. The replication settings for the server. Can only be set on existing flexible servers.')
param replica replicaType?

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

import { roleAssignmentType } from 'br/public:avm/utl/types/avm-common-types:0.2.1'
@description('Optional. The replication settings for the server. Can only be set on existing flexible servers.')
param replica replicaType?

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

Expand All @@ -173,11 +173,11 @@ param tags object?
@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

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

import { privateEndpointSingleServiceType } from 'br/public:avm/utl/types/avm-common-types:0.2.1'
import { privateEndpointSingleServiceType } from 'br/public:avm/utl/types/avm-common-types:0.4.0'
@description('Optional. Configuration details for private endpoints. Used when the desired connectivity mode is \'Public Access\' and \'delegatedSubnetResourceId\' is NOT used.')
param privateEndpoints privateEndpointSingleServiceType[]?

Expand Down
Loading

0 comments on commit 6dafe6d

Please sign in to comment.