diff --git a/opensearch/provider.go b/opensearch/provider.go index 145f659..e83f492 100644 --- a/opensearch/provider.go +++ b/opensearch/provider.go @@ -18,9 +18,10 @@ limitations under the License. import ( "context" - "github.com/moia-oss/terraform-provider-opensearch-dashboards/pkg/default_index_pattern" "net/http" + "github.com/moia-oss/terraform-provider-opensearch-dashboards/pkg/default_index_pattern" + "github.com/aws/aws-sdk-go/aws/session" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/opensearch/resource_default_index_pattern.go b/opensearch/resource_default_index_pattern.go index 0181520..bdd4063 100644 --- a/opensearch/resource_default_index_pattern.go +++ b/opensearch/resource_default_index_pattern.go @@ -2,6 +2,8 @@ package opensearch import ( "context" + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/rs/zerolog/log" @@ -51,7 +53,7 @@ func defaultIndexPatternRead(ctx context.Context, d *schema.ResourceData, m any) } err := d.Set("index_pattern_id", resp.IndexPatternId) if err != nil { - return diag.Errorf("could not set index_pattern_id after fetching from api: %w", err) + return diag.Errorf(fmt.Sprintf("could not set index_pattern_id after fetching from api: %v+", err)) } return nil diff --git a/pkg/default_index_pattern/default_index_pattern.go b/pkg/default_index_pattern/default_index_pattern.go index fa93b8c..181c704 100644 --- a/pkg/default_index_pattern/default_index_pattern.go +++ b/pkg/default_index_pattern/default_index_pattern.go @@ -5,9 +5,10 @@ import ( "context" "encoding/json" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "io" "net/http" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" ) type OpenSearchRequestBody struct {