cruD resourceHouseDelete()
In terms of the go code, there isn't much you need more as we have gone through everything.
The question still remains, though, about how actually the data is updated on the Cloud side.
Multiverse of Madness: who's pushing to the database?
We have learnt that it is the Terraform engine who executes the resource update operations from the local to the Cloud service. However, what Terraform actually can do is talking to the API endpoints and send the requests, and it is the server side (of the Cloud service) that is actually making the changes.
Being able to interact with (or update) a database through Terraform is great for us because it means that we don't have to care if the DB is Oracle, MariaDB, PostgreSQL, if the syntax is different, if there is a spelling mistake in the database connection url, etc.
The Cloud service has internal functions that handle the operations requested by the
http.requests
. If you wonder how this works on the server side, I recommend you to try Andrews' Free AWS Cloud Bootcamp.Come to think about it, then, it is a pretty risky operation that the Cloud service does exactly what Terraform tells it to do. Imagine, what if Terraform sends a request that asks the Cloud service to delete all the data in their database?
Of course, this is not going to happen because:
For the http request, all the CRUD functions are given a specific endpoint which points to the resources in your account only (the endpoint url ends with your
homeUUID
).The variables
config
andhomeUUID
work as credentials for authenticating the http request. So they know it's you and the database that will be updated concerns your data only.
Resources
Last updated