About the publication of a book containing Terraform code

Hello. I am a college student studying Terraform.

Is there any legal problem if I publish a book that includes Terraform code and explanations? I heard it is open source, but I am also confused because there are many stories about it being a paid platform. Is there any problem if I make money through a book that only includes Terraform code and explanations?

The usual disclaimers (IANAL), but if you’re including your HCL (vs. the source code of the core Terraform code base), it should not be an issue. The licensing of terraform itself does not affect your ability to publish or license your HCL code as you wish.

You should probably give appropriate credit if you’re including HCL examples that are derivative, but that would probably be the case regardless of Hashicorp’s licensing changes.