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

@ -76,7 +76,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
}
if err != nil {
core.LogAndAddError(ctx, &resp.Diagnostics, "Error configuring API client", err.Error())
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
}
@ -86,6 +86,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
func (r *credentialResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
Description: "Argus credential 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`,`instance_id`,`username`\".",

View file

@ -63,7 +63,7 @@ func (d *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
)
}
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
}
d.client = apiClient
@ -73,6 +73,7 @@ func (d *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
// Schema defines the schema for the data source.
func (d *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
resp.Schema = schema.Schema{
Description: "Argus instance 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`,`instance_id`\".",

View file

@ -103,7 +103,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
}
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
}
@ -114,6 +114,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
// Schema defines the schema for the resource.
func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
Description: "Argus instance 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`,`instance_id`\".",

View file

@ -11,6 +11,7 @@ import (
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/stackitcloud/stackit-sdk-go/core/config"
"github.com/stackitcloud/stackit-sdk-go/services/argus"
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
@ -64,7 +65,7 @@ func (d *scrapeConfigDataSource) Configure(ctx context.Context, req datasource.C
)
}
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
}
d.client = apiClient
@ -73,6 +74,7 @@ func (d *scrapeConfigDataSource) Configure(ctx context.Context, req datasource.C
// Schema defines the schema for the data source.
func (d *scrapeConfigDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
resp.Schema = schema.Schema{
Description: "Argus scrape config 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`,`instance_id`,`name`\".",
@ -215,4 +217,5 @@ func (d *scrapeConfigDataSource) Read(ctx context.Context, req datasource.ReadRe
if resp.Diagnostics.HasError() {
return
}
tflog.Info(ctx, "Argus scrape config read")
}

View file

@ -114,7 +114,7 @@ func (r *scrapeConfigResource) Configure(ctx context.Context, req resource.Confi
}
if err != nil {
core.LogAndAddError(ctx, &resp.Diagnostics, "Error configuring API client", err.Error())
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
}
r.client = apiClient
@ -124,6 +124,7 @@ func (r *scrapeConfigResource) Configure(ctx context.Context, req resource.Confi
// Schema defines the schema for the resource.
func (r *scrapeConfigResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
Description: "Argus scrape config 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`,`instance_id`,`name`\".",

View file

@ -62,7 +62,7 @@ func (d *recordSetDataSource) Configure(ctx context.Context, req datasource.Conf
}
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
}

View file

@ -91,7 +91,7 @@ func (r *recordSetResource) Configure(ctx context.Context, req resource.Configur
}
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
}

View file

@ -61,7 +61,7 @@ func (d *zoneDataSource) Configure(ctx context.Context, req datasource.Configure
)
}
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
}

View file

@ -105,7 +105,7 @@ func (r *zoneResource) Configure(ctx context.Context, req resource.ConfigureRequ
}
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
}

View file

@ -64,7 +64,7 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
}
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
}
@ -75,7 +75,7 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
// Schema defines the schema for the data source.
func (r *credentialDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "LogMe credential data source schema.",
"main": "LogMe credential data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`,`credential_id`\".",
"credential_id": "The credential's ID.",
"instance_id": "ID of the LogMe instance.",

View file

@ -89,7 +89,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
}
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
}
@ -100,7 +100,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
// Schema defines the schema for the resource.
func (r *credentialResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "LogMe credential resource schema.",
"main": "LogMe credential resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource identifier. It is structured as \"`project_id`,`instance_id`,`credential_id`\".",
"credential_id": "The credential's ID.",
"instance_id": "ID of the LogMe instance.",

View file

@ -63,7 +63,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
}
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,7 +74,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
// Schema defines the schema for the data source.
func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "LogMe instance data source schema.",
"main": "LogMe instance data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the LogMe instance.",
"project_id": "STACKIT Project ID to which the instance is associated.",

View file

