-
Notifications
You must be signed in to change notification settings - Fork 11
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
Questions about how to use it #2
Comments
Hey @carlos-alarcon, just saw this... I live this answer for you if you still need it and for future users.. |
Hi I have some questions about how to use the provider:
Let's say we have a rest api and a script which receives
{ "name" : "name1" }
by STDIN and create as first parameter it will create a resource in our system:
{ 'id': 'id-1', 'name': 'name1' }
so if we set:
resource "multiverse_custom_resource" "own-resource" { executor = "node" script = "script_name" id_key = "id" data = <<EOF { "name": "${var.name}" } EOF }
So it works great to create the resource. And it is stored in the state.
The problem I have is that I need the Id to: read, update and destroy the resource so somehow it should be present in the data when reading, destroying and updating but not when creating since it will be an output from the creation itself.
How do I have to do it?.
I had tried using ${multiverse_custom_resource.own-resource.id} but terraform tell mi there is a cycle which seems very normal
I think it could be done if when doing read/update/destroy the Id is also added to the script as a second param
The text was updated successfully, but these errors were encountered: