Deploying an Amazon ECS cluster with Terraform
This is the first deployment topic we will go over, and it is essential to understand how this will work. I believe that filling up pages with code doesn’t make much sense; instead, the complete code is available on GitHub per chapter, and in the book, we will use code snippets to illustrate each step.
Terraform offers a lot of string functions and expressions, which can be very complex to understand first-hand. Therefore, I will try to make the code as simple as possible so that you can understand the code easily if you are a Terraform beginner or an advanced developer.
Decoupling your Terraform code into modules is a typical pattern used in Terraform. For example, customers usually create reusable standalone modules to deploy security groups, ELB, EC2, and so on and then merge them into the root module. To keep the code simple and avoid many inter-module dependencies, I have described the entire Amazon ECS and its components...