GithubHelp home page GithubHelp logo

rhadi2005 / caf-terraform-landingzone-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from masahigo/caf-terraform-landingzone-example

0.0 0.0 0.0 28 KB

Example of implementing a simple Lanzing Zone with Terraform following the Cloud Adoption Framework.

Shell 27.76% HCL 72.24%

caf-terraform-landingzone-example's Introduction

Introduction

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.

Getting Started

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.

  1. Installation process
  2. Software dependencies
  3. Latest releases

Local development

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.

1. Initialize Rover in Dev Container from VSCode

[vscode@e1d53c1ca8ae ~]$ pwd
/home/vscode

2. Git checkout this repo from the container

[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

3. Login to Azure tenant and initialize Launchpad

[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"

4. Start developing your Landing Zones!

# 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

File structure

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.

caf-terraform-landingzone-example's People

Contributors

masahigo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.