Improve region details (#90)

* Make client config error message more clear

* Add missing log

* Add region detail to resource/data source description

* Generate docs

* Remove resourcemanager using region

* Apply changes to MongoDBFlex user

* Generate docs

* Fix wrong description

---------

Co-authored-by: Henrique Santos <henrique.santos@freiheit.com>
This commit is contained in:
Henrique Santos 2023-10-17 16:02:13 +01:00 committed by GitHub
parent 20f3496242
commit 9d11098102
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
102 changed files with 200 additions and 193 deletions

View file

@ -63,7 +63,7 @@ func (r *projectDataSource) Configure(ctx context.Context, req datasource.Config
}
if err != nil {
core.LogAndAddError(ctx, &resp.Diagnostics, "Error configuring API client", fmt.Sprintf("Configuring client: %v", err))
core.LogAndAddError(ctx, &resp.Diagnostics, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the data source configuration", err))
return
}
@ -74,6 +74,7 @@ func (r *projectDataSource) Configure(ctx context.Context, req datasource.Config
// Schema defines the schema for the data source.
func (r *projectDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
resp.Schema = schema.Schema{
Description: "SKE project data source schema. Must have a `region` specified in the provider configuration.",
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Description: "Terraform's internal data source. ID. It is structured as \"`project_id`\".",

View file

@ -76,7 +76,7 @@ func (r *projectResource) Configure(ctx context.Context, req resource.ConfigureR
}
if err != nil {
core.LogAndAddError(ctx, &resp.Diagnostics, "Error configuring API client", fmt.Sprintf("Configuring client: %v", err))
core.LogAndAddError(ctx, &resp.Diagnostics, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err))
return
}
@ -87,6 +87,7 @@ func (r *projectResource) Configure(ctx context.Context, req resource.ConfigureR
// Schema returns the Terraform schema structure
func (r *projectResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
Description: "SKE project resource schema. Must have a `region` specified in the provider configuration.",
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Description: "Terraform's internal resource ID. It is structured as \"`project_id`\".",