-
Notifications
You must be signed in to change notification settings - Fork 437
[Modules] Updated DBforPostgreSQL flexibleServers to new dependencies approach #1877
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
Merged
AlexanderSehr
merged 19 commits into
main
from
users/alsehr/1791_DBforPostgreSQL_flexibleServers
Oct 17, 2022
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
709054c
Initial draft
AlexanderSehr 937b51d
Updated Postgre Flexible Servers to new dependency approach
AlexanderSehr e629ecc
Shortened names
AlexanderSehr a8cdd06
Updated readme
AlexanderSehr 9f569d5
Update to latest
AlexanderSehr e38db3f
Adjusted name
AlexanderSehr b299d9e
Merge branch 'main' into users/alsehr/1791_DBforPostgreSQL_flexibleSe…
AlexanderSehr f4733d3
Update to latest
AlexanderSehr 9cb125a
Update to latest
AlexanderSehr 321d261
Update modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/de…
AlexanderSehr 5d732e2
Update modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/privat…
AlexanderSehr fec1575
Update modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public…
AlexanderSehr 1da413b
Update to latest
AlexanderSehr 1f5a00d
Update modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/privat…
AlexanderSehr d701ced
Update modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/de…
AlexanderSehr 9a2f95c
Addressed comments
AlexanderSehr 3ec0c23
Addressed comments
AlexanderSehr 1c79f5e
Merge branch 'main' into users/alsehr/1791_DBforPostgreSQL_flexibleSe…
AlexanderSehr efe3560
Update to latest
AlexanderSehr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min.parameters.json
This file was deleted.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| targetScope = 'subscription' | ||
|
|
||
| // ========== // | ||
| // Parameters // | ||
| // ========== // | ||
| @description('Optional. The name of the resource group to deploy for testing purposes.') | ||
| @maxLength(90) | ||
| param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceShort}-rg' | ||
|
|
||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = deployment().location | ||
|
|
||
| @description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') | ||
| param serviceShort string = 'dfpsfsmin' | ||
|
|
||
| @description('Optional. The password to leverage for the login.') | ||
| @secure() | ||
| param password string = newGuid() | ||
|
|
||
| // =========== // | ||
| // Deployments // | ||
| // =========== // | ||
|
|
||
| // General resources | ||
| // ================= | ||
| resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { | ||
| name: resourceGroupName | ||
| location: location | ||
| } | ||
|
|
||
| // ============== // | ||
| // Test Execution // | ||
| // ============== // | ||
|
|
||
| module testDeployment '../../deploy.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name)}-test-${serviceShort}' | ||
| params: { | ||
| name: '<<namePrefix>>${serviceShort}001' | ||
| administratorLogin: 'adminUserName' | ||
| administratorLoginPassword: password | ||
| skuName: 'Standard_B2s' | ||
| tier: 'Burstable' | ||
| } | ||
| } |
76 changes: 0 additions & 76 deletions
76
modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private.parameters.json
This file was deleted.
Oops, something went wrong.
66 changes: 66 additions & 0 deletions
66
modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| @description('Optional. The location to deploy to.') | ||
| param location string = resourceGroup().location | ||
|
|
||
| @description('Required. The name of the Virtual Network to create.') | ||
| param virtualNetworkName string | ||
|
|
||
| @description('Required. The name of the Managed Identity to create.') | ||
| param managedIdentityName string | ||
|
|
||
| resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = { | ||
| name: virtualNetworkName | ||
| location: location | ||
| properties: { | ||
| addressSpace: { | ||
| addressPrefixes: [ | ||
| '10.0.0.0/24' | ||
| ] | ||
| } | ||
| subnets: [ | ||
| { | ||
| name: 'defaultSubnet' | ||
| properties: { | ||
| addressPrefix: '10.0.0.0/24' | ||
| delegations: [ | ||
| { | ||
| name: 'Microsoft.DBforPostgreSQL.flexibleServers' | ||
| properties: { | ||
| serviceName: 'Microsoft.DBforPostgreSQL/flexibleServers' | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| resource privateDNSZone 'Microsoft.Network/privateDnsZones@2020-06-01' = { | ||
| name: 'postgres.database.azure.com' | ||
| location: 'global' | ||
|
|
||
| resource virtualNetworkLinks 'virtualNetworkLinks@2020-06-01' = { | ||
| name: '${virtualNetwork.name}-vnetlink' | ||
| location: 'global' | ||
| properties: { | ||
| virtualNetwork: { | ||
| id: virtualNetwork.id | ||
| } | ||
| registrationEnabled: false | ||
| } | ||
| } | ||
| } | ||
|
|
||
| resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { | ||
| name: managedIdentityName | ||
| location: location | ||
| } | ||
|
|
||
| @description('The resource ID of the created Virtual Network Subnet.') | ||
| output subnetResourceId string = virtualNetwork.properties.subnets[0].id | ||
|
|
||
| @description('The resource ID of the created Private DNS Zone.') | ||
| output privateDNSResourceId string = privateDNSZone.id | ||
|
|
||
| @description('The principal ID of the created Managed Identity.') | ||
| output managedIdentityPrincipalId string = managedIdentity.properties.principalId |
98 changes: 98 additions & 0 deletions
98
modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| targetScope = 'subscription' | ||
|
|
||
| // ========== // | ||
| // Parameters // | ||
| // ========== // | ||
| @description('Optional. The name of the resource group to deploy for testing purposes.') | ||
| @maxLength(90) | ||
| param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceShort}-rg' | ||
|
|
||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = deployment().location | ||
|
|
||
| @description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') | ||
eriqua marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| param serviceShort string = 'dfpsfspvt' | ||
|
|
||
| @description('Optional. The password to leverage for the login.') | ||
| @secure() | ||
| param password string = newGuid() | ||
|
|
||
| // =========== // | ||
| // Deployments // | ||
| // =========== // | ||
|
|
||
| // General resources | ||
| // ================= | ||
| resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { | ||
| name: resourceGroupName | ||
| location: location | ||
| } | ||
|
|
||
| module resourceGroupResources 'dependencies.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name, location)}-paramNested' | ||
| params: { | ||
| virtualNetworkName: 'dep-<<namePrefix>>-vnet-${serviceShort}' | ||
| managedIdentityName: 'dep-<<namePrefix>>-msi-${serviceShort}' | ||
| } | ||
| } | ||
|
|
||
| // Diagnostics | ||
| // =========== | ||
| module diagnosticDependencies '../../../../.shared/dependencyConstructs/diagnostic.dependencies.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name, location)}-diagnosticDependencies' | ||
| params: { | ||
| storageAccountName: 'dep<<namePrefix>>diasa${serviceShort}01' | ||
| logAnalyticsWorkspaceName: 'dep-<<namePrefix>>-law-${serviceShort}' | ||
| eventHubNamespaceEventHubName: 'dep-<<namePrefix>>-evh-${serviceShort}' | ||
| eventHubNamespaceName: 'dep-<<namePrefix>>-evhns-${serviceShort}' | ||
| location: location | ||
| } | ||
| } | ||
|
|
||
| // ============== // | ||
| // Test Execution // | ||
| // ============== // | ||
|
|
||
| module testDeployment '../../deploy.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name)}-test-${serviceShort}' | ||
| params: { | ||
| name: '<<namePrefix>>${serviceShort}001' | ||
| administratorLogin: 'adminUserName' | ||
| administratorLoginPassword: password | ||
| skuName: 'Standard_D2s_v3' | ||
| tier: 'GeneralPurpose' | ||
| configurations: [ | ||
| { | ||
| name: 'log_min_messages' | ||
| source: 'user-override' | ||
| value: 'INFO' | ||
| } | ||
| { | ||
| name: 'autovacuum_naptime' | ||
| source: 'user-override' | ||
| value: '80' | ||
| } | ||
| ] | ||
| databases: [ | ||
| { | ||
| charset: 'UTF8' | ||
| collation: 'en_US.utf8' | ||
| name: 'testdb1' | ||
| } | ||
| { | ||
| name: 'testdb2' | ||
| } | ||
| ] | ||
| delegatedSubnetResourceId: resourceGroupResources.outputs.subnetResourceId | ||
| diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId | ||
| diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId | ||
| diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId | ||
| diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName | ||
| diagnosticLogsRetentionInDays: 7 | ||
| geoRedundantBackup: 'Enabled' | ||
| privateDnsZoneArmResourceId: resourceGroupResources.outputs.privateDNSResourceId | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.