From 5f36d2b6a6113126a631599338ec36472dfcea0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Gergely?= Date: Thu, 1 Aug 2024 15:23:20 +0200 Subject: [PATCH] CDPCP-12573 - Documentation for datahub_azure_cluster uses AWS VM sizes in the example --- .../cdp_datahub_azure_cluster/resource.tf | 68 +++++++++---------- resources/datahub/converter.go | 2 +- 2 files changed, 33 insertions(+), 37 deletions(-) diff --git a/examples/resources/cdp_datahub_azure_cluster/resource.tf b/examples/resources/cdp_datahub_azure_cluster/resource.tf index 04daff47..903fc237 100644 --- a/examples/resources/cdp_datahub_azure_cluster/resource.tf +++ b/examples/resources/cdp_datahub_azure_cluster/resource.tf @@ -11,79 +11,79 @@ resource "cdp_datahub_azure_cluster" "azure-cluster" { name = "" environment = "" - cluster_template = "7.2.15 - Data Engineering: Apache Spark, Apache Hive, Apache Oozie" - cluster_definition = "7.2.15 - Data Engineering for Azure" + cluster_template = "7.2.18 - Data Engineering: Apache Spark, Apache Hive, Apache Oozie" + cluster_definition = "7.2.18 - Data Engineering for Azure" /* The below section kept here as a working example if one would like to use the cluster creation w/o the usage of the cluster definition - /*instance_group = [ + instance_group = [ { - node_count = 0 - instance_group_name = "gateway" + node_count = 3 + instance_group_name = "worker" instance_group_type = "CORE" - instance_type = "m5.2xlarge" - root_volume_size = 100 + instance_type = "Standard_D16s_v3" + root_volume_size = 200 attached_volume_configuration = [ { - volume_size = 100 + volume_size = 100 volume_count = 1 - volume_type = "gp3" + volume_type = "StandardSSD_LRS" } ] - recovery_mode = "MANUAL" volume_encryption = { encryption = false } - recipes = [] + recovery_mode = "MANUAL" + recipes = [] }, { - node_count = 1 + node_count = 1 instance_group_name = "master" instance_group_type = "GATEWAY" - instance_type = "m5.4xlarge" - root_volume_size = 100 + instance_type = "Standard_D16s_v3" + root_volume_size = 200 attached_volume_configuration = [ { - volume_size = 100 + volume_size = 100 volume_count = 1 - volume_type = "gp3" + volume_type = "StandardSSD_LRS" } ] - recovery_mode = "MANUAL" volume_encryption = { encryption = false } - recipes = [] + recovery_mode = "MANUAL" + recipes = [] }, { - node_count = 3 - instance_group_name = "worker" - instance_group_type = "CORE" - instance_type = "r5d.2xlarge" - root_volume_size = 100 + node_count = 1 + instance_group_name = "compute" + instance_group_type = "CORE" + instance_type = "Standard_D16s_v3" + root_volume_size = 100 + recovery_mode = "MANUAL" attached_volume_configuration = [ { - volume_size = 300 + volume_size = 100 volume_count = 1 - volume_type = "gp3" + volume_type = "StandardSSD_LRS" } ] - recovery_mode = "MANUAL" volume_encryption = { encryption = false } recipes = [] }, { - node_count = 3 - instance_group_name = "compute" + node_count = 0 + instance_group_name = "gateway" instance_group_type = "CORE" - instance_type = "r5d.2xlarge" - root_volume_size = 100 + instance_type = "Standard_D8s_v3" + root_volume_size = 200 attached_volume_configuration = [ { - volume_size = 300 + volume_size = 300 volume_count = 1 - volume_type = "ephemeral" + volume_type = "StandardSSD_LRS" } ] recovery_mode = "MANUAL" @@ -160,10 +160,6 @@ output "recovery_mode" { value = cdp_datahub_azure_cluster.azure-cluster.instance_group[*].recovery_mode } -output "volume_encryption" { - value = cdp_datahub_azure_cluster.azure-cluster.instance_group[*].volume_encryption -} - output "encryption" { value = cdp_datahub_azure_cluster.azure-cluster.instance_group[*].volume_encryption.encryption }*/ \ No newline at end of file diff --git a/resources/datahub/converter.go b/resources/datahub/converter.go index b1b378c8..0a3c6a47 100644 --- a/resources/datahub/converter.go +++ b/resources/datahub/converter.go @@ -187,7 +187,7 @@ func fromModelToAzureRequest(model azureDatahubResourceModel, ctx context.Contex tflog.Debug(ctx, fmt.Sprintf("%d instance group found in the input model.", len(model.InstanceGroup))) for _, group := range model.InstanceGroup { tflog.Debug(ctx, fmt.Sprintf("Converting InstanceGroupRequest: %+v.", group)) - var volReqs []*datahubmodels.AttachedVolumeRequest + volReqs := make([]*datahubmodels.AttachedVolumeRequest, 0) tflog.Debug(ctx, fmt.Sprintf("%d attached volume request found in the input model.", len(model.InstanceGroup))) for _, vrs := range group.AttachedVolumeConfiguration { tflog.Debug(ctx, fmt.Sprintf("Converting AttachedVolumeConfiguration: %+v.", vrs))