Comments (5)
I misunderstood the intent - reopening.
I think it would help most to understand the workflow that your API server uses. Can you please describe it in more detail?
What I understand so far:
- Objects live under
/webhooks
- To create an object, you use PUT to
/webhooks/<some ID fetched by a datasource>
per your config - The provider returns a result in JSON and the ID of the object is in
result.id
- You override what the API server responds with and force the internal ID to be
update_result_webhook1
- On the second run, the provider asks
/webhooks/update_result_webhook1
for info, but gets a 404 - You're no longer talking about the Infoblox API, but rather some other API
What is particularly confusing, though, is why you reference a datasource (data.restapi_object.get_webhook1.id
) from the resource that should be managing that object. There shouldn't be a datasource in play here that I know of.
I think you need to...
- Remove the datasource since you should create the object in the resource, not out of band
- stop setting
id_attribute
and let the create action get the ID from the result
I strongly encourage following the readme to produce debug logs. If you understand the API you're working with a bit, seeing how the provider interacts with it through the debug logs should provide a lot of insight into how the configuration values come into play.
from terraform-provider-restapi.
Let's continue the conversation in #46 - it looks config related.
from terraform-provider-restapi.
My intention is to update the object with ID, and I need to set update_method
and create_method
to PUT for the provider and use create_path
on resource to update the object.
Is that setup required?
from terraform-provider-restapi.
Sorry for the slow reply, @cnguyenp, I missed your message. I'm afraid I don't fully understand. I think it would be best to enable debug logging and see what the API is saying in response to your creation attempt and compare that to the values used in the configuration. Hopefully that provides some breadcrumbs to follow in order to locate the misconfiguration.
from terraform-provider-restapi.
Closing this issue since it's been a while. Feel free to reopen with more information.
from terraform-provider-restapi.
Related Issues (20)
- "POST" not working as destroy method HOT 2
- How to build / test local changes to the provider. HOT 3
- import is not documented
- Add support to ignore changes in read-only attributes HOT 2
- Incorrect License Display in GitHub REST API
- How to update predefined resources (already created by default)? HOT 1
- Diff is not shown in case of manual changes outside of terraform
- Error while installing mastercard/restapi v1.18.0: error checking (signature: openpgp: key expired)
- Pulling in data from endpoint with no query parameters?
- Support for different Content-Type / Headers for each method
- Delete API not triggered on destroy (redux)
- [Feature Request] Moving all the parameters from the provider to restapi_object
- Multiple base URIs
- [curl] allow request body, content-type to be provided as strings
- Error: internal validation failed; object ID is not set, but may have been created; this should never happen HOT 1
- terraform import ignore query_string
- restapi_object data is not optional
- Read Data Support Breaks APIs that don't accept a body for GET method HOT 2
- HTTP Method Specific Headers
- Resource not recreated if not found with `read_search`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-restapi.