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

Cleaned up compute modules & added output descriptions #421

Merged
merged 10 commits into from
Nov 6, 2021
Merged
8 changes: 6 additions & 2 deletions arm/Microsoft.Compute/availabilitySets/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ resource availabilitySet 'Microsoft.Compute/availabilitySets@2021-04-01' = {
properties: {
platformFaultDomainCount: availabilitySetFaultDomain
platformUpdateDomainCount: availabilitySetUpdateDomain
proximityPlacementGroup: (empty(proximityPlacementGroupId) ? json('null') : proximityPlacementGroupId)
proximityPlacementGroup: !empty(proximityPlacementGroupId) ? proximityPlacementGroupId : null
}
sku: {
name: availabilitySetSku
Expand All @@ -56,7 +56,7 @@ resource availabilitySet_lock 'Microsoft.Authorization/locks@2016-09-01' = if (l
name: '${availabilitySet.name}-${lock}-lock'
properties: {
level: lock
notes: (lock == 'CanNotDelete') ? 'Cannot delete resource or child resources.' : 'Cannot modify the resource or child resources.'
notes: lock == 'CanNotDelete' ? 'Cannot delete resource or child resources.' : 'Cannot modify the resource or child resources.'
}
scope: availabilitySet
}
Expand All @@ -69,6 +69,10 @@ module availabilitySet_rbac '.bicep/nested_rbac.bicep' = [for (roleAssignment, i
}
}]

@description('The resource group the availability set was deployed into')
output availabilitySetResourceName string = availabilitySet.name

@description('The resourceId of the availability set')
output availabilitySetResourceId string = availabilitySet.id
@description('The name of the availability set')
output availabilitySetResourceGroup string = resourceGroup().name
10 changes: 5 additions & 5 deletions arm/Microsoft.Compute/availabilitySets/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ Tag names and tag values can be provided as needed. A tag can be left without a

## Outputs

| Output Name | Type |
| :-- | :-- |
| `availabilitySetResourceGroup` | string |
| `availabilitySetResourceId` | string |
| `availabilitySetResourceName` | string |
| Output Name | Type | Description |
| :-- | :-- | :-- |
| `availabilitySetResourceGroup` | string | The name of the availability set |
| `availabilitySetResourceId` | string | The resourceId of the availability set |
| `availabilitySetResourceName` | string | The resource group the availability set was deployed into |

## Template references

Expand Down
16 changes: 12 additions & 4 deletions arm/Microsoft.Compute/diskEncryptionSets/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ param tags object = {}
@description('Optional. Customer Usage Attribution id (GUID). This GUID must be previously registered')
param cuaId string = ''

var keyVaultName = last(split(keyVaultId, '/'))

module pid_cuaId '.bicep/nested_cuaId.bicep' = if (!empty(cuaId)) {
name: 'pid-${cuaId}'
params: {}
}

resource keyVaultAccessPolicies 'Microsoft.KeyVault/vaults/accessPolicies@2019-09-01' = {
name: '${keyVaultName}/add'
name: '${last(split(keyVaultId, '/'))}/add'
properties: {
accessPolicies: [
{
Expand Down Expand Up @@ -72,7 +70,17 @@ module diskEncryptionSet_rbac '.bicep/nested_rbac.bicep' = [for (roleAssignment,
}
}]

@description('The resourceId of the disk encryption set')
output diskEncryptionSetResourceId string = diskEncryptionSet.id

@description('The name of the disk encryption set')
output diskEncryptionSetName string = diskEncryptionSet.name

@description('The principal Id of the disk encryption set')
output principalId string = reference('Microsoft.Compute/diskEncryptionSets/${diskEncryptionSetName}', '2020-12-01', 'Full').identity.principalId
output keyVaultName string = keyVaultName

@description('The name of the key vault with the disk encryption key')
output keyVaultName string = last(split(keyVaultId, '/'))

@description('The resource group the disk encryption set was deployed into')
output diskEncryptionResourceGroup string = resourceGroup().name
13 changes: 7 additions & 6 deletions arm/Microsoft.Compute/diskEncryptionSets/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ Tag names and tag values can be provided as needed. A tag can be left without a

## Outputs

| Output Name | Type |
| :-- | :-- |
| `diskEncryptionResourceGroup` | string |
| `diskEncryptionSetResourceId` | string |
| `keyVaultName` | string |
| `principalId` | string |
| Output Name | Type | Description |
| :-- | :-- | :-- |
| `diskEncryptionResourceGroup` | string | The resource group the disk encryption set was deployed into |
| `diskEncryptionSetName` | string | The name of the disk encryption set |
| `diskEncryptionSetResourceId` | string | The resourceId of the disk encryption set |
| `keyVaultName` | string | The name of the key vault with the disk encryption key |
| `principalId` | string | The principal Id of the disk encryption set |

## Template references

Expand Down
5 changes: 5 additions & 0 deletions arm/Microsoft.Compute/images/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ module image_rbac '.bicep/nested_rbac.bicep' = [for (roleAssignment, index) in r
}
}]

@description('The resourceId of the image')
output imageResourceId string = image.id

@description('The resource group the image was deployed into')
output imageResourceGroup string = resourceGroup().name

@description('The name of the image')
output imageName string = image.name
10 changes: 5 additions & 5 deletions arm/Microsoft.Compute/images/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ Tag names and tag values can be provided as needed. A tag can be left without a

## Outputs

| Output Name | Type |
| :-- | :-- |
| `imageName` | string |
| `imageResourceGroup` | string |
| `imageResourceId` | string |
| Output Name | Type | Description |
| :-- | :-- | :-- |
| `imageName` | string | The name of the image |
| `imageResourceGroup` | string | The resource group the image was deployed into |
| `imageResourceId` | string | The resourceId of the image |

## Template references

Expand Down
9 changes: 7 additions & 2 deletions arm/Microsoft.Compute/proximityPlacementGroups/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ resource proximityPlacementGroup_lock 'Microsoft.Authorization/locks@2016-09-01'
name: '${proximityPlacementGroup.name}-${lock}-lock'
properties: {
level: lock
notes: (lock == 'CanNotDelete') ? 'Cannot delete resource or child resources.' : 'Cannot modify the resource or child resources.'
notes: lock == 'CanNotDelete' ? 'Cannot delete resource or child resources.' : 'Cannot modify the resource or child resources.'
}
scope: proximityPlacementGroup
}
Expand All @@ -59,6 +59,11 @@ module proximityPlacementGroup_rbac '.bicep/nested_rbac.bicep' = [for (roleAssig
}
}]

output proximityPlacementGroupResourceName string = proximityPlacementGroup.name
@description('The name of the proximity placement group')
output proximityPlacementGroupName string = proximityPlacementGroup.name

@description('The resourceId the proximity placement group')
output proximityPlacementGroupResourceId string = proximityPlacementGroup.id

@description('The resource group the proximity placement group was deployed into')
output proximityPlacementGroupResourceGroup string = resourceGroup().name
10 changes: 5 additions & 5 deletions arm/Microsoft.Compute/proximityPlacementGroups/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ Tag names and tag values can be provided as needed. A tag can be left without a

## Outputs

| Output Name | Type |
| :-- | :-- |
| `proximityPlacementGroupResourceGroup` | string |
| `proximityPlacementGroupResourceId` | string |
| `proximityPlacementGroupResourceName` | string |
| Output Name | Type | Description |
| :-- | :-- | :-- |
| `proximityPlacementGroupName` | string | The name of the proximity placement group |
| `proximityPlacementGroupResourceGroup` | string | The resource group the proximity placement group was deployed into |
| `proximityPlacementGroupResourceId` | string | The resourceId the proximity placement group |

## Template references

Expand Down
Loading