From 2c733d7955e2faf84b6cff48763c99f4f5712a3d Mon Sep 17 00:00:00 2001 From: Philip Dubois Date: Wed, 15 Nov 2023 09:45:58 +0100 Subject: [PATCH] Fix liniting errors Signed-off-by: Philip Dubois --- provider/resource_opensearch_sm_policy.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/provider/resource_opensearch_sm_policy.go b/provider/resource_opensearch_sm_policy.go index 27c8ac1..c5381ef 100644 --- a/provider/resource_opensearch_sm_policy.go +++ b/provider/resource_opensearch_sm_policy.go @@ -60,7 +60,11 @@ func resourceOpenSearchSMPolicy() *schema.Resource { Schema: openSearchSMPolicySchema, Importer: &schema.ResourceImporter{ StateContext: func(ctx context.Context, d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { - d.Set("policy_name", d.Id()) + var err error = d.Set("policy_name", d.Id()) + if err != nil { + return nil, err + } + d.SetId(fmt.Sprintf("%s-sm-policy", d.Id())) return []*schema.ResourceData{d}, nil },