Skip to content

Commit

Permalink
Add outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
oZakari committed Dec 4, 2024
1 parent f959a9d commit b6c6ab3
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 1 deletion.
22 changes: 22 additions & 0 deletions avm/res/kusto/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ module cluster 'br/public:avm/res/kusto/cluster:<version>' = {
name: 'kcmin0001'
sku: 'Standard_E2ads_v5'
// Non-required parameters
enableDiskEncryption: true
location: '<location>'
managedIdentities: {
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
}
}
```
Expand All @@ -80,8 +86,18 @@ module cluster 'br/public:avm/res/kusto/cluster:<version>' = {
"value": "Standard_E2ads_v5"
},
// Non-required parameters
"enableDiskEncryption": {
"value": true
},
"location": {
"value": "<location>"
},
"managedIdentities": {
"value": {
"userAssignedResourceIds": [
"<managedIdentityResourceId>"
]
}
}
}
}
Expand All @@ -101,7 +117,13 @@ using 'br/public:avm/res/kusto/cluster:<version>'
param name = 'kcmin0001'
param sku = 'Standard_E2ads_v5'
// Non-required parameters
param enableDiskEncryption = true
param location = '<location>'
param managedIdentities = {
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
```

</details>
Expand Down
2 changes: 2 additions & 0 deletions avm/res/kusto/cluster/database/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,7 @@ The time the data should be kept before it stops being accessible to queries in

| Output | Type | Description |
| :-- | :-- | :-- |
| `databaseName` | string | The name of the Kusto Cluster database. |
| `databaseNameReadOnly` | string | The name of the Kusto Cluster read-only following database. |
| `databaseNameReadWrite` | string | The name of the Kusto Cluster read-write database. |
| `databaseResourceId` | string | The resource ID of the Kusto Cluster database. |
16 changes: 15 additions & 1 deletion avm/res/kusto/cluster/database/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.31.92.45157",
"templateHash": "5637706943386839627"
"templateHash": "10830246380792132320"
},
"name": "Kusto Cluster Databases",
"description": "This module deploys a Kusto Cluster Database.",
Expand Down Expand Up @@ -136,6 +136,20 @@
}
},
"outputs": {
"databaseName": {
"type": "string",
"metadata": {
"description": "The name of the Kusto Cluster database."
},
"value": "[parameters('name')]"
},
"databaseResourceId": {
"type": "string",
"metadata": {
"description": "The resource ID of the Kusto Cluster database."
},
"value": "[if(equals(parameters('databaseKind'), 'ReadWrite'), resourceId('Microsoft.Kusto/clusters/databases', parameters('kustoClusterName'), parameters('name')), resourceId('Microsoft.Kusto/clusters/databases', parameters('kustoClusterName'), parameters('name')))]"
},
"databaseNameReadOnly": {
"type": "string",
"metadata": {
Expand Down
19 changes: 19 additions & 0 deletions avm/res/kusto/cluster/tests/e2e/defaults/dependencies.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@description('Required. The location to deploy resources to.')
param location string = resourceGroup().location

@description('Required. The name of the managed identity to create.')
param managedIdentityName string

resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
name: managedIdentityName
location: location
}

@description('The resource ID of the created Managed Identity.')
output managedIdentityResourceId string = managedIdentity.id

@description('The principal ID of the created Managed Identity.')
output managedIdentityPrincipalId string = managedIdentity.properties.principalId

@description('The client ID of the created Managed Identity.')
output managedIdentityClientId string = managedIdentity.properties.clientId
16 changes: 16 additions & 0 deletions avm/res/kusto/cluster/tests/e2e/defaults/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2024-03-01' = {
location: resourceLocation
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-paramNested'
params: {
location: resourceLocation
managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}'
// entraIdGroupName: 'dep-${namePrefix}-group-${serviceShort}'
}
}

// ============== //
// Test Execution //
// ============== //
Expand All @@ -44,6 +54,12 @@ module testDeployment '../../../main.bicep' = [
name: '${namePrefix}${serviceShort}0001'
location: resourceLocation
sku: 'Standard_E2ads_v5'
enableDiskEncryption: true
managedIdentities: {
userAssignedResourceIds: [
nestedDependencies.outputs.managedIdentityResourceId
]
}
}
}
]

0 comments on commit b6c6ab3

Please sign in to comment.