@ -101,7 +101,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
}
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
}
@ -112,7 +112,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
// Schema defines the schema for the resource.
func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "LogMe instance resource schema.",
"main": "LogMe instance resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource ID. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the LogMe instance.",
"project_id": "STACKIT project ID to which the instance is associated.",

View file

@ -64,7 +64,7 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
}
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
}
@ -75,7 +75,7 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
// Schema defines the schema for the data source.
func (r *credentialDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "MariaDB credential data source schema.",
"main": "MariaDB credential data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`,`credential_id`\".",
"credential_id": "The credential's ID.",
"instance_id": "ID of the MariaDB instance.",

View file

@ -89,7 +89,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
}
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
}
@ -100,7 +100,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
// Schema defines the schema for the resource.
func (r *credentialResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "MariaDB credential resource schema.",
"main": "MariaDB credential resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource identifier. It is structured as \"`project_id`,`instance_id`,`credential_id`\".",
"credential_id": "The credential's ID.",
"instance_id": "ID of the MariaDB instance.",

View file

@ -63,7 +63,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
}
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,7 +74,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
// Schema defines the schema for the data source.
func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "MariaDB instance data source schema.",
"main": "MariaDB instance data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the MariaDB instance.",
"project_id": "STACKIT Project ID to which the instance is associated.",

View file

@ -101,7 +101,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
}
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
}
@ -112,7 +112,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
// Schema defines the schema for the resource.
func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "MariaDB instance resource schema.",
"main": "MariaDB instance resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource ID. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the MariaDB instance.",
"project_id": "STACKIT project ID to which the instance is associated.",

View file

@ -65,7 +65,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
}
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
}
@ -76,7 +76,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
// Schema defines the schema for the data source.
func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "MongoDB Flex instance data source schema.",
"main": "MongoDB Flex instance data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. ID. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the MongoDB Flex instance.",
"project_id": "STACKIT project ID to which the instance is associated.",

View file

@ -135,7 +135,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
}
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
}
@ -146,7 +146,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
// Schema defines the schema for the resource.
func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "MongoDB Flex instance resource schema.",
"main": "MongoDB Flex instance resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource ID. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the MongoDB Flex instance.",
"project_id": "STACKIT project ID to which the instance is associated.",

View file

