diff --git a/.changelog/3486.txt b/.changelog/3486.txt new file mode 100644 index 0000000000..ad1b251417 --- /dev/null +++ b/.changelog/3486.txt @@ -0,0 +1,23 @@ +```release-note:new-data-source +tencentcloud_dlc_data_engine_network +``` + +```release-note:new-data-source +tencentcloud_dlc_data_engine_session_parameters +``` + +```release-note:new-data-source +tencentcloud_dlc_session_image_version +``` + +```release-note:new-resource +tencentcloud_dlc_update_engine_resource_group_network_config_information_operation +``` + +```release-note:new-resource +tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation +``` + +```release-note:new-resource +tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation +``` \ No newline at end of file diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go index 22d7fc8940..5f0dc448df 100644 --- a/tencentcloud/provider.go +++ b/tencentcloud/provider.go @@ -1222,6 +1222,9 @@ func Provider() *schema.Provider { "tencentcloud_dlc_engine_node_specifications": dlc.DataSourceTencentCloudDlcEngineNodeSpecifications(), "tencentcloud_dlc_native_spark_sessions": dlc.DataSourceTencentCloudDlcNativeSparkSessions(), "tencentcloud_dlc_standard_engine_resource_group_config_information": dlc.DataSourceTencentCloudDlcStandardEngineResourceGroupConfigInformation(), + "tencentcloud_dlc_data_engine_network": dlc.DataSourceTencentCloudDlcDataEngineNetwork(), + "tencentcloud_dlc_data_engine_session_parameters": dlc.DataSourceTencentCloudDlcDataEngineSessionParameters(), + "tencentcloud_dlc_session_image_version": dlc.DataSourceTencentCloudDlcSessionImageVersion(), "tencentcloud_bi_project": bi.DataSourceTencentCloudBiProject(), "tencentcloud_bi_user_project": bi.DataSourceTencentCloudBiUserProject(), "tencentcloud_antiddos_basic_device_status": antiddos.DataSourceTencentCloudAntiddosBasicDeviceStatus(), @@ -2237,6 +2240,9 @@ func Provider() *schema.Provider { "tencentcloud_dlc_bind_work_groups_to_user_attachment": dlc.ResourceTencentCloudDlcBindWorkGroupsToUserAttachment(), "tencentcloud_dlc_update_row_filter_operation": dlc.ResourceTencentCloudDlcUpdateRowFilterOperation(), "tencentcloud_dlc_user_data_engine_config": dlc.ResourceTencentCloudDlcUserDataEngineConfig(), + "tencentcloud_dlc_update_engine_resource_group_network_config_information_operation": dlc.ResourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperation(), + "tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation": dlc.ResourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperation(), + "tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation": dlc.ResourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperation(), "tencentcloud_waf_custom_rule": waf.ResourceTencentCloudWafCustomRule(), "tencentcloud_waf_custom_white_rule": waf.ResourceTencentCloudWafCustomWhiteRule(), "tencentcloud_waf_clb_domain": waf.ResourceTencentCloudWafClbDomain(), diff --git a/tencentcloud/provider.md b/tencentcloud/provider.md index 231667d1ce..7a2c3bbbda 100644 --- a/tencentcloud/provider.md +++ b/tencentcloud/provider.md @@ -2141,6 +2141,9 @@ tencentcloud_dlc_task_result tencentcloud_dlc_engine_node_specifications tencentcloud_dlc_native_spark_sessions tencentcloud_dlc_standard_engine_resource_group_config_information +tencentcloud_dlc_data_engine_network +tencentcloud_dlc_data_engine_session_parameters +tencentcloud_dlc_session_image_version Resource tencentcloud_dlc_work_group @@ -2160,6 +2163,9 @@ tencentcloud_dlc_upgrade_data_engine_image_operation tencentcloud_dlc_user_data_engine_config tencentcloud_dlc_update_row_filter_operation tencentcloud_dlc_bind_work_groups_to_user_attachment +tencentcloud_dlc_update_engine_resource_group_network_config_information_operation +tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation +tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation Web Application Firewall(WAF) Data Source diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network.go b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network.go new file mode 100644 index 0000000000..636ead6fb3 --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network.go @@ -0,0 +1,295 @@ +package dlc + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudDlcDataEngineNetwork() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudDlcDataEngineNetworkRead, + Schema: map[string]*schema.Schema{ + "sort_by": { + Type: schema.TypeString, + Optional: true, + Description: "Sort Field.", + }, + + "sorting": { + Type: schema.TypeString, + Optional: true, + Description: "Sort order, asc or desc.", + }, + + "filters": { + Type: schema.TypeList, + Optional: true, + Description: "Filter conditions are optional, engine-network-id--engine network ID, engine-network-state--engine network status.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Attribute name, if there are multiple filters, the relationship between filters is a logical OR relationship.", + }, + "values": { + Type: schema.TypeList, + Required: true, + Description: "Attribute value, if there are multiple values, the relationship between values is a logical OR relationship.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + + "engine_networks_infos": { + Type: schema.TypeList, + Computed: true, + Description: "Engine network information list.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "engine_network_name": { + Type: schema.TypeString, + Optional: true, + Description: "Engine network name.", + }, + "engine_network_state": { + Type: schema.TypeInt, + Required: true, + Description: "Engine network status, 0--initialized, 2--available, -1--deleted.", + }, + "engine_network_cidr": { + Type: schema.TypeString, + Optional: true, + Description: "Engine network CIDR.", + }, + "engine_network_id": { + Type: schema.TypeString, + Optional: true, + Description: "Engine network ID.", + }, + "create_time": { + Type: schema.TypeInt, + Optional: true, + Description: "Creation time.", + }, + "update_time": { + Type: schema.TypeInt, + Optional: true, + Description: "Update time.", + }, + "private_link_number": { + Type: schema.TypeInt, + Optional: true, + Description: "Number of private links.", + }, + "engine_number": { + Type: schema.TypeInt, + Optional: true, + Description: "Number of engines.", + }, + "gate_way_info": { + Type: schema.TypeList, + Optional: true, + Description: "Gateway information list.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "gateway_id": { + Type: schema.TypeString, + Optional: true, + Description: "Gateway ID.", + }, + "gateway_name": { + Type: schema.TypeString, + Optional: true, + Description: "Gateway name.", + }, + "size": { + Type: schema.TypeInt, + Optional: true, + Description: "Gateway size.", + }, + "state": { + Type: schema.TypeInt, + Optional: true, + Description: "Gateway status: -1--Failed, -2--Deleted, 0--Init,1--Pause, 2--running, 3--ToBeDeleted, 4--Deleting, 5--Pausing, 6--Resuming, 7--Isolating, 8--Isolated, 9--Renewing, 10--Modifying, 11--Modified, 12--Restoring, 13--Restored, 14--ToBeRestored.", + }, + "pay_mode": { + Type: schema.TypeInt, + Optional: true, + Description: "Pay mode.", + }, + "mode": { + Type: schema.TypeInt, + Optional: true, + Description: "Gateway mode.", + }, + }, + }, + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudDlcDataEngineNetworkRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_dlc_data_engine_network.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(nil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = DlcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + ) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOk("sort_by"); ok { + paramMap["SortBy"] = helper.String(v.(string)) + } + + if v, ok := d.GetOk("sorting"); ok { + paramMap["Sorting"] = helper.String(v.(string)) + } + + if v, ok := d.GetOk("filters"); ok { + filtersSet := v.([]interface{}) + tmpSet := make([]*dlcv20210125.Filter, 0, len(filtersSet)) + for _, item := range filtersSet { + filtersMap := item.(map[string]interface{}) + filter := dlcv20210125.Filter{} + if v, ok := filtersMap["name"].(string); ok && v != "" { + filter.Name = helper.String(v) + } + + if v, ok := filtersMap["values"]; ok { + valuesSet := v.([]interface{}) + for i := range valuesSet { + values := valuesSet[i].(string) + filter.Values = append(filter.Values, helper.String(values)) + } + } + + tmpSet = append(tmpSet, &filter) + } + + paramMap["Filters"] = tmpSet + } + + var respData []*dlcv20210125.EngineNetworkInfo + reqErr := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeDlcDataEngineNetworkByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + respData = result + return nil + }) + + if reqErr != nil { + return reqErr + } + + engineNetworkInfosList := make([]map[string]interface{}, 0, len(respData)) + if respData != nil { + for _, engineNetworkInfos := range respData { + engineNetworkInfosMap := map[string]interface{}{} + if engineNetworkInfos.EngineNetworkName != nil { + engineNetworkInfosMap["engine_network_name"] = engineNetworkInfos.EngineNetworkName + } + + if engineNetworkInfos.EngineNetworkState != nil { + engineNetworkInfosMap["engine_network_state"] = engineNetworkInfos.EngineNetworkState + } + + if engineNetworkInfos.EngineNetworkCidr != nil { + engineNetworkInfosMap["engine_network_cidr"] = engineNetworkInfos.EngineNetworkCidr + } + + if engineNetworkInfos.EngineNetworkId != nil { + engineNetworkInfosMap["engine_network_id"] = engineNetworkInfos.EngineNetworkId + } + + if engineNetworkInfos.CreateTime != nil { + engineNetworkInfosMap["create_time"] = engineNetworkInfos.CreateTime + } + + if engineNetworkInfos.UpdateTime != nil { + engineNetworkInfosMap["update_time"] = engineNetworkInfos.UpdateTime + } + + if engineNetworkInfos.PrivateLinkNumber != nil { + engineNetworkInfosMap["private_link_number"] = engineNetworkInfos.PrivateLinkNumber + } + + if engineNetworkInfos.EngineNumber != nil { + engineNetworkInfosMap["engine_number"] = engineNetworkInfos.EngineNumber + } + + gateWayInfoList := make([]map[string]interface{}, 0, len(engineNetworkInfos.GateWayInfo)) + if engineNetworkInfos.GateWayInfo != nil { + for _, gateWayInfo := range engineNetworkInfos.GateWayInfo { + gateWayInfoMap := map[string]interface{}{} + + if gateWayInfo.GatewayId != nil { + gateWayInfoMap["gateway_id"] = gateWayInfo.GatewayId + } + + if gateWayInfo.GatewayName != nil { + gateWayInfoMap["gateway_name"] = gateWayInfo.GatewayName + } + + if gateWayInfo.Size != nil { + gateWayInfoMap["size"] = gateWayInfo.Size + } + + if gateWayInfo.State != nil { + gateWayInfoMap["state"] = gateWayInfo.State + } + + if gateWayInfo.PayMode != nil { + gateWayInfoMap["pay_mode"] = gateWayInfo.PayMode + } + + if gateWayInfo.Mode != nil { + gateWayInfoMap["mode"] = gateWayInfo.Mode + } + + gateWayInfoList = append(gateWayInfoList, gateWayInfoMap) + } + + engineNetworkInfosMap["gate_way_info"] = gateWayInfoList + } + + engineNetworkInfosList = append(engineNetworkInfosList, engineNetworkInfosMap) + } + + _ = d.Set("engine_network_infos", engineNetworkInfosList) + } + + d.SetId(helper.BuildToken()) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), engineNetworkInfosList); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network.md b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network.md new file mode 100644 index 0000000000..2b013f8b6f --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network.md @@ -0,0 +1,14 @@ +Use this data source to query detailed information of DLC data engine network + +Example Usage + +```hcl +data "tencentcloud_dlc_data_engine_network" "example" { + sort_by = "create-time" + sorting = "desc" + filters { + name = "engine-network-id" + values = ["DataEngine_Network-g1sxyw8v"] + } +} +``` diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network_test.go b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network_test.go new file mode 100644 index 0000000000..c34b001471 --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network_test.go @@ -0,0 +1,36 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcDataEngineNetworkDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccDlcDataEngineNetworkDataSource, + Check: resource.ComposeTestCheckFunc( + tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_dlc_data_engine_network.example"), + ), + }}, + }) +} + +const testAccDlcDataEngineNetworkDataSource = ` +data "tencentcloud_dlc_data_engine_network" "example" { + sort_by = "create-time" + sorting = "desc" + filters { + name = "engine-network-id" + values = ["DataEngine_Network-g1sxyw8v"] + } +} +` diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters.go b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters.go new file mode 100644 index 0000000000..4b969dea5c --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters.go @@ -0,0 +1,239 @@ +package dlc + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudDlcDataEngineSessionParameters() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudDlcDataEngineSessionParametersRead, + Schema: map[string]*schema.Schema{ + "data_engine_id": { + Type: schema.TypeString, + Required: true, + Description: "DataEngine Id.", + }, + + "data_engine_name": { + Type: schema.TypeString, + Optional: true, + Description: "Engine name. When the engine name is specified, the name is used first to obtain the configuration.", + }, + + "data_engine_parameters": { + Type: schema.TypeList, + Computed: true, + Description: "Engine Session Configuration List.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "parameter_id": { + Type: schema.TypeString, + Required: true, + Description: "Configuration ID.", + }, + "child_image_version_id": { + Type: schema.TypeString, + Required: true, + Description: "Minor version image ID.", + }, + "engine_type": { + Type: schema.TypeString, + Required: true, + Description: "Cluster type: SparkSQL/PrestoSQL/SparkBatch.", + }, + "key_name": { + Type: schema.TypeString, + Required: true, + Description: "Parameter key.", + }, + "key_description": { + Type: schema.TypeString, + Required: true, + Description: "Description of the key.", + }, + "value_type": { + Type: schema.TypeString, + Required: true, + Description: "Type of the value.", + }, + "value_length_limit": { + Type: schema.TypeString, + Required: true, + Description: "Length limit of the value.", + }, + "value_regexp_limit": { + Type: schema.TypeString, + Required: true, + Description: "Regular expression constraint for the value.", + }, + "value_default": { + Type: schema.TypeString, + Required: true, + Description: "Default value.", + }, + "is_public": { + Type: schema.TypeInt, + Required: true, + Description: "Whether it is a public version: 1 for public; 2 for private.", + }, + "parameter_type": { + Type: schema.TypeInt, + Required: true, + Description: "Configuration type: 1 for session config (default); 2 for common config; 3 for cluster config.", + }, + "submit_method": { + Type: schema.TypeString, + Required: true, + Description: "Submission method: User or BackGround.", + }, + "operator": { + Type: schema.TypeString, + Required: true, + Description: "Operator.", + }, + "insert_time": { + Type: schema.TypeString, + Required: true, + Description: "Insert time.", + }, + "update_time": { + Type: schema.TypeString, + Required: true, + Description: "Update time.", + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudDlcDataEngineSessionParametersRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_dlc_data_engine_session_parameters.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(nil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = DlcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + dataEngineId string + ) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOk("data_engine_id"); ok { + paramMap["DataEngineId"] = helper.String(v.(string)) + dataEngineId = v.(string) + } + + if v, ok := d.GetOk("data_engine_name"); ok { + paramMap["DataEngineName"] = helper.String(v.(string)) + } + + var respData []*dlcv20210125.DataEngineImageSessionParameter + reqErr := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeDlcDataEngineSessionParametersByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + respData = result + return nil + }) + + if reqErr != nil { + return reqErr + } + + dataEngineParametersList := make([]map[string]interface{}, 0, len(respData)) + if respData != nil { + for _, dataEngineParameters := range respData { + dataEngineParametersMap := map[string]interface{}{} + if dataEngineParameters.ParameterId != nil { + dataEngineParametersMap["parameter_id"] = dataEngineParameters.ParameterId + } + + if dataEngineParameters.ChildImageVersionId != nil { + dataEngineParametersMap["child_image_version_id"] = dataEngineParameters.ChildImageVersionId + } + + if dataEngineParameters.EngineType != nil { + dataEngineParametersMap["engine_type"] = dataEngineParameters.EngineType + } + + if dataEngineParameters.KeyName != nil { + dataEngineParametersMap["key_name"] = dataEngineParameters.KeyName + } + + if dataEngineParameters.KeyDescription != nil { + dataEngineParametersMap["key_description"] = dataEngineParameters.KeyDescription + } + + if dataEngineParameters.ValueType != nil { + dataEngineParametersMap["value_type"] = dataEngineParameters.ValueType + } + + if dataEngineParameters.ValueLengthLimit != nil { + dataEngineParametersMap["value_length_limit"] = dataEngineParameters.ValueLengthLimit + } + + if dataEngineParameters.ValueRegexpLimit != nil { + dataEngineParametersMap["value_regexp_limit"] = dataEngineParameters.ValueRegexpLimit + } + + if dataEngineParameters.ValueDefault != nil { + dataEngineParametersMap["value_default"] = dataEngineParameters.ValueDefault + } + + if dataEngineParameters.IsPublic != nil { + dataEngineParametersMap["is_public"] = dataEngineParameters.IsPublic + } + + if dataEngineParameters.ParameterType != nil { + dataEngineParametersMap["parameter_type"] = dataEngineParameters.ParameterType + } + + if dataEngineParameters.SubmitMethod != nil { + dataEngineParametersMap["submit_method"] = dataEngineParameters.SubmitMethod + } + + if dataEngineParameters.Operator != nil { + dataEngineParametersMap["operator"] = dataEngineParameters.Operator + } + + if dataEngineParameters.InsertTime != nil { + dataEngineParametersMap["insert_time"] = dataEngineParameters.InsertTime + } + + if dataEngineParameters.UpdateTime != nil { + dataEngineParametersMap["update_time"] = dataEngineParameters.UpdateTime + } + + dataEngineParametersList = append(dataEngineParametersList, dataEngineParametersMap) + } + + _ = d.Set("data_engine_parameters", dataEngineParametersList) + } + + d.SetId(dataEngineId) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), dataEngineParametersList); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters.md b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters.md new file mode 100644 index 0000000000..aab22d9bd5 --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters.md @@ -0,0 +1,9 @@ +Use this data source to query detailed information of DLC data engine session parameters + +Example Usage + +```hcl +data "tencentcloud_dlc_data_engine_session_parameters" "example" { + data_engine_id = "DataEngine-public-1308726196" +} +``` diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters_test.go b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters_test.go new file mode 100644 index 0000000000..cb4de62555 --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters_test.go @@ -0,0 +1,31 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcDataEngineSessionParametersDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccDlcDataEngineSessionParametersDataSource, + Check: resource.ComposeTestCheckFunc( + tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_dlc_data_engine_session_parameters.dlc_data_engine_session_parameters"), + ), + }}, + }) +} + +const testAccDlcDataEngineSessionParametersDataSource = ` +data "tencentcloud_dlc_data_engine_session_parameters" "example" { + data_engine_id = "DataEngine-public-1308726196" +} +` diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version.go b/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version.go new file mode 100644 index 0000000000..9197ade3be --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version.go @@ -0,0 +1,140 @@ +package dlc + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudDlcSessionImageVersion() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudDlcSessionImageVersionRead, + Schema: map[string]*schema.Schema{ + "data_engine_id": { + Type: schema.TypeString, + Required: true, + Description: "Data engine ID.", + }, + + "framework_type": { + Type: schema.TypeString, + Required: true, + Description: "Framework type: machine learning, Python, Spark ML.", + }, + + "engine_session_images": { + Type: schema.TypeList, + Computed: true, + Description: "Engine session image information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "spark_image_id": { + Type: schema.TypeString, + Required: true, + Description: "Spark image ID.", + }, + "spark_image_version": { + Type: schema.TypeString, + Required: true, + Description: "Spark image version.", + }, + "spark_image_type": { + Type: schema.TypeInt, + Required: true, + Description: "Small version image type. 1: TensorFlow, 2: Pytorch, 3: SK-learn.", + }, + "spark_image_tag": { + Type: schema.TypeString, + Required: true, + Description: "Spark image tag.", + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudDlcSessionImageVersionRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_dlc_session_image_version.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(nil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = DlcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + dataEngineId string + ) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOk("data_engine_id"); ok { + paramMap["DataEngineId"] = helper.String(v.(string)) + dataEngineId = v.(string) + } + + if v, ok := d.GetOk("framework_type"); ok { + paramMap["FrameworkType"] = helper.String(v.(string)) + } + + var respData []*dlcv20210125.EngineSessionImage + reqErr := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeDlcSessionImageVersionByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + respData = result + return nil + }) + + if reqErr != nil { + return reqErr + } + + engineSessionImagesList := make([]map[string]interface{}, 0, len(respData)) + if respData != nil { + for _, engineSessionImages := range respData { + engineSessionImagesMap := map[string]interface{}{} + if engineSessionImages.SparkImageId != nil { + engineSessionImagesMap["spark_image_id"] = engineSessionImages.SparkImageId + } + + if engineSessionImages.SparkImageVersion != nil { + engineSessionImagesMap["spark_image_version"] = engineSessionImages.SparkImageVersion + } + + if engineSessionImages.SparkImageType != nil { + engineSessionImagesMap["spark_image_type"] = engineSessionImages.SparkImageType + } + + if engineSessionImages.SparkImageTag != nil { + engineSessionImagesMap["spark_image_tag"] = engineSessionImages.SparkImageTag + } + + engineSessionImagesList = append(engineSessionImagesList, engineSessionImagesMap) + } + + _ = d.Set("engine_session_images", engineSessionImagesList) + } + + d.SetId(dataEngineId) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), engineSessionImagesList); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version.md b/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version.md new file mode 100644 index 0000000000..2e5050713d --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version.md @@ -0,0 +1,10 @@ +Use this data source to query detailed information of DLC session image version + +Example Usage + +```hcl +data "tencentcloud_dlc_session_image_version" "example" { + data_engine_id = "DataEngine-e482ijv6" + framework_type = "machine-learning" +} +``` diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version_test.go b/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version_test.go new file mode 100644 index 0000000000..9497a17b78 --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version_test.go @@ -0,0 +1,32 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcSessionImageVersionDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccDlcSessionImageVersionDataSource, + Check: resource.ComposeTestCheckFunc( + tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_dlc_session_image_version.example"), + ), + }}, + }) +} + +const testAccDlcSessionImageVersionDataSource = ` +data "tencentcloud_dlc_session_image_version" "example" { + data_engine_id = "DataEngine-e482ijv6" + framework_type = "machine-learning" +} +` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.go b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.go new file mode 100644 index 0000000000..07da74858c --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.go @@ -0,0 +1,141 @@ +package dlc + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperation() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationCreate, + Read: resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationRead, + Delete: resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationDelete, + Schema: map[string]*schema.Schema{ + "engine_resource_group_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Engine resource group ID.", + }, + + "network_config_names": { + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Description: "A collection of network configuration names bound to the resource group.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_engine_resource_group_network_config_information_operation.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = dlcv20210125.NewUpdateEngineResourceGroupNetworkConfigInfoRequest() + engineResourceGroupId string + ) + + if v, ok := d.GetOk("engine_resource_group_id"); ok { + request.EngineResourceGroupId = helper.String(v.(string)) + engineResourceGroupId = v.(string) + } + + if v, ok := d.GetOk("network_config_names"); ok { + networkConfigNamesSet := v.(*schema.Set).List() + for i := range networkConfigNamesSet { + networkConfigNames := networkConfigNamesSet[i].(string) + request.NetworkConfigNames = append(request.NetworkConfigNames, helper.String(networkConfigNames)) + } + } + + request.IsEffectiveNow = helper.IntInt64(0) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().UpdateEngineResourceGroupNetworkConfigInfoWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create dlc update engine resource group network config information operation failed, reason:%+v", logId, reqErr) + return reqErr + } + + d.SetId(engineResourceGroupId) + + // wait + waitReq := dlcv20210125.NewDescribeStandardEngineResourceGroupsRequest() + waitReq.Filters = []*dlcv20210125.Filter{ + { + Name: helper.String("engine-resource-group-id"), + Values: helper.Strings([]string{engineResourceGroupId}), + }, + } + reqErr = resource.Retry(tccommon.ReadRetryTimeout*7, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().DescribeStandardEngineResourceGroupsWithContext(ctx, waitReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Describe standard engine resource groups failed, Response is nil.")) + } + + if result.Response.UserEngineResourceGroupInfos == nil || len(result.Response.UserEngineResourceGroupInfos) == 0 { + return resource.NonRetryableError(fmt.Errorf("UserEngineResourceGroupInfos is nil.")) + } + + if result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState == nil { + return resource.NonRetryableError(fmt.Errorf("ResourceGroupState is nil.")) + } + + resourceGroupState := result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState + if *resourceGroupState == 2 { + return nil + } + + return resource.RetryableError(fmt.Errorf("ResourceGroupState is not running, current state is %d...", *resourceGroupState)) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s describe standard engine resource groups failed,, reason:%+v", logId, reqErr) + return reqErr + } + + return resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationRead(d, meta) +} + +func resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_engine_resource_group_network_config_information_operation.read")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} + +func resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_engine_resource_group_network_config_information_operation.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.md b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.md new file mode 100644 index 0000000000..f4658c3bed --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.md @@ -0,0 +1,9 @@ +Provides a resource to create a DLC update engine resource group network config information operation + +Example Usage + +```hcl +resource "tencentcloud_dlc_update_engine_resource_group_network_config_information_operation" "example" { + engine_resource_group_id = "rg-b6fxxxxxx2a0" +} +``` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation_test.go b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation_test.go new file mode 100644 index 0000000000..8ea2f51d7e --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation_test.go @@ -0,0 +1,33 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDlcUpdateEngineResourceGroupNetworkConfigInformationOperation, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_dlc_update_engine_resource_group_network_config_information_operation.example", "id"), + ), + }, + }, + }) +} + +const testAccDlcUpdateEngineResourceGroupNetworkConfigInformationOperation = ` +resource "tencentcloud_dlc_update_engine_resource_group_network_config_information_operation" "example" { + engine_resource_group_id = "rg-b6fxxxxxx2a0" +} +` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.go b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.go new file mode 100644 index 0000000000..f41af1860c --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.go @@ -0,0 +1,199 @@ +package dlc + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperation() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationCreate, + Read: resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationRead, + Delete: resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationDelete, + Schema: map[string]*schema.Schema{ + "engine_resource_group_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Engine resource group name.", + }, + + "update_conf_context": { + Type: schema.TypeList, + Required: true, + ForceNew: true, + Description: "Configuration that needs to be updated.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "config_type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Parameter type, optional: StaticConfigType, DynamicConfigType.", + }, + "params": { + Type: schema.TypeList, + Required: true, + Description: "Configuration array of parameters.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "config_item": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Parameter key.", + }, + "config_value": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Parameter value.", + }, + "operate": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Send operations, support: ADD, DELETE, MODIFY.", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = dlcv20210125.NewUpdateStandardEngineResourceGroupConfigInfoRequest() + engineResourceGroupName string + ) + + if v, ok := d.GetOk("engine_resource_group_name"); ok { + request.EngineResourceGroupName = helper.String(v.(string)) + engineResourceGroupName = v.(string) + } + + if v, ok := d.GetOk("update_conf_context"); ok { + for _, item := range v.([]interface{}) { + updateConfContextMap := item.(map[string]interface{}) + updateConfContext := dlcv20210125.UpdateConfContext{} + if v, ok := updateConfContextMap["config_type"].(string); ok && v != "" { + updateConfContext.ConfigType = helper.String(v) + } + + if v, ok := updateConfContextMap["params"]; ok { + for _, item := range v.([]interface{}) { + paramsMap := item.(map[string]interface{}) + param := dlcv20210125.Param{} + if v, ok := paramsMap["config_item"].(string); ok && v != "" { + param.ConfigItem = helper.String(v) + } + + if v, ok := paramsMap["config_value"].(string); ok && v != "" { + param.ConfigValue = helper.String(v) + } + + if v, ok := paramsMap["operate"].(string); ok && v != "" { + param.Operate = helper.String(v) + } + + updateConfContext.Params = append(updateConfContext.Params, ¶m) + } + } + + request.UpdateConfContext = append(request.UpdateConfContext, &updateConfContext) + } + } + + request.IsEffectiveNow = helper.IntInt64(0) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().UpdateStandardEngineResourceGroupConfigInfoWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create dlc update standard engine resource group config information operation failed, reason:%+v", logId, reqErr) + return reqErr + } + + d.SetId(engineResourceGroupName) + + // wait + waitReq := dlcv20210125.NewDescribeStandardEngineResourceGroupsRequest() + waitReq.Filters = []*dlcv20210125.Filter{ + { + Name: helper.String("engine-resource-group-name-unique"), + Values: helper.Strings([]string{engineResourceGroupName}), + }, + } + reqErr = resource.Retry(tccommon.ReadRetryTimeout*7, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().DescribeStandardEngineResourceGroupsWithContext(ctx, waitReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Describe standard engine resource groups failed, Response is nil.")) + } + + if result.Response.UserEngineResourceGroupInfos == nil || len(result.Response.UserEngineResourceGroupInfos) == 0 { + return resource.NonRetryableError(fmt.Errorf("UserEngineResourceGroupInfos is nil.")) + } + + if result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState == nil { + return resource.NonRetryableError(fmt.Errorf("ResourceGroupState is nil.")) + } + + resourceGroupState := result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState + if *resourceGroupState == 2 { + return nil + } + + return resource.RetryableError(fmt.Errorf("ResourceGroupState is not running, current state is %d...", *resourceGroupState)) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s describe standard engine resource groups failed,, reason:%+v", logId, reqErr) + return reqErr + } + + return resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationRead(d, meta) +} + +func resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation.read")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} + +func resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.md b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.md new file mode 100644 index 0000000000..4726464c57 --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.md @@ -0,0 +1,17 @@ +Provides a resource to create a DLC update standard engine resource group config information operation + +Example Usage + +```hcl +resource "tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation" "example" { + engine_resource_group_name = "tf-example" + update_conf_context { + config_type = "StaticConfigType" + params { + config_item = "spark.sql.shuffle.partitions" + config_value = "300" + operate = "ADD" + } + } +} +``` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation_test.go b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation_test.go new file mode 100644 index 0000000000..77c1a0964d --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation_test.go @@ -0,0 +1,41 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDlcUpdateStandardEngineResourceGroupConfigInformationOperation, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation.example", "id"), + ), + }, + }, + }) +} + +const testAccDlcUpdateStandardEngineResourceGroupConfigInformationOperation = ` +resource "tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation" "example" { + engine_resource_group_name = "tf-example" + update_conf_context { + config_type = "StaticConfigType" + params { + config_item = "spark.sql.shuffle.partitions" + config_value = "300" + operate = "ADD" + } + } +} +` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.go b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.go new file mode 100644 index 0000000000..0d15fbd35c --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.go @@ -0,0 +1,288 @@ +package dlc + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperation() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationCreate, + Read: resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationRead, + Delete: resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationDelete, + Schema: map[string]*schema.Schema{ + "engine_resource_group_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Engine resource group name.", + }, + + "driver_cu_spec": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Driver CU specifications:\nCurrently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory).", + }, + + "executor_cu_spec": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Executor CU specifications:\nCurrently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory).", + }, + + "min_executor_nums": { + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Description: "Minimum number of executors.", + }, + + "max_executor_nums": { + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Description: "Maximum number of executors.", + }, + + "size": { + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Description: "AI resource group resource limit.", + }, + + "image_type": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Image type, built-in image: built-in, custom image: custom.", + }, + + "image_name": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Image name.", + }, + + "image_version": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Image version, image id.", + }, + + "frame_type": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Framework Type.", + }, + + "public_domain": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Customized mirror domain name.", + }, + + "registry_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Custom image instance id.", + }, + + "region_name": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Customize the image region.", + }, + + "python_cu_spec": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "The resource limit for a Python stand-alone node in a Python resource group must be smaller than the resource limit for the resource group. Small: 1cu Medium: 2cu Large: 4cu Xlarge: 8cu 4xlarge: 16cu 8xlarge: 32cu 16xlarge: 64cu. If the resource type is high memory, add m before the type.", + }, + + "spark_spec_mode": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Only SQL resource group resource configuration mode, fast: fast mode, custom: custom mode.", + }, + + "spark_size": { + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Description: "SQL resource group resource limit only, only used in fast mode.", + }, + }, + } +} + +func resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = dlcv20210125.NewUpdateStandardEngineResourceGroupResourceInfoRequest() + engineResourceGroupName string + ) + + if v, ok := d.GetOk("engine_resource_group_name"); ok { + request.EngineResourceGroupName = helper.String(v.(string)) + engineResourceGroupName = v.(string) + } + + if v, ok := d.GetOk("driver_cu_spec"); ok { + request.DriverCuSpec = helper.String(v.(string)) + } + + if v, ok := d.GetOk("executor_cu_spec"); ok { + request.ExecutorCuSpec = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("min_executor_nums"); ok { + request.MinExecutorNums = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("max_executor_nums"); ok { + request.MaxExecutorNums = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("size"); ok { + request.Size = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOk("image_type"); ok { + request.ImageType = helper.String(v.(string)) + } + + if v, ok := d.GetOk("image_name"); ok { + request.ImageName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("image_version"); ok { + request.ImageVersion = helper.String(v.(string)) + } + + if v, ok := d.GetOk("frame_type"); ok { + request.FrameType = helper.String(v.(string)) + } + + if v, ok := d.GetOk("public_domain"); ok { + request.PublicDomain = helper.String(v.(string)) + } + + if v, ok := d.GetOk("registry_id"); ok { + request.RegistryId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("region_name"); ok { + request.RegionName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("python_cu_spec"); ok { + request.PythonCuSpec = helper.String(v.(string)) + } + + if v, ok := d.GetOk("spark_spec_mode"); ok { + request.SparkSpecMode = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("spark_size"); ok { + request.SparkSize = helper.IntInt64(v.(int)) + } + + request.IsEffectiveNow = helper.IntInt64(0) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().UpdateStandardEngineResourceGroupResourceInfoWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create dlc update standard engine resource group resource information operation failed, reason:%+v", logId, reqErr) + return reqErr + } + + d.SetId(engineResourceGroupName) + + // wait + waitReq := dlcv20210125.NewDescribeStandardEngineResourceGroupsRequest() + waitReq.Filters = []*dlcv20210125.Filter{ + { + Name: helper.String("engine-resource-group-name-unique"), + Values: helper.Strings([]string{engineResourceGroupName}), + }, + } + reqErr = resource.Retry(tccommon.ReadRetryTimeout*7, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().DescribeStandardEngineResourceGroupsWithContext(ctx, waitReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Describe standard engine resource groups failed, Response is nil.")) + } + + if result.Response.UserEngineResourceGroupInfos == nil || len(result.Response.UserEngineResourceGroupInfos) == 0 { + return resource.NonRetryableError(fmt.Errorf("UserEngineResourceGroupInfos is nil.")) + } + + if result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState == nil { + return resource.NonRetryableError(fmt.Errorf("ResourceGroupState is nil.")) + } + + resourceGroupState := result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState + if *resourceGroupState == 2 { + return nil + } + + return resource.RetryableError(fmt.Errorf("ResourceGroupState is not running, current state is %d...", *resourceGroupState)) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s describe standard engine resource groups failed,, reason:%+v", logId, reqErr) + return reqErr + } + + return resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationRead(d, meta) +} + +func resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation.read")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} + +func resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.md b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.md new file mode 100644 index 0000000000..e0981f9341 --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.md @@ -0,0 +1,9 @@ +Provides a resource to create a DLC update standard engine resource group resource information operation + +Example Usage + +```hcl +resource "tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation" "example" { + engine_resource_group_name = "tf-example" +} +``` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation_test.go b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation_test.go new file mode 100644 index 0000000000..8b5de6224a --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation_test.go @@ -0,0 +1,31 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccDlcUpdateStandardEngineResourceGroupResourceInformationOperation, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation.example", "id"), + ), + }}, + }) +} + +const testAccDlcUpdateStandardEngineResourceGroupResourceInformationOperation = ` +resource "tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation" "example" { + engine_resource_group_name = "test" +} +` diff --git a/tencentcloud/services/dlc/service_tencentcloud_dlc.go b/tencentcloud/services/dlc/service_tencentcloud_dlc.go index d2474610a0..a93bddae51 100644 --- a/tencentcloud/services/dlc/service_tencentcloud_dlc.go +++ b/tencentcloud/services/dlc/service_tencentcloud_dlc.go @@ -1120,3 +1120,137 @@ func (me *DlcService) DescribeDlcStandardEngineResourceGroupConfigInformationByF ret = response.Response return } + +func (me *DlcService) DescribeDlcDataEngineNetworkByFilter(ctx context.Context, param map[string]interface{}) (ret []*dlc.EngineNetworkInfo, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = dlc.NewDescribeEngineNetworksRequest() + ) + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + for k, v := range param { + if k == "SortBy" { + request.SortBy = v.(*string) + } + + if k == "Sorting" { + request.Sorting = v.(*string) + } + + if k == "Filters" { + request.Filters = v.([]*dlc.Filter) + } + } + + var ( + offset int64 = 0 + limit int64 = 100 + ) + + for { + request.Offset = &offset + request.Limit = &limit + ratelimit.Check(request.GetAction()) + response, err := me.client.UseDlcClient().DescribeEngineNetworks(request) + if err != nil { + errRet = err + return + } + + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + if response == nil || len(response.Response.EngineNetworkInfos) < 1 { + break + } + + ret = append(ret, response.Response.EngineNetworkInfos...) + if len(response.Response.EngineNetworkInfos) < int(limit) { + break + } + + offset += limit + } + + return +} + +func (me *DlcService) DescribeDlcDataEngineSessionParametersByFilter(ctx context.Context, param map[string]interface{}) (ret []*dlc.DataEngineImageSessionParameter, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = dlc.NewDescribeDataEngineSessionParametersRequest() + ) + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + for k, v := range param { + if k == "DataEngineId" { + request.DataEngineId = v.(*string) + } + + if k == "DataEngineName" { + request.DataEngineName = v.(*string) + } + } + + ratelimit.Check(request.GetAction()) + response, err := me.client.UseDlcClient().DescribeDataEngineSessionParameters(request) + if err != nil { + errRet = err + return + } + + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + if len(response.Response.DataEngineParameters) < 1 { + return + } + + ret = response.Response.DataEngineParameters + return +} + +func (me *DlcService) DescribeDlcSessionImageVersionByFilter(ctx context.Context, param map[string]interface{}) (ret []*dlc.EngineSessionImage, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = dlc.NewDescribeSessionImageVersionRequest() + ) + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + for k, v := range param { + if k == "DataEngineId" { + request.DataEngineId = v.(*string) + } + + if k == "FrameworkType" { + request.FrameworkType = v.(*string) + } + } + + ratelimit.Check(request.GetAction()) + response, err := me.client.UseDlcClient().DescribeSessionImageVersion(request) + if err != nil { + errRet = err + return + } + + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + if len(response.Response.EngineSessionImages) < 1 { + return + } + + ret = response.Response.EngineSessionImages + return +} diff --git a/website/docs/d/dlc_data_engine_network.html.markdown b/website/docs/d/dlc_data_engine_network.html.markdown new file mode 100644 index 0000000000..29f64050d3 --- /dev/null +++ b/website/docs/d/dlc_data_engine_network.html.markdown @@ -0,0 +1,47 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_data_engine_network" +sidebar_current: "docs-tencentcloud-datasource-dlc_data_engine_network" +description: |- + Use this data source to query detailed information of DLC data engine network +--- + +# tencentcloud_dlc_data_engine_network + +Use this data source to query detailed information of DLC data engine network + +## Example Usage + +```hcl +data "tencentcloud_dlc_data_engine_network" "example" { + sort_by = "create-time" + sorting = "desc" + filters { + name = "engine-network-id" + values = ["DataEngine_Network-g1sxyw8v"] + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `filters` - (Optional, List) Filter conditions are optional, engine-network-id--engine network ID, engine-network-state--engine network status. +* `result_output_file` - (Optional, String) Used to save results. +* `sort_by` - (Optional, String) Sort Field. +* `sorting` - (Optional, String) Sort order, asc or desc. + +The `filters` object supports the following: + +* `name` - (Required, String) Attribute name, if there are multiple filters, the relationship between filters is a logical OR relationship. +* `values` - (Required, List) Attribute value, if there are multiple values, the relationship between values is a logical OR relationship. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `engine_networks_infos` - Engine network information list. + + diff --git a/website/docs/d/dlc_data_engine_session_parameters.html.markdown b/website/docs/d/dlc_data_engine_session_parameters.html.markdown new file mode 100644 index 0000000000..78dddc2775 --- /dev/null +++ b/website/docs/d/dlc_data_engine_session_parameters.html.markdown @@ -0,0 +1,36 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_data_engine_session_parameters" +sidebar_current: "docs-tencentcloud-datasource-dlc_data_engine_session_parameters" +description: |- + Use this data source to query detailed information of DLC data engine session parameters +--- + +# tencentcloud_dlc_data_engine_session_parameters + +Use this data source to query detailed information of DLC data engine session parameters + +## Example Usage + +```hcl +data "tencentcloud_dlc_data_engine_session_parameters" "example" { + data_engine_id = "DataEngine-public-1308726196" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `data_engine_id` - (Required, String) DataEngine Id. +* `data_engine_name` - (Optional, String) Engine name. When the engine name is specified, the name is used first to obtain the configuration. +* `result_output_file` - (Optional, String) Used to save results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `data_engine_parameters` - Engine Session Configuration List. + + diff --git a/website/docs/d/dlc_session_image_version.html.markdown b/website/docs/d/dlc_session_image_version.html.markdown new file mode 100644 index 0000000000..e6dadf7c72 --- /dev/null +++ b/website/docs/d/dlc_session_image_version.html.markdown @@ -0,0 +1,37 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_session_image_version" +sidebar_current: "docs-tencentcloud-datasource-dlc_session_image_version" +description: |- + Use this data source to query detailed information of DLC session image version +--- + +# tencentcloud_dlc_session_image_version + +Use this data source to query detailed information of DLC session image version + +## Example Usage + +```hcl +data "tencentcloud_dlc_session_image_version" "example" { + data_engine_id = "DataEngine-e482ijv6" + framework_type = "machine-learning" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `data_engine_id` - (Required, String) Data engine ID. +* `framework_type` - (Required, String) Framework type: machine learning, Python, Spark ML. +* `result_output_file` - (Optional, String) Used to save results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `engine_session_images` - Engine session image information. + + diff --git a/website/docs/r/dlc_update_engine_resource_group_network_config_information_operation.html.markdown b/website/docs/r/dlc_update_engine_resource_group_network_config_information_operation.html.markdown new file mode 100644 index 0000000000..f8198e5e33 --- /dev/null +++ b/website/docs/r/dlc_update_engine_resource_group_network_config_information_operation.html.markdown @@ -0,0 +1,36 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_update_engine_resource_group_network_config_information_operation" +sidebar_current: "docs-tencentcloud-resource-dlc_update_engine_resource_group_network_config_information_operation" +description: |- + Provides a resource to create a DLC update engine resource group network config information operation +--- + +# tencentcloud_dlc_update_engine_resource_group_network_config_information_operation + +Provides a resource to create a DLC update engine resource group network config information operation + +## Example Usage + +```hcl +resource "tencentcloud_dlc_update_engine_resource_group_network_config_information_operation" "example" { + engine_resource_group_id = "rg-b6fxxxxxx2a0" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `engine_resource_group_id` - (Required, String, ForceNew) Engine resource group ID. +* `network_config_names` - (Optional, Set: [`String`], ForceNew) A collection of network configuration names bound to the resource group. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + diff --git a/website/docs/r/dlc_update_standard_engine_resource_group_config_information_operation.html.markdown b/website/docs/r/dlc_update_standard_engine_resource_group_config_information_operation.html.markdown new file mode 100644 index 0000000000..20b3efc1ea --- /dev/null +++ b/website/docs/r/dlc_update_standard_engine_resource_group_config_information_operation.html.markdown @@ -0,0 +1,55 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation" +sidebar_current: "docs-tencentcloud-resource-dlc_update_standard_engine_resource_group_config_information_operation" +description: |- + Provides a resource to create a DLC update standard engine resource group config information operation +--- + +# tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation + +Provides a resource to create a DLC update standard engine resource group config information operation + +## Example Usage + +```hcl +resource "tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation" "example" { + engine_resource_group_name = "tf-example" + update_conf_context { + config_type = "StaticConfigType" + params { + config_item = "spark.sql.shuffle.partitions" + config_value = "300" + operate = "ADD" + } + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `engine_resource_group_name` - (Required, String, ForceNew) Engine resource group name. +* `update_conf_context` - (Required, List, ForceNew) Configuration that needs to be updated. + +The `params` object of `update_conf_context` supports the following: + +* `config_item` - (Optional, String, ForceNew) Parameter key. +* `config_value` - (Optional, String, ForceNew) Parameter value. +* `operate` - (Optional, String, ForceNew) Send operations, support: ADD, DELETE, MODIFY. + +The `update_conf_context` object supports the following: + +* `config_type` - (Required, String, ForceNew) Parameter type, optional: StaticConfigType, DynamicConfigType. +* `params` - (Required, List) Configuration array of parameters. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + diff --git a/website/docs/r/dlc_update_standard_engine_resource_group_resource_information_operation.html.markdown b/website/docs/r/dlc_update_standard_engine_resource_group_resource_information_operation.html.markdown new file mode 100644 index 0000000000..22eddaac95 --- /dev/null +++ b/website/docs/r/dlc_update_standard_engine_resource_group_resource_information_operation.html.markdown @@ -0,0 +1,52 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation" +sidebar_current: "docs-tencentcloud-resource-dlc_update_standard_engine_resource_group_resource_information_operation" +description: |- + Provides a resource to create a DLC update standard engine resource group resource information operation +--- + +# tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation + +Provides a resource to create a DLC update standard engine resource group resource information operation + +## Example Usage + +```hcl +resource "tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation" "example" { + engine_resource_group_name = "tf-example" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `engine_resource_group_name` - (Required, String, ForceNew) Engine resource group name. +* `driver_cu_spec` - (Optional, String, ForceNew) Driver CU specifications: +Currently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory). +* `executor_cu_spec` - (Optional, String, ForceNew) Executor CU specifications: +Currently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory). +* `frame_type` - (Optional, String, ForceNew) Framework Type. +* `image_name` - (Optional, String, ForceNew) Image name. +* `image_type` - (Optional, String, ForceNew) Image type, built-in image: built-in, custom image: custom. +* `image_version` - (Optional, String, ForceNew) Image version, image id. +* `max_executor_nums` - (Optional, Int, ForceNew) Maximum number of executors. +* `min_executor_nums` - (Optional, Int, ForceNew) Minimum number of executors. +* `public_domain` - (Optional, String, ForceNew) Customized mirror domain name. +* `python_cu_spec` - (Optional, String, ForceNew) The resource limit for a Python stand-alone node in a Python resource group must be smaller than the resource limit for the resource group. Small: 1cu Medium: 2cu Large: 4cu Xlarge: 8cu 4xlarge: 16cu 8xlarge: 32cu 16xlarge: 64cu. If the resource type is high memory, add m before the type. +* `region_name` - (Optional, String, ForceNew) Customize the image region. +* `registry_id` - (Optional, String, ForceNew) Custom image instance id. +* `size` - (Optional, Int, ForceNew) AI resource group resource limit. +* `spark_size` - (Optional, Int, ForceNew) SQL resource group resource limit only, only used in fast mode. +* `spark_spec_mode` - (Optional, String, ForceNew) Only SQL resource group resource configuration mode, fast: fast mode, custom: custom mode. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index eae655f301..e604b504ca 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -2235,6 +2235,12 @@