-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question on importing a resource #52
Comments
@robwolff3 So there is one really tricky thing about a generic provider such as this one. That is, the resources it manages are arbitrary, so there is no standard for what a resource's The relevant code is here: and hash impl here: terraform-provider-graphql/graphql/keys.go Lines 95 to 120 in 83392d2
In hindsight this was a mistake, but that is how it works now. You could get the ID by passing a Here is a Go Playground where you can do this right in your browser using the same code I use to generate the ID: https://play.golang.org/p/3O_qMVfmlb_x Just fill in the resJsonData part with what your create mutation response would look like, and it will generate the ID. |
@sullivtr What do you think about having something like Thinking for now an importer function accepting the expected create mutation response to compute the CRC-32 checksum, set the ID and then execute the read query could also be very helpful. |
@QuingKhaos The I also think your other suggestion:
would be a decent workaround if the other solution does not work out. |
Looking at the Terraform import command usage:
terraform import [options] ADDRESS ID
the one thing I I'm not sure about is the ID field. In the Terraform documentation they give an example of an AWS EC2 instance and the id in that case would be the instance id from AWS and they say "Please reference the provider documentation for details on the ID format."With a resource deployed using this provider, I opened up the state file and see an ID for the resource I created and it looks to be a random number?
"id": "2745262606"
Is there anyway to know this id before importing a resource created outside of Terraform?Thanks!
The text was updated successfully, but these errors were encountered: