-
Notifications
You must be signed in to change notification settings - Fork 123
Description
Describe the bug
elasticstack_elasticsearch_security_role_mapping resources cannot be imported between versions 0.11.18 and 0.12.1 (inclusive), possibly due to the Plugin Framework Migration.
I've checked each of versions 0.12.1, 0.12.0, 0.11.19, and 0.11.18 exhibit the same issue.
Importing the same resource works as expected when pinning to version 0.11.17
To Reproduce
Steps to reproduce the behavior:
Ensure a Role Mapping resource named example exists, then try to import it into TF state with:
- TF configuration used '...'
resource "elasticstack_elasticsearch_security_role_mapping" "example" {
name = "test_role_mapping"
enabled = true
roles = [
"admin"
]
rules = jsonencode({
any = [
{ field = { username = "esadmin" } },
{ field = { groups = "cn=admins,dc=example,dc=com" } },
]
})
}
import {
to = elasticstack_elasticsearch_security_role_mapping.example
id = "${var.cluster_uuid}/example"
}
-
TF operations to execute to get the error '...'
terraform plan -
See the error in the output '...'
Error: -13T05:27:20.028Z [ERROR] provider.terraform-provider-elasticstack_v0.11.18: Response contains error diagnostic: diagnostic_detail="This resource does not support import. Please contact the provider developer for additional information." diagnostic_severity=ERROR tf_proto_version=6.10 tf_resource_type=elasticstack_elasticsearch_security_role_mapping tf_rpc=ImportResourceState @module=sdk.proto diagnostic_summary="Resource Import Not Implemented" tf_provider_addr=registry.terraform.io/elastic/elasticstack tf_req_id=eed5be2b-98fc-fc47-3da5-88a6c43e97f8 @caller=github.com/hashicorp/terraform-plugin-go@v0.29.0/tfprotov6/internal/diag/diagnostics.go:58 timestamp=2025-11-13T05:27:20.028Z
Error: -13T05:27:20.028Z [ERROR] vertex "elasticstack_elasticsearch_security_role_mapping.example" error: Resource Import Not Implemented
Error: -13T05:27:20.028Z [ERROR] vertex "elasticstack_elasticsearch_security_role_mapping.example (expand)" error: Resource Import Not Implemented
Expected behavior
With provider version = "0.11.17":
# elasticstack_elasticsearch_security_role_mapping.example will be imported
resource "elasticstack_elasticsearch_security_role_mapping" "example" {
enabled = true
id = "<redacted>/example"
metadata = jsonencode({})
name = "example"
roles = [
"admin",
]
rules = jsonencode({
any = [
{ field = { username = "esadmin" } },
{ field = { groups = "cn=admins,dc=example,dc=com" } },
]
})
}
Debug output
can be provided on request
Screenshots
n/a
Versions (please complete the following information):
- OS: Linux
- Terraform Version:
1.13.5 - Provider version:
0.11.18-0.12.1inclusive - Elasticsearch Version:
8.17.3
Additional context
- PR that implemented the Plugin Migration: Migrate Elasticsearch role mapping resource and data source to Plugin Framework #1280
- Similar issue with
elasticstack_elasticsearch_index: [Bug] elasticsearch_index.alias and import regressions #767