Page cover

2 6 0 Terraform Cloud and Multi Homes (HCL)

Andrew deploys multiple homes. This is the end of the project. As the code repeats, Andrew suggests some challenges for us that we can work on.

Code Notes

  • Below is the pattern of houses if we deploy multiple homes.

public
β”œβ”€β”€ home1
β”‚   β”œβ”€β”€ assets
β”‚   β”‚   β”œβ”€β”€ ...
β”‚   β”‚   └── image.jpg
β”‚   β”œβ”€β”€ index.html
β”‚   └── error.html
β”œβ”€β”€ home2
β”‚   β”œβ”€β”€ assets
β”‚   β”‚   β”œβ”€β”€ ...
β”‚   β”‚   └── image.jpg
β”‚   β”œβ”€β”€ index.html
└── └── error.html 

Below is how we create them. We repeat the entire resource and module blocks as many times as we would like to create homes.

Explore and try to optimise the code so we can still create the same number of homes with less line of code with increased simplicity.

Resources

Last updated