@ -79,7 +79,7 @@ func (r *userDataSource) Configure(ctx context.Context, req datasource.Configure
}
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
}
@ -90,7 +90,7 @@ func (r *userDataSource) Configure(ctx context.Context, req datasource.Configure
// Schema defines the schema for the data source.
func (r *userDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "PostgresFlex user data source schema.",
"main": "PostgresFlex user data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. ID. It is structured as \"`project_id`,`instance_id`,`user_id`\".",
"user_id": "User ID.",
"instance_id": "ID of the PostgresFlex instance.",

View file

@ -87,7 +87,7 @@ func (r *userResource) Configure(ctx context.Context, req resource.ConfigureRequ
}
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
}
@ -98,7 +98,7 @@ func (r *userResource) Configure(ctx context.Context, req resource.ConfigureRequ
// Schema defines the schema for the resource.
func (r *userResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "MongoDB Flex user resource schema.",
"main": "MongoDB Flex user resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource ID. It is structured as \"`project_id`,`instance_id`,`user_id`\".",
"user_id": "User ID.",
"instance_id": "ID of the MongoDB Flex instance.",

View file

@ -63,7 +63,7 @@ func (r *bucketDataSource) Configure(ctx context.Context, req datasource.Configu
}
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,7 +74,7 @@ func (r *bucketDataSource) Configure(ctx context.Context, req datasource.Configu
// Schema defines the schema for the data source.
func (r *bucketDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "ObjectStorage bucket data source schema.",
"main": "ObjectStorage bucket data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source identifier. It is structured as \"`project_id`,`name`\".",
"name": "The bucket name. It must be DNS conform.",
"project_id": "STACKIT Project ID to which the bucket is associated.",

View file

@ -80,7 +80,7 @@ func (r *bucketResource) Configure(ctx context.Context, req resource.ConfigureRe
}
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
}
@ -91,7 +91,7 @@ func (r *bucketResource) Configure(ctx context.Context, req resource.ConfigureRe
// Schema defines the schema for the resource.
func (r *bucketResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "ObjectStorage bucket resource schema.",
"main": "ObjectStorage bucket resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource identifier. It is structured as \"`project_id`,`name`\".",
"name": "The bucket name. It must be DNS conform.",
"project_id": "STACKIT Project ID to which the bucket is associated.",

View file

@ -61,7 +61,7 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
}
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
}
@ -72,7 +72,7 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
// Schema defines the schema for the datasource.
func (r *credentialDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "ObjectStorage credential data source schema.",
"main": "ObjectStorage credential data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource identifier. It is structured as \"`project_id`,`credentials_group_id`,`credential_id`\".",
"credential_id": "The credential ID.",
"credentials_group_id": "The credential group ID.",

View file

@ -82,7 +82,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
}
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
}
@ -93,7 +93,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
// Schema defines the schema for the resource.
func (r *credentialResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "ObjectStorage credential resource schema.",
"main": "ObjectStorage credential resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource identifier. It is structured as \"`project_id`,`credentials_group_id`,`credential_id`\".",
"credential_id": "The credential ID.",
"credentials_group_id": "The credential group ID.",

View file

@ -63,7 +63,7 @@ func (r *credentialsGroupDataSource) Configure(ctx context.Context, req datasour
}
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,7 +74,7 @@ func (r *credentialsGroupDataSource) Configure(ctx context.Context, req datasour
// Schema defines the schema for the data source.
func (r *credentialsGroupDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "ObjectStorage credentials group data source schema.",
"main": "ObjectStorage credentials group data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source identifier. It is structured as \"`project_id`,`credentials_group_id`\".",
"credentials_group_id": "The credentials group ID",
"name": "The credentials group's display name.",

View file

@ -79,7 +79,7 @@ func (r *credentialsGroupResource) Configure(ctx context.Context, req resource.C
}
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
}
@ -90,7 +90,7 @@ func (r *credentialsGroupResource) Configure(ctx context.Context, req resource.C
// Schema defines the schema for the resource.
func (r *credentialsGroupResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "ObjectStorage credentials group resource schema.",
"main": "ObjectStorage credentials group resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source identifier. It is structured as \"`project_id`,`credentials_group_id`\".",
"credentials_group_id": "The credentials group ID",
"name": "The credentials group's display name.",

View file

@ -64,7 +64,7 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
}
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
}
@ -75,7 +75,7 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
// Schema defines the schema for the data source.
func (r *credentialDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "OpenSearch credential data source schema.",
"main": "OpenSearch credential data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`,`credential_id`\".",
"credential_id": "The credential's ID.",
"instance_id": "ID of the OpenSearch instance.",

View file

@ -89,7 +89,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
}
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
}
@ -100,7 +100,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
// Schema defines the schema for the resource.
func (r *credentialResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "OpenSearch credential resource schema.",
"main": "OpenSearch credential resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource identifier. It is structured as \"`project_id`,`instance_id`,`credential_id`\".",
"credential_id": "The credential's ID.",
"instance_id": "ID of the OpenSearch instance.",

View file

@ -63,7 +63,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
}
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,7 +74,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
// Schema defines the schema for the data source.
func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "OpenSearch instance data source schema.",
"main": "OpenSearch instance data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the OpenSearch instance.",
"project_id": "STACKIT Project ID to which the instance is associated.",

View file

@ -101,7 +101,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
}
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
}
@ -112,7 +112,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
// Schema defines the schema for the resource.
func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "OpenSearch instance resource schema.",
"main": "OpenSearch instance resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource ID. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the OpenSearch instance.",
"project_id": "STACKIT project ID to which the instance is associated.",

View file

@ -65,7 +65,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
}
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
}
@ -76,7 +76,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
// Schema defines the schema for the data source.
func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "PostgresFlex instance data source schema.",
"main": "PostgresFlex instance data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. ID. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the PostgresFlex instance.",
"project_id": "STACKIT project ID to which the instance is associated.",

