You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have created an api-gateway module, and it fails to upload new ones, because the module is constantly being replaced even where there are no changes to the resource or the api.yaml, according to the plan the openapi_documents.document.contents is whats causing the replacement to happen, even though the base64 string is the same. I have tested this with 3.76.0 and 3.82.0 providers.
If this approach is incorrect, what best practices should we use, to avoid recreating the gateway with each deployment even when changes didnt happen?
You haven't included your data source configuration, but I'm guessing that it is deferred until apply-time, which causes the .rendered attribute to be unknown until apply-time, which makes the API Gateway Config unable to know what the value of contents will be so it cannot accurately compare it, triggering the recreate.
To get around this you may want to compile the template once and save that as a file, or change how the template is compiled to make it known at plan-time (not sure if this is possible with your setup)
you were completely right, thanks for the link about data lifecycle, i had spent most of last night, and i couldn't understand why it kept updating the resource. I had looked into locals lifecycle for something else, but end up missing looking up at the data.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
We have created an api-gateway module, and it fails to upload new ones, because the module is constantly being replaced even where there are no changes to the resource or the api.yaml, according to the plan the
openapi_documents.document.contents
is whats causing the replacement to happen, even though the base64 string is the same. I have tested this with 3.76.0 and 3.82.0 providers.If this approach is incorrect, what best practices should we use, to avoid recreating the gateway with each deployment even when changes didnt happen?
This is the module that creates the gateway:
this is the change with the plan:
this is the remote state:
The text was updated successfully, but these errors were encountered: