Skip to content

Commit

Permalink
fix(lts/converge): management project id is required for first-time u…
Browse files Browse the repository at this point in the history
…se (#5247)
  • Loading branch information
Lance52259 authored Jul 19, 2024
1 parent d6b486d commit 32d49cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/resources/lts_log_converge.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<a name="converge_log_mapping_config"></a>
The `log_mapping_config` block supports:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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")),
}
}

Expand Down Expand Up @@ -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)),
Expand Down

0 comments on commit 32d49cc

Please sign in to comment.