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.
resource "terratowns_home" "home" {
name = "How to play Arcanum in 2023!"
description = <<DESCRIPTION ...
DESCRIPTION
domain_name = module.home_arcanum_hosting.domain_name
town = "missingo"
content_version = var.arcanum.content_version
}
module "home_arcanum_hosting" {
source = "./modules/terrahome_aws"
user_uuid = var.teacherseat_user_uuid
public_path = var.arcanum.public_path
content_version = var.arcanum.content_version
}
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
Development workflow documentation: 2.6.0 Terraform Cloud and Multi Homes
Last updated