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

[Modules] SQLMI Added min param #1892

Merged
merged 4 commits into from
Sep 5, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"value": "<<namePrefix>>-az-sqlmi-min-002"
"value": "<<namePrefix>>-az-sqlmi-min-001"
},
"administratorLogin": {
"reference": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"value": "<<namePrefix>>-az-sqlmi-x-002"
"value": "<<namePrefix>>-az-sqlmi-x-001"
},
"lock": {
"value": "CanNotDelete"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ resource administrator 'Microsoft.Sql/managedInstances/administrators@2022-02-01
}
}

@description('The name of the deployed managed instance.')
@description('The name of the deployed managed instance administrator.')
output name string = administrator.name

@description('The resource ID of the deployed managed instance.')
@description('The resource ID of the deployed managed instance administrator.')
output resourceId string = administrator.id

@description('The resource group of the deployed managed instance.')
@description('The resource group of the deployed managed instance administrator.')
output resourceGroupName string = resourceGroup().name
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ This module deploys an administrator for the SQL managed instance

| Output Name | Type | Description |
| :-- | :-- | :-- |
| `name` | string | The name of the deployed managed instance. |
| `resourceGroupName` | string | The resource group of the deployed managed instance. |
| `resourceId` | string | The resource ID of the deployed managed instance. |
| `name` | string | The name of the deployed managed instance administrator. |
| `resourceGroupName` | string | The resource group of the deployed managed instance administrator. |
| `resourceId` | string | The resource ID of the deployed managed instance administrator. |

## Cross-referenced modules

Expand Down
16 changes: 8 additions & 8 deletions modules/Microsoft.Sql/managedInstances/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,14 @@ resource managedInstance 'Microsoft.Sql/managedInstances@2022-02-01-preview' = {
vCores: vCores
storageSizeInGB: storageSizeInGB
collation: collation
dnsZonePartner: dnsZonePartner
dnsZonePartner: !empty(dnsZonePartner) ? dnsZonePartner : null
publicDataEndpointEnabled: publicDataEndpointEnabled
sourceManagedInstanceId: sourceManagedInstanceId
restorePointInTime: restorePointInTime
sourceManagedInstanceId: !empty(sourceManagedInstanceId) ? sourceManagedInstanceId : null
restorePointInTime: !empty(restorePointInTime) ? restorePointInTime : null
proxyOverride: proxyOverride
timezoneId: timezoneId
instancePoolId: instancePoolResourceId
primaryUserAssignedIdentityId: primaryUserAssignedIdentityId
instancePoolId: !empty(instancePoolResourceId) ? instancePoolResourceId : null
primaryUserAssignedIdentityId: !empty(primaryUserAssignedIdentityId) ? primaryUserAssignedIdentityId : null
requestedBackupStorageRedundancy: requestedBackupStorageRedundancy
zoneRedundant: zoneRedundant
servicePrincipal: {
Expand Down Expand Up @@ -339,11 +339,11 @@ module managedInstance_vulnerabilityAssessment 'vulnerabilityAssessments/deploy.
]
}

