Importer functions reading file config

I have a resource which can either generate a keypair or upload one and the schema has fields which conflict depending on the use case. This works create for normal crud operations.

However on the import i have no way in the API to detect whether its a generated or uploaded, and I query the relevant fields with d.Get("file_data") for example to see it its set.

Is there a way to handle this?

Also to clarify the resource is only supports Create Read Delete so the entire schema is ForceNew and ConflictsWith which means unless the import works correctly it attempts to destroy and recreate :poop:

Unfortunately, we don’t get config information as part of the import RPC call. The only workaround I know of for this is having the user specify the information you need as part of the import ID, and writing a custom ResourceImporter to be split the ID and set the constituent parts in state where they go.