I'm trying to import auth0_resource_server_scopes resource and it appears that the resources is alphabetizing the scopes which leads to it want to delete all the scopes and recreate them. This would break any clients and may break association resources as the underlying ids would like change.
Expectation
Scopes should not be recreated on import if they already exist on the resource server.
For those that find this ticket. Here is the path to successfully import the scopes into the auth0_resoruce_server_scopes resource.
Import each of the scopes using the auth0_resource_server_scope resource first. This is clearly doing something within Auth0 to add additional metadata on the scopes to enable the auth0_resource_server_scopes to behave appropriately.
After you apply the import from 1. Import the scopes into the auth0_resource_service_scopes resource. In you plan you should see a successful import. The trick is what to do with the newly imported auth0_resource_service_scope resources you imported in step1. You can either use a removed block or you can manually remove them from the state file.
Checklist
Description
I'm trying to import auth0_resource_server_scopes resource and it appears that the resources is alphabetizing the scopes which leads to it want to delete all the scopes and recreate them. This would break any clients and may break association resources as the underlying ids would like change.
Expectation
Scopes should not be recreated on import if they already exist on the resource server.
Reproduction
~ resource "auth0_resource_server_scopes" "scopes" { id = "foo" resource_server_identifier = "foo"
Auth0 Terraform Provider version
1.7.1
Terraform version
1.7.3