If you export a Terraform plan, it is a binary file.

Now, calls to a cloud management interface are HTTP calls following corresponding REST APIs.

Does this mean this internal Terraform format somehow encodes these calls through some enumerations?

Like, given in the plan it would be, "B#3$1$2" which then translate "call the API function we have given number 3 passing values 1 and 2 as arguments"?

How does it work?


Terraform use protobuf to store the plans according to its code

// writeTfplan serializes the given plan into the protobuf-based format used
// for the "tfplan" portion of a plan file.

You can find here the code generating the plan file.

So in brief that's a binary file with a serialized version of what to do in a portable format (protocol buffers) for which you find more information here

  • still I am not sure I understand the path from say for Apache CS createVPC() to the buffer. Do they describe ressources as models? Okay but then, which part is the actual client of the API doing the call? Or do the APIs also talk the protocol buffer format as well besides REST API? Dec 14 '18 at 12:54
  • 1
    No, that's just a configuration file, what calls the API is still terraform, think of it like base64 encoding, it's just a way to store objects to be easily reloaded later
    – Tensibai
    Dec 14 '18 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.