Skip to content

Commit

Permalink
Renamed illegal parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Agazoth committed May 14, 2024
1 parent 4dbb100 commit 0440973
Showing 1 changed file with 64 additions and 67 deletions.
131 changes: 64 additions & 67 deletions avm/res/document-db/database-account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ var virtualNetworkRules = [
}
]

var databaseAccount_properties = union(
var databaseAccountProperties = union(
{
databaseAccountOfferType: databaseAccountOfferType
},
Expand Down Expand Up @@ -308,45 +308,43 @@ var builtInRoleNames = {
)
}

resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' =
if (enableTelemetry) {
name: '46d3xbcp.res.documentdb-databaseaccount.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
outputs: {
telemetry: {
type: 'String'
value: 'For more information, see https://aka.ms/avm/TelemetryInfo'
}
resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = if (enableTelemetry) {
name: '46d3xbcp.res.documentdb-databaseaccount.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
outputs: {
telemetry: {
type: 'String'
value: 'For more information, see https://aka.ms/avm/TelemetryInfo'
}
}
}
}
}

resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts@2023-04-15' = {
name: name
location: location
tags: tags
identity: identity
kind: kind
properties: databaseAccount_properties
properties: databaseAccountProperties
}

resource databaseAccount_lock 'Microsoft.Authorization/locks@2020-05-01' =
if (!empty(lock ?? {}) && lock.?kind != 'None') {
name: lock.?name ?? 'lock-${name}'
properties: {
level: lock.?kind ?? ''
notes: lock.?kind == 'CanNotDelete'
? 'Cannot delete resource or child resources.'
: 'Cannot delete or modify the resource or child resources.'
}
scope: databaseAccount
resource databaseAccount_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!empty(lock ?? {}) && lock.?kind != 'None') {
name: lock.?name ?? 'lock-${name}'
properties: {
level: lock.?kind ?? ''
notes: lock.?kind == 'CanNotDelete'
? 'Cannot delete resource or child resources.'
: 'Cannot delete or modify the resource or child resources.'
}
scope: databaseAccount
}

resource databaseAccount_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = [
for (diagnosticSetting, index) in (diagnosticSettings ?? []): {
Expand Down Expand Up @@ -490,49 +488,48 @@ module databaseAccount_privateEndpoints 'br/public:avm/res/network/private-endpo
}
]

module keyVault 'modules/secrets-key-vault.bicep' =
if (secretsKeyVault != null) {
name: '${uniqueString(deployment().name, location)}-secrets-kv'
scope: resourceGroup(secretsKeyVault.?resourceGroupName ?? resourceGroup().name)
params: {
keyVaultName: secretsKeyVault!.keyVaultName
module keyVault 'modules/secrets-key-vault.bicep' = if (secretsKeyVault != null) {
name: '${uniqueString(deployment().name, location)}-secrets-kv'
scope: resourceGroup(secretsKeyVault.?resourceGroupName ?? resourceGroup().name)
params: {
keyVaultName: secretsKeyVault!.keyVaultName

keySecrets: [
{
secretName: secretsKeyVault.?primaryWriteKeySecretName ?? 'Primary-Write-Key'
secretValue: databaseAccount.listKeys().primaryMasterKey
}
{
secretName: secretsKeyVault.?primaryReadOnlyKeySecretName ?? 'Primary-Readonly-Key'
secretValue: databaseAccount.listKeys().primaryReadonlyMasterKey
}
{
secretName: secretsKeyVault.?primaryWriteConnectionStringSecretName ?? 'Primary-Write-ConnectionString'
secretValue: databaseAccount.listConnectionStrings().connectionStrings[0].connectionString
}
{
secretName: secretsKeyVault.?primaryReadonlyConnectionStringSecretName ?? 'Primary-Readonly-ConnectionString'
secretValue: databaseAccount.listConnectionStrings().connectionStrings[2].connectionString
}
{
secretName: secretsKeyVault.?secondaryWriteKeySecretName ?? 'Secondary-Write-Key'
secretValue: databaseAccount.listKeys().secondaryMasterKey
}
{
secretName: secretsKeyVault.?secondaryReadonlyKeySecretName ?? 'Secondary-Readonly-Key'
secretValue: databaseAccount.listKeys().secondaryReadonlyMasterKey
}
{
secretName: secretsKeyVault.?secondaryWriteConnectionStringSecretName ?? 'Secondary-Write-ConnectionString'
secretValue: databaseAccount.listConnectionStrings().connectionStrings[1].connectionString
}
{
secretName: secretsKeyVault.?secondaryReadonlyConnectionStringSecretName ?? 'Secondary-Readonly-ConnectionString'
secretValue: databaseAccount.listConnectionStrings().connectionStrings[3].connectionString
}
]
}
keySecrets: [
{
secretName: secretsKeyVault.?primaryWriteKeySecretName ?? 'Primary-Write-Key'
secretValue: databaseAccount.listKeys().primaryMasterKey
}
{
secretName: secretsKeyVault.?primaryReadOnlyKeySecretName ?? 'Primary-Readonly-Key'
secretValue: databaseAccount.listKeys().primaryReadonlyMasterKey
}
{
secretName: secretsKeyVault.?primaryWriteConnectionStringSecretName ?? 'Primary-Write-ConnectionString'
secretValue: databaseAccount.listConnectionStrings().connectionStrings[0].connectionString
}
{
secretName: secretsKeyVault.?primaryReadonlyConnectionStringSecretName ?? 'Primary-Readonly-ConnectionString'
secretValue: databaseAccount.listConnectionStrings().connectionStrings[2].connectionString
}
{
secretName: secretsKeyVault.?secondaryWriteKeySecretName ?? 'Secondary-Write-Key'
secretValue: databaseAccount.listKeys().secondaryMasterKey
}
{
secretName: secretsKeyVault.?secondaryReadonlyKeySecretName ?? 'Secondary-Readonly-Key'
secretValue: databaseAccount.listKeys().secondaryReadonlyMasterKey
}
{
secretName: secretsKeyVault.?secondaryWriteConnectionStringSecretName ?? 'Secondary-Write-ConnectionString'
secretValue: databaseAccount.listConnectionStrings().connectionStrings[1].connectionString
}
{
secretName: secretsKeyVault.?secondaryReadonlyConnectionStringSecretName ?? 'Secondary-Readonly-ConnectionString'
secretValue: databaseAccount.listConnectionStrings().connectionStrings[3].connectionString
}
]
}
}

@description('The name of the database account.')
output name string = databaseAccount.name
Expand Down

0 comments on commit 0440973

Please sign in to comment.