View file

@ -119,7 +119,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
}
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
}
@ -130,7 +130,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
// Schema defines the schema for the resource.
func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "PostgresFlex instance resource schema.",
"main": "PostgresFlex instance resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource ID. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the PostgresFlex instance.",
"project_id": "STACKIT project ID to which the instance is associated.",

View file

@ -78,7 +78,7 @@ func (r *userDataSource) Configure(ctx context.Context, req datasource.Configure
}
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
}
@ -89,7 +89,7 @@ func (r *userDataSource) Configure(ctx context.Context, req datasource.Configure
// Schema defines the schema for the data source.
func (r *userDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "PostgresFlex user data source schema.",
"main": "PostgresFlex user data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. ID. It is structured as \"`project_id`,`instance_id`,`user_id`\".",
"user_id": "User ID.",
"instance_id": "ID of the PostgresFlex instance.",

View file

@ -89,7 +89,7 @@ func (r *userResource) Configure(ctx context.Context, req resource.ConfigureRequ
}
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
}
@ -100,7 +100,7 @@ func (r *userResource) Configure(ctx context.Context, req resource.ConfigureRequ
// Schema defines the schema for the resource.
func (r *userResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "PostgresFlex user resource schema.",
"main": "PostgresFlex user resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource ID. It is structured as \"`project_id`,`instance_id`,`user_id`\".",
"user_id": "User ID.",
"instance_id": "ID of the PostgresFlex instance.",

View file

@ -64,7 +64,7 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
}
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
}
@ -75,7 +75,7 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
// Schema defines the schema for the data source.
func (r *credentialDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "PostgreSQL credential data source schema.",
"main": "PostgreSQL credential data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`,`credential_id`\".",
"credential_id": "The credential's ID.",
"instance_id": "ID of the PostgreSQL instance.",

View file

@ -89,7 +89,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
}
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
}
@ -100,7 +100,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
// Schema defines the schema for the resource.
func (r *credentialResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "PostgreSQL credential resource schema.",
"main": "PostgreSQL credential resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource identifier. It is structured as \"`project_id`,`instance_id`,`credential_id`\".",
"credential_id": "The credential's ID.",
"instance_id": "ID of the PostgreSQL instance.",

View file

@ -64,7 +64,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
}
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
}
@ -75,7 +75,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
// Schema defines the schema for the data source.
func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "PostgreSQL instance data source schema.",
"main": "PostgreSQL instance data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the PostgreSQL instance.",
"project_id": "STACKIT Project ID to which the instance is associated.",

View file

@ -112,7 +112,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
}
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
}
@ -123,7 +123,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
// Schema defines the schema for the resource.
func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "PostgreSQL instance resource schema.",
"main": "PostgreSQL instance resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource ID. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the PostgreSQL instance.",
"project_id": "STACKIT project ID to which the instance is associated.",

View file

@ -64,7 +64,7 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
}
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
}
@ -75,7 +75,7 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
// Schema defines the schema for the data source.
func (r *credentialDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "RabbitMQ credential data source schema.",
"main": "RabbitMQ credential data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`,`credential_id`\".",
"credential_id": "The credential's ID.",
"instance_id": "ID of the RabbitMQ instance.",

View file

@ -89,7 +89,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
}
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
}
@ -100,7 +100,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
// Schema defines the schema for the resource.
func (r *credentialResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "RabbitMQ credential resource schema.",
"main": "RabbitMQ credential resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource identifier. It is structured as \"`project_id`,`instance_id`,`credential_id`\".",
"credential_id": "The credential's ID.",
"instance_id": "ID of the RabbitMQ instance.",

View file

@ -63,7 +63,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
}
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,7 +74,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
// Schema defines the schema for the data source.
func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "RabbitMQ instance data source schema.",
"main": "RabbitMQ instance data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the RabbitMQ instance.",
"project_id": "STACKIT Project ID to which the instance is associated.",

