All of the configurations you’ve written so far have technically been modules, although not particularly interesting ones, since you deployed them directly: if you run apply directly on a module, it’s referred to as a root module. Module basicsĪ Terraform module is very simple: any set of Terraform configuration files in a folder is a module. This blog post corresponds to Chapter 4 of Terraform Up & Running, “How to Create Reusable Infrastructure with Terraform Modules,” so look for the code samples in the 04-terraform-module folders. You can find working sample code for the examples in this blog post in the Terraform: Up & Running code samples repo. In this post, we’ll show you how to use Terraform modules by covering the following topics: You’ll start building everything as a module, creating a library of modules to share within your company, using modules that you find online, and thinking of your entire infrastructure as a collection of reusable modules. ![]() Once you start using them, there’s no going back. Modules are the key ingredient to writing reusable, maintainable, and testable Terraform code. In the previous post, you deployed architecture that looks like this: In this post, you’ll learn how to create reusable infrastructure with Terraform modules. ![]() In Part 3, you saw how to manage Terraform state, file layout, isolation, and locking. In Part 2, you got started with the basic syntax and features of Terraform and used them to deploy a cluster of web servers on AWS. In Part 1, you learned why we picked Terraform as our IAC tool of choice and not Chef, Puppet, Ansible, Pulumi, or CloudFormation. This is Part 4 of the Comprehensive Guide to Terraform series. Update, Sep 28, 2022: We’ve updated this blog post series for Terraform 1.2 and released the 3rd edition of Terraform: Up & Running ! ![]() Update, J: We’ve updated this blog post series for Terraform 0.12 and released the 2nd edition of Terraform: Up & Running ! Update, Novem: We took this blog post series, expanded it, and turned it into a book called Terraform: Up & Running !
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |