-
Notifications
You must be signed in to change notification settings - Fork 220
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
Adding support for 'waiting until resource is ready' on create #137
base: master
Are you sure you want to change the base?
Adding support for 'waiting until resource is ready' on create #137
Conversation
This is awesome, and would be very useful to me. |
Hi @johanols Can you fix the merge conflicts?, i made a conflict free branch of your code in my own repo can you can check out if it helps. https://github.com/theochita/terraform-provider-restapi/tree/johanols-feature/wait_for_ready_on_create @DRuggeri Any thoughts on this feature?, it helps us be able to interface with async api's that returns an awaitable task, which should be polled every few sec until its finished. |
This adds a feature where the provider waits until a resource is ready. To determine that two new schema parameters were added: * create_ready_key * create_ready_value After creating the resource and if set, the object is repeatedly read and validated using these two parameters. As soon as the value corresponds to the resource value at key the provider will deem the resource ready and continue execution. The default timeout for checking readiness is 10 minutes. Use Terraform's 'timeouts' argument to override. Issue: Mastercard#33
8a1a502
to
5df62dc
Compare
I've fixed the merge conflicts now @theochita. I also adjusted the imports of |
Would be amazing if the provider would support this! |
Could this be merged? Would really appreciate it! cc @DRuggeri |
fyi; we have forked and will maintain our changes at https://github.com/hnhdev/terraform-provider-restapi Would still be great to see it merged, but at least we are not dependent anymore. |
We ended up not using this PR, as it only supports create method. This is how we implemented it for our specific usecase (all CRUD functions supported, async); |
+1 to this feature. |
Wow - I don't know how I haven't seen this PR until just now!!!! SO SORRY for the long delay - I've done several feature reviews since this was opened and dropped the ball! I like this concept quite a bit because there are a number of APIs that are primarily async, but do have some reservations. As @fancybear-dev points out, it only supports the create operation, so we would need to have a think on what update and destroy should look like. I would surmise they look roughly the same. |
This adds a feature where the provider waits until a resource is ready.
To determine that two new schema parameters were added:
After creating the resource and if set, the object is repeatedly read
and validated using these two parameters. As soon as the value
corresponds to the resource value at key the provider will deem the
resource ready and continue execution.
The default timeout for checking readiness is 10 minutes. Use
Terraform's 'timeouts' argument to override.
Issue: #33