View file

@ -101,7 +101,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
}
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
}
@ -112,7 +112,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
// Schema defines the schema for the resource.
func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "RabbitMQ instance resource schema.",
"main": "RabbitMQ instance resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource ID. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the RabbitMQ instance.",
"project_id": "STACKIT project ID to which the instance is associated.",

View file

@ -64,7 +64,7 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
}
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
}
@ -75,7 +75,7 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
// Schema defines the schema for the data source.
func (r *credentialDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "Redis credential data source schema.",
"main": "Redis credential data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`,`credential_id`\".",
"credential_id": "The credential's ID.",
"instance_id": "ID of the Redis instance.",

View file

@ -89,7 +89,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
}
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
}
@ -100,7 +100,7 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
// Schema defines the schema for the resource.
func (r *credentialResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "Redis credential resource schema.",
"main": "Redis credential resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource identifier. It is structured as \"`project_id`,`instance_id`,`credential_id`\".",
"credential_id": "The credential's ID.",
"instance_id": "ID of the Redis instance.",

View file

@ -63,7 +63,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
}
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,7 +74,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
// Schema defines the schema for the data source.
func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "Redis instance data source schema.",
"main": "Redis instance data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the Redis instance.",
"project_id": "STACKIT Project ID to which the instance is associated.",

View file

@ -101,7 +101,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
}
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
}
@ -112,7 +112,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
// Schema defines the schema for the resource.
func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "Redis instance resource schema.",
"main": "Redis instance resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource ID. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the Redis instance.",
"project_id": "STACKIT project ID to which the instance is associated.",

View file

@ -74,11 +74,10 @@ func (d *projectDataSource) Configure(ctx context.Context, req datasource.Config
apiClient, err = resourcemanager.NewAPIClient(
config.WithCustomAuth(providerData.RoundTripper),
config.WithServiceAccountEmail(providerData.ServiceAccountEmail),
config.WithRegion(providerData.Region),
)
}
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
}

View file

@ -88,12 +88,11 @@ func (r *projectResource) Configure(ctx context.Context, req resource.ConfigureR
apiClient, err = resourcemanager.NewAPIClient(
config.WithCustomAuth(providerData.RoundTripper),
config.WithServiceAccountEmail(providerData.ServiceAccountEmail),
config.WithRegion(providerData.Region),
)
}
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
}

View file

@ -63,7 +63,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
}
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,7 +74,7 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
// Schema defines the schema for the data source.
func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "Secrets Manager instance data source schema.",
"main": "Secrets Manager instance data source schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource ID. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the Secrets Manager instance.",
"project_id": "STACKIT project ID to which the instance is associated.",

View file

@ -78,7 +78,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
}
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
}
@ -89,7 +89,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
// Schema defines the schema for the resource.
func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "Secrets Manager instance resource schema.",
"main": "Secrets Manager instance resource schema. Must have a `region` specified in the provider configuration.",
"id": "Terraform's internal resource ID. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the Secrets Manager instance.",
"project_id": "STACKIT project ID to which the instance is associated.",

View file

@ -64,7 +64,7 @@ func (r *clusterDataSource) 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
}
@ -73,7 +73,7 @@ func (r *clusterDataSource) Configure(ctx context.Context, req datasource.Config
}
func (r *clusterDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
resp.Schema = schema.Schema{
Description: "SKE Cluster data source schema.",
Description: "SKE Cluster 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`,`name`\".",

View file

@ -168,7 +168,7 @@ func (r *clusterResource) 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
}
@ -179,7 +179,7 @@ func (r *clusterResource) Configure(ctx context.Context, req resource.ConfigureR
// Schema defines the schema for the resource.
func (r *clusterResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
Description: "SKE Cluster Resource schema.",
Description: "SKE Cluster 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`,`name`\".",

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`\".",