From 32d49cc198fe2b98c0bb4a81be4d11db4142ff6c Mon Sep 17 00:00:00 2001 From: Lance Date: Fri, 19 Jul 2024 17:10:45 +0800 Subject: [PATCH] fix(lts/converge): management project id is required for first-time use (#5247) --- docs/resources/lts_log_converge.md | 3 +++ .../lts/resource_huaweicloud_lts_log_converge.go | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/resources/lts_log_converge.md b/docs/resources/lts_log_converge.md index 5adac1e7c6..8707c50b29 100644 --- a/docs/resources/lts_log_converge.md +++ b/docs/resources/lts_log_converge.md @@ -65,6 +65,9 @@ The following arguments are supported: * `log_mapping_config` - (Required, List) Specifies the log converge configurations. The [log_mapping_config](#converge_log_mapping_config) structure is documented below. +* `management_project_id` - (Optional, String) Specifies the administrator project ID that required for + first-time use. + The `log_mapping_config` block supports: diff --git a/huaweicloud/services/lts/resource_huaweicloud_lts_log_converge.go b/huaweicloud/services/lts/resource_huaweicloud_lts_log_converge.go index 07dcb47ce8..ad295b286b 100644 --- a/huaweicloud/services/lts/resource_huaweicloud_lts_log_converge.go +++ b/huaweicloud/services/lts/resource_huaweicloud_lts_log_converge.go @@ -127,6 +127,12 @@ func ResourceLogConverge() *schema.Resource { }, Description: `The log converge configurations.`, }, + "management_project_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: `The administrator project ID that required for first-time use.`, + }, "created_at": { Type: schema.TypeString, Computed: true, @@ -187,7 +193,8 @@ func buildModifyLogConvergeBodyParams(d *schema.ResourceData) map[string]interfa "management_account_id": d.Get("management_account_id"), "member_account_id": d.Get("member_account_id"), // Optional parameters - "log_mapping_config": buildLogMappingConfigsBodyParams(d.Get("log_mapping_config").(*schema.Set)), + "log_mapping_config": buildLogMappingConfigsBodyParams(d.Get("log_mapping_config").(*schema.Set)), + "management_project_id": utils.ValueIgnoreEmpty(d.Get("management_project_id")), } } @@ -291,6 +298,7 @@ func resourceLogConvergeRead(_ context.Context, d *schema.ResourceData, meta int d.Set("member_account_id", utils.PathSearch("member_account_id", respBody, nil)), d.Set("management_account_id", utils.PathSearch("management_account_id", respBody, nil)), d.Set("log_mapping_config", utils.PathSearch("log_mapping_config", respBody, nil)), + d.Set("management_project_id", utils.PathSearch("management_project_id", respBody, nil)), // Attributes d.Set("created_at", utils.FormatTimeStampRFC3339( int64(utils.PathSearch("create_time", respBody, float64(0)).(float64))/1000, false)),