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

feat: add output customLocationName for azure-stack-hci cluster #4460

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions avm/res/azure-stack-hci/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,7 @@ Specify whether to use the shared key vault for the HCI cluster.

| Output | Type | Description |
| :-- | :-- | :-- |
| `customLocationName` | string | The name of the custom location. |
| `location` | string | The location of the cluster. |
| `name` | string | The name of the cluster. |
| `resourceGroupName` | string | The resource group of the cluster. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.33.13.18514",
"templateHash": "10232132824907554113"
"version": "0.32.4.45862",
"templateHash": "6382378749701959727"
},
"name": "Azure Stack HCI Cluster Deployment Settings",
"description": "This module deploys an Azure Stack HCI Cluster Deployment Settings resource."
Expand Down
3 changes: 3 additions & 0 deletions avm/res/azure-stack-hci/cluster/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ output systemAssignedMIPrincipalId string = cluster.identity.principalId
@description('The location of the cluster.')
output location string = cluster.location

@description('The name of the custom location.')
output customLocationName string = deploymentSettings!.customLocationName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that this will very likely fail if one deploys the cluster without deployment settings (which are, afterall, optional)
It might be better to use a syntax like

Suggested change
output customLocationName string = deploymentSettings!.customLocationName
output customLocationName string? = (deploymentSettings ?? {}).?customLocationName


// =============== //
// Definitions //
// =============== //
Expand Down
15 changes: 11 additions & 4 deletions avm/res/azure-stack-hci/cluster/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.33.13.18514",
"templateHash": "2800706656796817324"
"version": "0.32.4.45862",
"templateHash": "5314620534728853638"
},
"name": "Azure Stack HCI Cluster",
"description": "This module deploys an Azure Stack HCI Cluster on the provided Arc Machines."
Expand Down Expand Up @@ -837,8 +837,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.33.13.18514",
"templateHash": "10232132824907554113"
"version": "0.32.4.45862",
"templateHash": "6382378749701959727"
},
"name": "Azure Stack HCI Cluster Deployment Settings",
"description": "This module deploys an Azure Stack HCI Cluster Deployment Settings resource."
Expand Down Expand Up @@ -1268,6 +1268,13 @@
"description": "The location of the cluster."
},
"value": "[reference('cluster', '2024-04-01', 'full').location]"
},
"customLocationName": {
"type": "string",
"metadata": {
"description": "The name of the custom location."
},
"value": "[parameters('deploymentSettings').customLocationName]"
}
}
}