Skip to content

Commit

Permalink
Add more options to override the default values (#16)
Browse files Browse the repository at this point in the history
* change resource namespace to lower case

* add more options to override the default value

* fmt and doc
  • Loading branch information
duzitong authored Sep 27, 2024
1 parent 1e54abb commit 429e94e
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,14 @@ Type: `string`

Default: `"TLS1_2"`

### <a name="input_naming_prefix"></a> [naming\_prefix](#input\_naming\_prefix)

Description: The naming prefix in HCI deployment settings. Site id will be used if not provided.

Type: `string`

Default: `""`

### <a name="input_operation_type"></a> [operation\_type](#input\_operation\_type)

Description: The intended operation for a cluster.
Expand Down
2 changes: 1 addition & 1 deletion deploy.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "azapi_update_resource" "deploymentsetting" {
count = var.is_exported ? 0 : 1

type = "Microsoft.AzureStackHCI/clusters/deploymentSettings@2024-04-01"
type = "microsoft.azurestackhci/clusters/deploymentSettings@2024-04-01"
body = {
properties = {
deploymentMode = "Deploy"
Expand Down
6 changes: 3 additions & 3 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ locals {
storage = {
configurationMode = var.configuration_mode
}
namingPrefix = var.site_id
namingPrefix = var.naming_prefix == "" ? var.site_id : var.naming_prefix
domainFqdn = var.domain_fqdn
infrastructureNetwork = [{
useDhcp = false
Expand All @@ -68,10 +68,10 @@ locals {
enableStorageAutoIp = true
intents = local.converged ? local.converged_intents : local.seperate_intents
storageNetworks = local.storage_networks
storageConnectivitySwitchless = false
storageConnectivitySwitchless = var.storage_connectivity_switchless
}
adouPath = var.adou_path
secretsLocation = var.use_legacy_key_vault_model ? local.secrets_location : null
secretsLocation = var.use_legacy_key_vault_model ? local.secrets_location : (var.secrets_location == "" ? null : var.secrets_location)
secrets = var.use_legacy_key_vault_model ? null : [
{
secretName = "${var.name}-AzureStackLCMUserCredential"
Expand Down
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ data "azapi_resource" "customlocation" {

data "azapi_resource_list" "user_storages" {
parent_id = data.azurerm_resource_group.rg.id
type = "Microsoft.AzureStackHCI/storagecontainers@2022-12-15-preview"
type = "microsoft.azurestackhci/storagecontainers@2022-12-15-preview"
response_export_values = ["*"]

depends_on = [azapi_update_resource.deploymentsetting]
}

data "azapi_resource" "arc_settings" {
type = "Microsoft.AzureStackHCI/clusters/ArcSettings@2024-04-01"
type = "microsoft.azurestackhci/clusters/ArcSettings@2024-04-01"
name = "default"
parent_id = azapi_resource.cluster.id

depends_on = [azapi_update_resource.deploymentsetting]
}

resource "azapi_resource" "cluster" {
type = "Microsoft.AzureStackHCI/clusters@2024-04-01"
type = "microsoft.azurestackhci/clusters@2024-04-01"
body = {
properties = {}
}
Expand Down
2 changes: 1 addition & 1 deletion validate.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ data "azurerm_arc_machine" "arcservers" {
}

resource "azapi_resource" "validatedeploymentsetting" {
type = "Microsoft.AzureStackHCI/clusters/deploymentSettings@2024-04-01"
type = "microsoft.azurestackhci/clusters/deploymentSettings@2024-04-01"
body = {
properties = local.deployment_setting_properties_omit_null
}
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,12 @@ variable "min_tls_version" {
description = "The minimum TLS version."
}

variable "naming_prefix" {
type = string
default = ""
description = "The naming prefix in HCI deployment settings. Site id will be used if not provided."
}

variable "operation_type" {
type = string
default = "ClusterProvisioning"
Expand Down

0 comments on commit 429e94e

Please sign in to comment.