module managedInstance_key 'keys/deploy.bicep' = [for (key, index) in keys: {
module managedInstance_keys 'keys/deploy.bicep' = [for (key, index) in keys: {
name: '${uniqueString(deployment().name, location)}-SqlMi-Key-${index}'
params: {
name: key.name
managedInstanceName: managedInstance.name
name: contains(key, 'name') ? key.name : ''
serverKeyType: contains(key, 'serverKeyType') ? key.serverKeyType : 'ServiceManaged'
uri: contains(key, 'uri') ? key.uri : ''
enableDefaultTelemetry: enableReferencedModulesTelemetry
Expand All @@ -354,7 +354,7 @@ module managedInstance_encryptionProtector 'encryptionProtector/deploy.bicep' =
name: '${uniqueString(deployment().name, location)}-SqlMi-EncryProtector'
params: {
managedInstanceName: managedInstance.name
serverKeyName: contains(encryptionProtectorObj, 'serverKeyName') ? encryptionProtectorObj.serverKeyName : managedInstance_key[0].outputs.name
serverKeyName: encryptionProtectorObj.serverKeyName
name: contains(encryptionProtectorObj, 'name') ? encryptionProtectorObj.serverKeyType : 'current'
serverKeyType: contains(encryptionProtectorObj, 'serverKeyType') ? encryptionProtectorObj.serverKeyType : 'ServiceManaged'
autoRotationEnabled: contains(encryptionProtectorObj, 'autoRotationEnabled') ? encryptionProtectorObj.autoRotationEnabled : true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ resource encryptionProtector 'Microsoft.Sql/managedInstances/encryptionProtector
}
}

@description('The name of the deployed managed instance.')
@description('The name of the deployed managed instance encryption protector.')
output name string = encryptionProtector.name

@description('The resource ID of the deployed managed instance.')
@description('The resource ID of the deployed managed instance encryption protector.')
output resourceId string = encryptionProtector.id

@description('The resource group of the deployed managed instance.')
@description('The resource group of the deployed managed instance encryption protector.')
output resourceGroupName string = resourceGroup().name
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ This module deploys an encryption protector for a SQL managed instance.

| Output Name | Type | Description |
| :-- | :-- | :-- |
| `name` | string | The name of the deployed managed instance. |
| `resourceGroupName` | string | The resource group of the deployed managed instance. |
| `resourceId` | string | The resource ID of the deployed managed instance. |
| `name` | string | The name of the deployed managed instance encryption protector. |
| `resourceGroupName` | string | The resource group of the deployed managed instance encryption protector. |
| `resourceId` | string | The resource ID of the deployed managed instance encryption protector. |

## Cross-referenced modules

Expand Down
10 changes: 5 additions & 5 deletions modules/Microsoft.Sql/managedInstances/keys/deploy.bicep
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@description('Optional. The name of the key. Must follow the [<keyVaultName>_<keyName>_<keyVersion>] pattern.')
param name string = ''
@description('Required. The name of the key. Must follow the [<keyVaultName>_<keyName>_<keyVersion>] pattern.')
param name string

@description('Conditional. The name of the parent SQL managed instance. Required if the template is used in a standalone deployment.')
param managedInstanceName string
Expand Down Expand Up @@ -48,11 +48,11 @@ resource key 'Microsoft.Sql/managedInstances/keys@2022-02-01-preview' = {
}
}

@description('The name of the deployed managed instance.')
@description('The name of the deployed managed instance key.')
output name string = key.name

@description('The resource ID of the deployed managed instance.')
@description('The resource ID of the deployed managed instance key.')
output resourceId string = key.id

@description('The resource group of the deployed managed instance.')
@description('The resource group of the deployed managed instance key.')
output resourceGroupName string = resourceGroup().name
12 changes: 8 additions & 4 deletions modules/Microsoft.Sql/managedInstances/keys/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ This module deploys a key for a SQL managed instance.

## Parameters

**Required parameters**
| Parameter Name | Type | Description |
| :-- | :-- | :-- |
| `name` | string | The name of the key. Must follow the [<keyVaultName>_<keyName>_<keyVersion>] pattern. |

**Conditional parameters**
| Parameter Name | Type | Description |
| :-- | :-- | :-- |
Expand All @@ -26,7 +31,6 @@ This module deploys a key for a SQL managed instance.
| Parameter Name | Type | Default Value | Allowed Values | Description |
| :-- | :-- | :-- | :-- | :-- |
| `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via the Customer Usage Attribution ID (GUID). |
| `name` | string | `''` | | The name of the key. Must follow the [<keyVaultName>_<keyName>_<keyVersion>] pattern. |
| `serverKeyType` | string | `'ServiceManaged'` | `[AzureKeyVault, ServiceManaged]` | The encryption protector type like "ServiceManaged", "AzureKeyVault". |
| `uri` | string | `''` | | The URI of the key. If the ServerKeyType is AzureKeyVault, then either the URI or the keyVaultName/keyName combination is required. |

Expand All @@ -35,9 +39,9 @@ This module deploys a key for a SQL managed instance.

| Output Name | Type | Description |
| :-- | :-- | :-- |
| `name` | string | The name of the deployed managed instance. |
| `resourceGroupName` | string | The resource group of the deployed managed instance. |
| `resourceId` | string | The resource ID of the deployed managed instance. |
| `name` | string | The name of the deployed managed instance key. |
| `resourceGroupName` | string | The resource group of the deployed managed instance key. |
| `resourceId` | string | The resource ID of the deployed managed instance key. |

## Cross-referenced modules

Expand Down
8 changes: 4 additions & 4 deletions modules/Microsoft.Sql/managedInstances/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ module managedInstances './Microsoft.Sql/managedInstances/deploy.bicep' = {
// Required parameters
administratorLogin: kv1.getSecret('administratorLogin')
administratorLoginPassword: kv1.getSecret('administratorLoginPassword')
name: '<<namePrefix>>-az-sqlmi-min-002'
name: '<<namePrefix>>-az-sqlmi-min-001'
subnetId: '/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<<namePrefix>>-az-vnet-x-sqlmi/subnets/<<namePrefix>>-az-subnet-x-sqlmi'
}
}
Expand Down Expand Up @@ -337,7 +337,7 @@ module managedInstances './Microsoft.Sql/managedInstances/deploy.bicep' = {
}
},
"name": {
"value": "<<namePrefix>>-az-sqlmi-min-002"
"value": "<<namePrefix>>-az-sqlmi-min-001"
},
"subnetId": {
"value": "/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<<namePrefix>>-az-vnet-x-sqlmi/subnets/<<namePrefix>>-az-subnet-x-sqlmi"
Expand Down Expand Up @@ -366,7 +366,7 @@ module managedInstances './Microsoft.Sql/managedInstances/deploy.bicep' = {
params: {
administratorLogin: kv1.getSecret('administratorLogin')
administratorLoginPassword: kv1.getSecret('administratorLoginPassword')
name: '<<namePrefix>>-az-sqlmi-x-002'
name: '<<namePrefix>>-az-sqlmi-x-001'
subnetId: '/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<<namePrefix>>-az-vnet-x-sqlmi/subnets/<<namePrefix>>-az-subnet-x-sqlmi'
collation: 'SQL_Latin1_General_CP1_CI_AS'
databases: [
Expand Down Expand Up @@ -469,7 +469,7 @@ module managedInstances './Microsoft.Sql/managedInstances/deploy.bicep' = {
}
},
"name": {
"value": "<<namePrefix>>-az-sqlmi-x-002"
"value": "<<namePrefix>>-az-sqlmi-x-001"
},
"subnetId": {
"value": "/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<<namePrefix>>-az-vnet-x-sqlmi/subnets/<<namePrefix>>-az-subnet-x-sqlmi"
Expand Down