Skip to content

devsisters/azure-terraform

 
 

Repository files navigation

README

Sample architecture

sample architecture

N-Tier architecture service with a jumphost and a NAT instance. NAT instance is used for SNATing outbound from VMs in app-subnet.

How to run

Preparation

Download and install terraform: https://www.terraform.io/downloads.html

Update variables such as subscription_id and admin_name in variables.tf

Azure Service principal

Run following command to get a service principal info. Note that if you have multiple subscriptions then you should set right default subscription.

az account set -s <subscription_id>
az ad sp create-for-rbac

Run terraform

Initialize first,

terraform init

Then apply terraform

terraform apply

Feature high light

  1. VM login - ssh public key or password
  2. Disk - OS disk with >30GiB and datadisk
  3. OS image - default or custom image for building custom image, refer packer
  4. Create multiple VMs
  5. Setting LB
  6. NAT instance - provision NAT instance, configure UDR and configure NAT using VM extension

For more information, refer DOC.md

SNAT test

After provisioned, login to one of app vm through jump box and test source ip using following command

wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

Reference

Azure

Terraform

Tips

Releases

No releases published

Packages

No packages published

Languages

  • HCL 97.8%
  • Shell 2.2%