Closed thiagoarrais closed 3 years ago
Hi @thiagoarrais
Yeah that seems very useful. I resorted to recreating the projects in the past but importing them would be a way better experience.
I'd love to merge your PR. Thank you so much.
Yay! Good to hear that!
I'll get the CI to green and work on the other resources I mentioned and get back to you.
Great, let me know if I can help with anything.
I know that I haven't set a great example with test coverage yet but I'd like to improve it.
I've had my trouble testing terraform but please let me know how I can help @thiagoarrais
I am used to writing tests for the main CRUD operations with the Terraform SDK testing framework, but I'm not really sure how to (properly) test resource importing... Any pointers?
I have no idea to be honest, never used it. But I'll try and find some examples from the official providers perhaps.
@thiagoarrais just a heads up: I will be on vacation starting monday until the end of the week, but I'd be happy to merge your progress until sunday, if that's beneficial for you or your work.
No need. I can happily wait for you to get back. Have a great vacation!
Hey, @chronark. I think this deserves a new look now. I've changed the import ids to use more visible names instead of the Vercel IDs themselves that are only accessible through fiddling directly with API calls. And I've also added some tests. They work by calling the import functions directly and are thus a little less integration-y than the other tests. But I think this may work.
Hey @thiagoarrais, thank you so much for your work. I agree, human readable names are probably better for this application.
I've created a copy of this pr (#44) to allow the e2e tests to run. Unfortunately the vercel token secret is not available to forks, and I haven't come up with a better way yet. But I'll merge this as soon as they pass.
Thanks again for your contribution.
@thiagoarrais The v0.12.0
release is building right now with your changes
First of all, thanks for the provider. Great work!
I am trying to import some Vercel projects to Terraform, but I see that the provider doesn't include the needed ResourceImporters. I wonder if you'd be interested in adding those. This PR currently implements a (very crude) importer for the
vercel_project
resource.With this im place, it is possible to do:
or (for a non-team project)
Would you be interested in some along those lines (with TODOs resolved, of course) for this and some other resource types?
If so, I am willing to add importers to:
vercel_project
(in progress)vercel_secret
vercel_env
vercel_domain