diff --git a/CHANGELOG.md b/CHANGELOG.md index c09684f5..6370ff2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -274,3 +274,9 @@ BUG FIXES * Schema merging helper function was mutating input schema causing side effects when used in a particular way. Used shallow copying to avoid this side effect. [GH-338] * Ensure response is not nil when checking status code [GH-307] + +## 3.0.37 + +BUG FIXES + +* Ensure `index` is sync'd on import to avoid recreation. diff --git a/okta/resource_okta_user_base_schema.go b/okta/resource_okta_user_base_schema.go index e7ab3d33..5e9b171e 100644 --- a/okta/resource_okta_user_base_schema.go +++ b/okta/resource_okta_user_base_schema.go @@ -15,7 +15,10 @@ func resourceUserBaseSchema() *schema.Resource { Delete: resourceUserBaseSchemaDelete, Exists: resourceUserBaseSchemaExists, Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, + State: func(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { + d.Set("index", d.Id()) + return []*schema.ResourceData{d}, nil + }, }, Schema: userBaseSchemaSchema, diff --git a/okta/resource_okta_user_schema.go b/okta/resource_okta_user_schema.go index 088475c0..4acb8282 100644 --- a/okta/resource_okta_user_schema.go +++ b/okta/resource_okta_user_schema.go @@ -15,7 +15,10 @@ func resourceUserSchema() *schema.Resource { Delete: resourceUserSchemaDelete, Exists: resourceUserSchemaExists, Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, + State: func(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { + d.Set("index", d.Id()) + return []*schema.ResourceData{d}, nil + }, }, Schema: userSchemaSchema, }