Hi, I’m writing terraform provider. I want up update resource.
Resource has computed parameter guid_id. For update I need to have this parameter as input.
Do we have possibility to describe schema for every operation (For CreateContent, ReadContext,UpdateContect, DeleteContext)? Then I will describe updatecontext schema accordingly
Um, no? Resources have one schema, which defines how a user is supposed to write them in their Terraform files, and what is stored in the state. That is inherently common to all operations.
It is created in POST method( I described as calculated) and used in PUT( not clear how to described)
Terraform throws error:
Can’t configure a value for “guid_id”: its value will be decided automatically based on the result of applying this configuration.
resource my_iaas created resource. guid_id has been generated
Then my_iaas1 updated the same resource. Call has been failed with the error
When expanding the plan for orch_iaas_resource.my_iaas1 to include new values learned so far during apply, provider "localhost/company/orch
" produced an
│ invalid new value for .guid_id: was null, but now cty.StringVal(“a93a5416-d9fa-4191-8fd7-11751449ea20”).
In different topic someone advised to have update in the same block.
I will try to implement it. I described guid_id as optional.
If you have an another idea how to update resource where key is generated please let me know.
@dtrvno The user you’re replying to appears to be a link spammer, using ChatGPT or similar to construct a vaguely plausible but pointless message. They will later return and edit a link to some other website they’re trying pump the search engine ranking of, when they think no-one is paying attention to this topic any more.
There is sadly an epidemic of this abuse on this forum right now. I’ve seen the pattern so many times by now, so I’ve already reported the post to moderators.