File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
internal/elasticsearch/index/index Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,15 @@ import (
5
5
6
6
"github.com/elastic/terraform-provider-elasticstack/internal/clients"
7
7
"github.com/hashicorp/terraform-plugin-framework/diag"
8
+ "github.com/hashicorp/terraform-plugin-framework/path"
8
9
"github.com/hashicorp/terraform-plugin-framework/resource"
9
10
)
10
11
12
+ // Ensure provider defined types fully satisfy framework interfaces
13
+ var _ resource.Resource = & Resource {}
14
+ var _ resource.ResourceWithConfigure = & Resource {}
15
+ var _ resource.ResourceWithImportState = & Resource {}
16
+
11
17
type Resource struct {
12
18
client * clients.ApiClient
13
19
}
@@ -33,3 +39,8 @@ func (r *Resource) Configure(ctx context.Context, request resource.ConfigureRequ
33
39
func (r * Resource ) Metadata (ctx context.Context , request resource.MetadataRequest , response * resource.MetadataResponse ) {
34
40
response .TypeName = request .ProviderTypeName + "_elasticsearch_index"
35
41
}
42
+
43
+ func (r * Resource ) ImportState (ctx context.Context , req resource.ImportStateRequest , resp * resource.ImportStateResponse ) {
44
+ // Retrieve import ID and save to id attribute
45
+ resource .ImportStatePassthroughID (ctx , path .Root ("id" ), req , resp )
46
+ }
You can’t perform that action at this time.
0 commit comments