A helper module that simplifies infrastructure provisioning in multiple phases (or steps).
On Apple macOS, install Homebrew and packages:
brew install terraform
On other platforms, install the appropriate packages.
Copy and paste into your Terraform configuration, insert the variables, and
run terraform init
:
# Insert modules and/or resources here
# Specify the modules and/or resources that should be created in phase1
module "phase1" {
source = "github.com/sicz/terraform-azure/provisioning-phase"
resource_ids = [
module.one.id,
module.two.id,
]
}
# Specify the modules and/or resources that should be created in phase2
module "phase2" {
source = "github.com/sicz/terraform-azure/provisioning-phase"
resource_ids = [
module.another.id,
]
}
Now you can provision your infrastructure in multiple phases:
terraform init
terraform apply -target=module.phase1
terraform apply -target=module.phase2
terraform apply