This Git repository is for a CAF Terraform Landing zone project. You can find more about the backgrounds from here. Good place to start is by skim through the intro.
We are using a tool called Rover. It's Dockerized and local development is done using VSCode and Dev Containers. Prerequisites for getting started are listed here.
Windows 10 & WSL: Make sure there is no "time drift" between your local computer time and the time in Docker containers. Before starting the Dev Container it's good to restart Docker Desktop before continuing.
Windows 10 & WSL2: WSL2 also experiences from similar issues. To fix run
sudo hwclock -s
.
[vscode@e1d53c1ca8ae ~]$ pwd
/home/vscode
[vscode@e1d53c1ca8ae ~]$ sudo mkdir /tf/caf-custom && sudo chown -R $(whoami) tf/caf-custom
[vscode@e1d53c1ca8ae ~]$ git clone https://github.com/Masahigo/caf-terraform-landingzone-example.git /tf/caf-custom
[vscode@e1d53c1ca8ae ~]$ rover login
# Select subscription where Level 0 is provisioned
[vscode@e1d53c1ca8ae ~]$ az account set -s <your-subscription-id>
# Initialize Launchpad to WE (bootstrap level 0)
[vscode@e1d53c1ca8ae ~]$ rover /tf/caf/landingzones/launchpad apply -launchpad -var-file="/tf/caf-custom/tfvars/sandpit/launchpad_opensource_light.tfvars"
# Deploy the Level 1 example LZ using Rover
[vscode@e1d53c1ca8ae ~]$ rover /tf/caf-custom/landingzones/level1_landingzone_example plan -var-file="/tf/caf-custom/tfvars/sandpit/level1_landingzone_example.tfvars"
[vscode@e1d53c1ca8ae ~]$ rover /tf/caf-custom/landingzones/level1_landingzone_example apply -var-file="/tf/caf-custom/tfvars/sandpit/level1_landingzone_example.tfvars"
[vscode@e1d53c1ca8ae ~]$ rover /tf/caf-custom/landingzones/level1_landingzone_example destroy -var-file="/tf/caf-custom/tfvars/sandpit/level1_landingzone_example.tfvars" -auto-approve
bootstrap_sp
landingzones
├── level1_lanzingzone_example
| landingzone.tf
| main.tf
| output.tf
| variables.tf
| versions.tf
├── ...
tfvars
├── ci
├── dev
├── sandpit
| launchpad_opensource_light.tfvars
| level1_landingzone_example.tfvars
├── environment_xyz
├── ...
pipelines
├── ci
| azure_pipelines.yml
├── dev
| azure_pipelines.yml
├── environment_xyz
├── ...
bootstrap_sp
This folder contains shell and Terraform scripts for creating the Service Principal account (level0-bootstrap-sp) needed for Rover in CI/CD.
See the CI/CD instructions for how to set up a pipeline to Azure DevOps.