├── .gitignore ├── 01-Infrastructure-as-Code-IaC-Basics └── README.md ├── 02-Install-Tools-TerraformCLI-AzureCLI-VSCodeIDE ├── README.md └── images-reference │ ├── xcode-install-1.png │ ├── xcode-install-2.png │ ├── xcode-install-3.png │ └── xcode-install-4.png ├── 03-Terraform-Command-Basics ├── README.md └── terraform-manifests │ └── azure-resource-group.tf ├── 04-Terraform-Language-Syntax ├── README.md └── terraform-manifests │ └── top-level-blocks-samples.tf ├── 05-Terraform-Provider-Resource-Block-Basics ├── README.md ├── sample-terraform-settings.tf └── terraform-manifests │ ├── c1-versions.tf │ └── c2-resource-group.tf ├── 06-Azure-Terraform-VsCode-Plugin ├── README.md └── terraform-manifests │ ├── c1-versions.tf │ ├── c2-resource-group.tf │ ├── graph-old.png │ └── graph.png ├── 07-Multiple-Provider-Configurations ├── README.md └── terraform-manifests │ ├── c1-versions.tf │ └── c2-resource-group.tf ├── 08-Providers-Dependency-Lock-File ├── README.md └── terraform-manifests │ ├── .terraform.lock.hcl-v1.44 │ ├── c1-versions.tf │ └── c2-resource-group-storage-container.tf ├── 09-Resource-Syntax-and-Behavior ├── README.md └── terraform-manifests │ ├── c1-versions.tf │ ├── c2-resource-group.tf │ └── c3-virtual-network.tf ├── 10-Azure-Virtual-Network-4Tier ├── README.md ├── section-10-vnet-nsg-diagram.png └── terraform-manifests │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ └── terraform.tfvars ├── 11-Azure-Linux-Virtual-Machine ├── README.md └── terraform-manifests │ ├── app-scripts │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ ├── c7-01-web-linuxvm-input-variables.tf │ ├── c7-02-web-linuxvm-publicip.tf │ ├── c7-03-web-linuxvm-network-interface.tf │ ├── c7-04-web-linuxvm-network-security-group.tf │ ├── c7-05-web-linuxvm-resource.tf │ ├── c7-06-web-linuxvm-outputs.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 12-Azure-Bastion-Service-and-Host ├── README.md └── terraform-manifests │ ├── app-scripts │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ ├── c7-01-web-linuxvm-input-variables.tf │ ├── c7-02-web-linuxvm-publicip.tf │ ├── c7-03-web-linuxvm-network-interface.tf │ ├── c7-04-web-linuxvm-network-security-group.tf │ ├── c7-05-web-linuxvm-resource.tf │ ├── c7-06-web-linuxvm-outputs.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 13-Azure-Standard-LoadBalancer-using-Portal ├── README.md └── app-scripts │ └── redhat-webvm-script.sh ├── 14-Azure-Standard-LoadBalancer-Basic ├── README.md └── terraform-manifests │ ├── app-scripts │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ ├── c7-01-web-linuxvm-input-variables.tf │ ├── c7-02-web-linuxvm-publicip.tf │ ├── c7-03-web-linuxvm-network-interface.tf │ ├── c7-04-web-linuxvm-network-security-group.tf │ ├── c7-05-web-linuxvm-resource.tf │ ├── c7-06-web-linuxvm-outputs.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-web-loadbalancer-input-variables.tf │ ├── c9-02-web-loadbalancer-resource.tf │ ├── c9-03-web-loadbalancer-outputs.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 15-Azure-Standard-LoadBalancer-Inbound-NATRules ├── README.md └── terraform-manifests │ ├── app-scripts │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ ├── c7-01-web-linuxvm-input-variables.tf │ ├── c7-02-web-linuxvm-publicip.tf │ ├── c7-03-web-linuxvm-network-interface.tf │ ├── c7-04-web-linuxvm-network-security-group.tf │ ├── c7-05-web-linuxvm-resource.tf │ ├── c7-06-web-linuxvm-outputs.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-web-loadbalancer-input-variables.tf │ ├── c9-02-web-loadbalancer-resource.tf │ ├── c9-03-web-loadbalancer-outputs.tf │ ├── c9-04-web-loadbalancer-inbound-nat-rules.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 16-Azure-SLB-VM-with-MetaArgument-Count ├── README.md └── terraform-manifests │ ├── app-scripts │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ ├── c7-01-web-linuxvm-input-variables.tf │ ├── c7-02-web-linuxvm-publicip.tf │ ├── c7-03-web-linuxvm-network-interface.tf │ ├── c7-04-web-linuxvm-network-security-group.tf │ ├── c7-05-web-linuxvm-resource.tf │ ├── c7-06-web-linuxvm-outputs.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-web-loadbalancer-input-variables.tf │ ├── c9-02-web-loadbalancer-resource.tf │ ├── c9-03-web-loadbalancer-outputs.tf │ ├── c9-04-web-loadbalancer-inbound-nat-rules.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 17-Azure-SLB-VM-with-for-each-and-for-loops ├── README.md └── terraform-manifests │ ├── app-scripts │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ ├── c7-01-web-linuxvm-input-variables.tf │ ├── c7-02-web-linuxvm-publicip.tf │ ├── c7-03-web-linuxvm-network-interface.tf │ ├── c7-04-web-linuxvm-network-security-group.tf │ ├── c7-05-web-linuxvm-resource.tf │ ├── c7-06-web-linuxvm-outputs.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-web-loadbalancer-input-variables.tf │ ├── c9-02-web-loadbalancer-resource.tf │ ├── c9-03-web-loadbalancer-outputs.tf │ ├── c9-04-web-loadbalancer-inbound-nat-rules.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 18-Azure-VM-ScaleSets-Manual-scaling ├── README.md └── terraform-manifests │ ├── app-scripts │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-resource.tf │ ├── c7-04-web-linux-vmss-autoscaling-cpu-usage.tf │ ├── c7-05-web-linux-vmss-outputs.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-web-loadbalancer-input-variables.tf │ ├── c9-02-web-loadbalancer-resource.tf │ ├── c9-03-web-loadbalancer-outputs.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 19-Azure-VM-ScaleSets-Auto-scaling ├── README.md ├── default-profile.json ├── terraform-manifests-autoscaling │ ├── app-scripts │ │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-resource.tf │ ├── c7-04-web-linux-vmss-outputs.tf │ ├── c7-05-web-linux-vmss-autoscaling-default-profile.tf │ ├── c7-06-web-linux-vmss-autoscaling-default-and-recurrence-profiles.tf │ ├── c7-07-web-linux-vmss-autoscaling-default-recurrence-fixed-profiles.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-web-loadbalancer-input-variables.tf │ ├── c9-02-web-loadbalancer-resource.tf │ ├── c9-03-web-loadbalancer-outputs.tf │ ├── ssh-keys │ │ ├── terraform-azure.pem │ │ └── terraform-azure.pub │ └── terraform.tfvars └── terraform-manifests-manualscaling │ ├── app-scripts │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-resource.tf │ ├── c7-04-web-linux-vmss-autoscaling-cpu-usage.tf │ ├── c7-05-web-linux-vmss-outputs.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-web-loadbalancer-input-variables.tf │ ├── c9-02-web-loadbalancer-resource.tf │ ├── c9-03-web-loadbalancer-outputs.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 20-Azure-External-and-Internal-LB-with-VMSS ├── README.md └── terraform-manifests │ ├── app-scripts │ ├── app1.conf │ ├── redhat-appvm-script.sh │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c10-01-storage-account-input-variables.tf │ ├── c10-02-storage-account.tf │ ├── c10-03-storage-account-outputs.tf │ ├── c11-01-azure-nat-gateway-input-variables.tf │ ├── c11-02-azure-nat-gateway-resource.tf │ ├── c11-03-azure-nat-gateway-outputs.tf │ ├── c12-01-app-linux-vmss-input-variables.tf │ ├── c12-02-app-linux-vmss-nsg-inline-basic.tf │ ├── c12-03-app-linux-vmss-resource.tf │ ├── c12-04-app-linux-vmss-autoscaling-default-profile.tf │ ├── c12-05-app-linux-vmss-outputs.tf │ ├── c13-01-app-loadbalancer-input-variables.tf │ ├── c13-02-app-loadbalancer-resource.tf │ ├── c13-03-app-loadbalancer-outputs.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-resource.tf │ ├── c7-04-web-linux-vmss-outputs.tf │ ├── c7-05-web-linux-vmss-autoscaling-default-profile.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-web-loadbalancer-input-variables.tf │ ├── c9-02-web-loadbalancer-resource.tf │ ├── c9-03-web-loadbalancer-outputs.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 21-Azure-Private-DNS-Zones ├── README.md └── terraform-manifests │ ├── app-scripts │ ├── app1.conf │ ├── redhat-appvm-script.sh │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c10-01-storage-account-input-variables.tf │ ├── c10-02-storage-account.tf │ ├── c10-03-storage-account-outputs.tf │ ├── c11-01-azure-nat-gateway-input-variables.tf │ ├── c11-02-azure-nat-gateway-resource.tf │ ├── c11-03-azure-nat-gateway-outputs.tf │ ├── c12-01-app-linux-vmss-input-variables.tf │ ├── c12-02-app-linux-vmss-nsg-inline-basic.tf │ ├── c12-03-app-linux-vmss-resource.tf │ ├── c12-04-app-linux-vmss-autoscaling-default-profile.tf │ ├── c12-05-app-linux-vmss-outputs.tf │ ├── c13-01-app-loadbalancer-input-variables.tf │ ├── c13-02-app-loadbalancer-resource.tf │ ├── c13-03-app-loadbalancer-outputs.tf │ ├── c14-01-private-dns-zone-input-variables.tf │ ├── c14-02-private-dns-zone.tf │ ├── c14-03-private-dns-zone-outputs.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-resource.tf │ ├── c7-04-web-linux-vmss-outputs.tf │ ├── c7-05-web-linux-vmss-autoscaling-default-profile.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-web-loadbalancer-input-variables.tf │ ├── c9-02-web-loadbalancer-resource.tf │ ├── c9-03-web-loadbalancer-outputs.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 22-Delegate-DNS-Domain-to-Azure-DNS └── README.md ├── 23-Azure-Public-DNS-Zone ├── README.md └── terraform-manifests │ ├── app-scripts │ ├── app1.conf │ ├── redhat-appvm-script.sh │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c10-01-storage-account-input-variables.tf │ ├── c10-02-storage-account.tf │ ├── c10-03-storage-account-outputs.tf │ ├── c11-01-azure-nat-gateway-input-variables.tf │ ├── c11-02-azure-nat-gateway-resource.tf │ ├── c11-03-azure-nat-gateway-outputs.tf │ ├── c12-01-app-linux-vmss-input-variables.tf │ ├── c12-02-app-linux-vmss-nsg-inline-basic.tf │ ├── c12-03-app-linux-vmss-resource.tf │ ├── c12-04-app-linux-vmss-autoscaling-default-profile.tf │ ├── c12-05-app-linux-vmss-outputs.tf │ ├── c13-01-app-loadbalancer-input-variables.tf │ ├── c13-02-app-loadbalancer-resource.tf │ ├── c13-03-app-loadbalancer-outputs.tf │ ├── c14-01-private-dns-zone-input-variables.tf │ ├── c14-02-private-dns-zone.tf │ ├── c14-03-private-dns-zone-outputs.tf │ ├── c15-01-public-dns-zone-input-variables.tf │ ├── c15-02-public-dns-zone.tf │ ├── c15-03-public-dns-zone-output-values.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-resource.tf │ ├── c7-04-web-linux-vmss-outputs.tf │ ├── c7-05-web-linux-vmss-autoscaling-default-profile.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-web-loadbalancer-input-variables.tf │ ├── c9-02-web-loadbalancer-resource.tf │ ├── c9-03-web-loadbalancer-outputs.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 24-Terraform-Remote-State-Storage ├── README.md └── project-1-eastus2-vmss │ ├── app-scripts │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-resource.tf │ ├── c7-04-web-linux-vmss-outputs.tf │ ├── c7-05-web-linux-vmss-autoscaling-default-profile.tf │ ├── c7-06-web-linux-vmss-autoscaling-default-and-recurrence-profiles.tf │ ├── c7-07-web-linux-vmss-autoscaling-default-recurrence-fixed-profiles.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-web-loadbalancer-input-variables.tf │ ├── c9-02-web-loadbalancer-resource.tf │ ├── c9-03-web-loadbalancer-outputs.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 25-Azure-Traffic-Manager ├── README.md ├── project-1-eastus2-vmss │ ├── app-scripts │ │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-resource.tf │ ├── c7-04-web-linux-vmss-outputs.tf │ ├── c7-05-web-linux-vmss-autoscaling-default-profile.tf │ ├── c7-06-web-linux-vmss-autoscaling-default-and-recurrence-profiles.tf │ ├── c7-07-web-linux-vmss-autoscaling-default-recurrence-fixed-profiles.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-web-loadbalancer-input-variables.tf │ ├── c9-02-web-loadbalancer-resource.tf │ ├── c9-03-web-loadbalancer-outputs.tf │ ├── ssh-keys │ │ ├── terraform-azure.pem │ │ └── terraform-azure.pub │ └── terraform.tfvars ├── project-2-westus2-vmss │ ├── app-scripts │ │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-resource.tf │ ├── c7-04-web-linux-vmss-outputs.tf │ ├── c7-05-web-linux-vmss-autoscaling-default-profile.tf │ ├── c7-06-web-linux-vmss-autoscaling-default-and-recurrence-profiles.tf │ ├── c7-07-web-linux-vmss-autoscaling-default-recurrence-fixed-profiles.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-web-loadbalancer-input-variables.tf │ ├── c9-02-web-loadbalancer-resource.tf │ ├── c9-03-web-loadbalancer-outputs.tf │ ├── ssh-keys │ │ ├── terraform-azure.pem │ │ └── terraform-azure.pub │ └── terraform.tfvars └── project-3-azure-traffic-manager │ ├── c0-remote-state-datasource.tf │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-traffic-manager.tf │ ├── c7-traffic-manager-outputs.tf │ └── terraform.tfvars ├── 26-Azure-Application-Gateway-using-Portal ├── README.md └── terraform-manifests │ ├── app-scripts │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-ag-subnet-and-nsg.tf │ ├── c6-08-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-resource.tf │ ├── c7-04-web-linux-vmss-outputs.tf │ ├── c7-05-web-linux-vmss-autoscaling-default-profile.tf │ ├── c7-06-web-linux-vmss-autoscaling-default-and-recurrence-profiles.tf │ ├── c7-07-web-linux-vmss-autoscaling-default-recurrence-fixed-profiles.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 27-Azure-Application-Gateway-Basics ├── README.md └── terraform-manifests │ ├── app-scripts │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-ag-subnet-and-nsg.tf │ ├── c6-08-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-resource.tf │ ├── c7-04-web-linux-vmss-outputs.tf │ ├── c7-05-web-linux-vmss-autoscaling-default-profile.tf │ ├── c7-06-web-linux-vmss-autoscaling-default-and-recurrence-profiles.tf │ ├── c7-07-web-linux-vmss-autoscaling-default-recurrence-fixed-profiles.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-application-gateway-input-variables.tf │ ├── c9-02-application-gateway-resource.tf │ ├── c9-03-application-gateway-outputs.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 28-Azure-Application-Gateway-Path-Based-Routing ├── README.md └── terraform-manifests │ ├── app-scripts │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-ag-subnet-and-nsg.tf │ ├── c6-08-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-app1-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-app1-resource.tf │ ├── c7-04-web-linux-vmss-app1-autoscaling-default-profile.tf │ ├── c7-05-web-linux-vmss-app2-nsg-inline-basic.tf │ ├── c7-06-web-linux-vmss-app2-resource.tf │ ├── c7-07-web-linux-vmss-app2-autoscaling-default-profile.tf │ ├── c7-08-web-linux-vmss-outputs.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-application-gateway-input-variables.tf │ ├── c9-02-application-gateway-resource.tf │ ├── c9-03-application-gateway-outputs.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 29-Azure-Application-Gateway-Multisite-Hosting ├── README.md └── terraform-manifests │ ├── app-scripts │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-ag-subnet-and-nsg.tf │ ├── c6-08-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-app1-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-app1-resource.tf │ ├── c7-04-web-linux-vmss-app1-autoscaling-default-profile.tf │ ├── c7-05-web-linux-vmss-app2-nsg-inline-basic.tf │ ├── c7-06-web-linux-vmss-app2-resource.tf │ ├── c7-07-web-linux-vmss-app2-autoscaling-default-profile.tf │ ├── c7-08-web-linux-vmss-outputs.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-application-gateway-input-variables.tf │ ├── c9-02-application-gateway-resource.tf │ ├── c9-03-application-gateway-outputs.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 30-Azure-Application-Gateway-SSL-SelfSigned ├── README.md └── terraform-manifests │ ├── app-scripts │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c10-01-storage-account-input-variables.tf │ ├── c10-02-storage-account.tf │ ├── c10-03-storage-account-outputs.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-ag-subnet-and-nsg.tf │ ├── c6-08-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-resource.tf │ ├── c7-04-web-linux-vmss-outputs.tf │ ├── c7-05-web-linux-vmss-autoscaling-default-profile.tf │ ├── c7-06-web-linux-vmss-autoscaling-default-and-recurrence-profiles.tf │ ├── c7-07-web-linux-vmss-autoscaling-default-recurrence-fixed-profiles.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-application-gateway-input-variables.tf │ ├── c9-02-application-gateway-resource.tf │ ├── c9-03-application-gateway-outputs.tf │ ├── custom-error-pages │ ├── 403.html │ ├── 502.html │ ├── error.html │ └── index.html │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ ├── ssl-self-signed │ ├── httpd.crt │ ├── httpd.key │ └── httpd.pfx │ └── terraform.tfvars ├── 31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault ├── README.md └── terraform-manifests │ ├── app-scripts │ └── redhat-webvm-script.sh │ ├── c1-versions.tf │ ├── c10-01-storage-account-input-variables.tf │ ├── c10-02-storage-account.tf │ ├── c10-03-storage-account-outputs.tf │ ├── c11-01-azure-key-vault-input-variables.tf │ ├── c11-02-azure-key-vault-resource.tf │ ├── c11-03-azure-key-vault-outputs.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-ag-subnet-and-nsg.tf │ ├── c6-08-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-resource.tf │ ├── c7-04-web-linux-vmss-outputs.tf │ ├── c7-05-web-linux-vmss-autoscaling-default-profile.tf │ ├── c7-06-web-linux-vmss-autoscaling-default-and-recurrence-profiles.tf │ ├── c7-07-web-linux-vmss-autoscaling-default-recurrence-fixed-profiles.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-application-gateway-input-variables.tf │ ├── c9-02-application-gateway-resource.tf │ ├── c9-03-application-gateway-outputs.tf │ ├── c9-04-application-gateway-managed-identity.tf │ ├── custom-error-pages │ ├── 403.html │ ├── 502.html │ ├── error.html │ └── index.html │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ ├── ssl-self-signed │ ├── httpd.crt │ ├── httpd.key │ └── httpd.pfx │ └── terraform.tfvars ├── 32-Azure-IaC-DevOps ├── Git-Repo-Files │ ├── .gitignore │ ├── README.md │ ├── pipeline-backups │ │ ├── ci-pipeline-backup │ │ │ └── backup-azure-pipelines.yml │ │ └── release-pipeline-backup │ │ │ └── Terraform-CD.json │ └── terraform-manifests │ │ ├── c1-versions.tf │ │ ├── c2-generic-input-variables.tf │ │ ├── c3-locals.tf │ │ ├── c4-random-resources.tf │ │ ├── c5-resource-group.tf │ │ ├── c6-01-vnet-input-variables.tf │ │ ├── c6-02-virtual-network.tf │ │ ├── c6-03-web-subnet-and-nsg.tf │ │ ├── c6-04-app-subnet-and-nsg.tf │ │ ├── c6-05-db-subnet-and-nsg.tf │ │ ├── c6-06-bastion-subnet-and-nsg.tf │ │ ├── c6-07-vnet-outputs.tf │ │ ├── c7-01-web-linuxvm-input-variables.tf │ │ ├── c7-02-web-linuxvm-publicip.tf │ │ ├── c7-03-web-linuxvm-network-interface.tf │ │ ├── c7-04-web-linuxvm-network-security-group.tf │ │ ├── c7-05-web-linuxvm-resource.tf │ │ ├── c7-06-web-linuxvm-outputs.tf │ │ ├── dev.tfvars │ │ ├── prod.tfvars │ │ ├── qa.tfvars │ │ ├── ssh-keys │ │ ├── terraform-azure.pem │ │ └── terraform-azure.pub │ │ ├── stage.tfvars │ │ └── terraform.tfvars └── README.md ├── 33-Azure-MySQL-Single-Server ├── README.md └── terraform-manifests │ ├── c1-versions.tf │ ├── c10-01-storage-account-input-variables.tf │ ├── c10-02-storage-account.tf │ ├── c10-03-storage-account-outputs.tf │ ├── c11-01-mysql-servers-input-variables.tf │ ├── c11-02-mysql-servers-resource.tf │ ├── c11-03-mysql-servers-output-values.tf │ ├── c2-generic-input-variables.tf │ ├── c3-locals.tf │ ├── c4-random-resources.tf │ ├── c5-resource-group.tf │ ├── c6-01-vnet-input-variables.tf │ ├── c6-02-virtual-network.tf │ ├── c6-03-web-subnet-and-nsg.tf │ ├── c6-04-app-subnet-and-nsg.tf │ ├── c6-05-db-subnet-and-nsg.tf │ ├── c6-06-bastion-subnet-and-nsg.tf │ ├── c6-07-ag-subnet-and-nsg.tf │ ├── c6-08-vnet-outputs.tf │ ├── c7-01-web-linux-vmss-input-variables.tf │ ├── c7-02-web-linux-vmss-nsg-inline-basic.tf │ ├── c7-03-web-linux-vmss-resource.tf │ ├── c7-04-web-linux-vmss-outputs.tf │ ├── c7-05-web-linux-vmss-autoscaling-default-profile.tf │ ├── c7-06-web-linux-vmss-autoscaling-default-and-recurrence-profiles.tf │ ├── c7-07-web-linux-vmss-autoscaling-default-recurrence-fixed-profiles.tf │ ├── c8-01-bastion-host-input-variables.tf │ ├── c8-02-bastion-host-linuxvm.tf │ ├── c8-03-move-ssh-key-to-bastion-host.tf │ ├── c8-04-AzureBastionService.tf │ ├── c8-05-bastion-outputs.tf │ ├── c9-01-application-gateway-input-variables.tf │ ├── c9-02-application-gateway-resource.tf │ ├── c9-03-application-gateway-outputs.tf │ ├── custom-error-pages │ ├── 403.html │ ├── 502.html │ ├── error.html │ └── index.html │ ├── mysqldb.auto.tfvars │ ├── secrets.tfvars │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ ├── ssl-self-signed │ ├── httpd.crt │ ├── httpd.key │ └── httpd.pfx │ └── terraform.tfvars ├── 34-Terraform-Modules-use-Public-Module ├── README.md └── terraform-manifests │ ├── app-scripts │ └── app1-cloud-init.txt │ ├── c1-versions.tf │ ├── c2-variables.tf │ ├── c3-locals.tf │ ├── c4-resource-group.tf │ ├── c5-virtual-network.tf │ ├── c6-linux-virtual-machine.tf │ ├── c7-outputs.tf │ ├── ssh-keys │ ├── terraform-azure.pem │ └── terraform-azure.pub │ └── terraform.tfvars ├── 35-Terraform-Azure-Static-Website ├── README.md ├── static-content │ ├── error.html │ └── index.html └── terraform-manifests │ ├── main.tf │ ├── outputs.tf │ ├── terraform.tfvars │ ├── variables.tf │ └── versions.tf ├── 36-Terraform-Modules-Build-Local-Module ├── README.md ├── static-content │ ├── error.html │ └── index.html └── terraform-manifests │ ├── c1-versions.tf │ ├── c2-variables.tf │ ├── c3-static-website.tf │ ├── c4-outputs.tf │ └── modules │ └── azure-static-website │ ├── LICENSE │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ ├── variables.tf │ └── versions.tf ├── 37-Terraform-Module-Publish-to-Public-Registry ├── README.md ├── static-content │ ├── error.html │ └── index.html ├── terraform-azure-static-website-module-manifests │ ├── LICENSE │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ ├── variables.tf │ └── versions.tf └── terraform-manifests │ ├── c1-versions.tf │ ├── c2-variables.tf │ ├── c3-static-website.tf │ └── c4-outputs.tf ├── 38-Terraform-Module-Sources ├── README.md └── terraform-manifests │ ├── c1-versions.tf │ ├── c2-variables.tf │ ├── c3-static-website.tf │ └── c4-outputs.tf ├── README.md ├── course-presentation └── Terraform-on-Azure-Cloud-v9.pptx └── git-deploy.sh /01-Infrastructure-as-Code-IaC-Basics/README.md: -------------------------------------------------------------------------------- 1 | # Infrastructure as Code Basics 2 | 3 | ## Step-01: Understand Problems with Traditional way of Managing Infrastructure 4 | - Time it takes for building multiple environments 5 | - Issues we face with different environments 6 | - Scale-Up and Scale-Down On-Demand 7 | 8 | ## Step-02: Discuss how IaC with Terraform Solves them 9 | - Visibility 10 | - Stability 11 | - Scalability 12 | - Security 13 | - Audit -------------------------------------------------------------------------------- /02-Install-Tools-TerraformCLI-AzureCLI-VSCodeIDE/images-reference/xcode-install-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stacksimplify/terraform-on-azure-cloud/0674111699a3ac47a060d58e60b0648b0bf67e4c/02-Install-Tools-TerraformCLI-AzureCLI-VSCodeIDE/images-reference/xcode-install-1.png -------------------------------------------------------------------------------- /02-Install-Tools-TerraformCLI-AzureCLI-VSCodeIDE/images-reference/xcode-install-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stacksimplify/terraform-on-azure-cloud/0674111699a3ac47a060d58e60b0648b0bf67e4c/02-Install-Tools-TerraformCLI-AzureCLI-VSCodeIDE/images-reference/xcode-install-2.png -------------------------------------------------------------------------------- /02-Install-Tools-TerraformCLI-AzureCLI-VSCodeIDE/images-reference/xcode-install-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stacksimplify/terraform-on-azure-cloud/0674111699a3ac47a060d58e60b0648b0bf67e4c/02-Install-Tools-TerraformCLI-AzureCLI-VSCodeIDE/images-reference/xcode-install-3.png -------------------------------------------------------------------------------- /02-Install-Tools-TerraformCLI-AzureCLI-VSCodeIDE/images-reference/xcode-install-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stacksimplify/terraform-on-azure-cloud/0674111699a3ac47a060d58e60b0648b0bf67e4c/02-Install-Tools-TerraformCLI-AzureCLI-VSCodeIDE/images-reference/xcode-install-4.png -------------------------------------------------------------------------------- /03-Terraform-Command-Basics/terraform-manifests/azure-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Terraform Settings Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" # Optional but recommended in production 8 | } 9 | } 10 | } 11 | 12 | # Configure the Microsoft Azure Provider 13 | provider "azurerm" { 14 | features {} 15 | } 16 | 17 | # Create Resource Group 18 | resource "azurerm_resource_group" "my_demo_rg1" { 19 | location = "eastus" 20 | name = "my-demo-rg1" 21 | } 22 | -------------------------------------------------------------------------------- /05-Terraform-Provider-Resource-Block-Basics/sample-terraform-settings.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | # Required Terraform Version 3 | required_version = ">= 1.0.0" 4 | # Required Providers and their Versions 5 | required_providers { 6 | azurerm = { 7 | source = "hashicorp/azurerm" 8 | version = ">= 2.0" # Optional but recommended 9 | } 10 | } 11 | # Terraform State Storage to Azure Storage Container 12 | backend "azurerm" { 13 | resource_group_name = "terraform-storage-rg" 14 | storage_account_name = "terraformstate201" 15 | container_name = "tfstatefiles" 16 | key = "terraform.tfstate" 17 | } 18 | experiments = [ example ]# Experimental (Not required) 19 | provider_meta "my-provider" { # Super Advanced (Not required) 20 | hello = "world" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /05-Terraform-Provider-Resource-Block-Basics/terraform-manifests/c2-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource Block 2 | # Create a resource group 3 | resource "azurerm_resource_group" "myrg" { 4 | name = "myrg-1" 5 | location = "East US" 6 | } -------------------------------------------------------------------------------- /06-Azure-Terraform-VsCode-Plugin/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | } 10 | } 11 | 12 | # Provider Block 13 | provider "azurerm" { 14 | features {} 15 | } 16 | # 17 | -------------------------------------------------------------------------------- /06-Azure-Terraform-VsCode-Plugin/terraform-manifests/c2-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource Block 2 | # Create a resource group 3 | resource "azurerm_resource_group" "myrg" { 4 | name = "myrg-1" 5 | location = "East US" 6 | } -------------------------------------------------------------------------------- /06-Azure-Terraform-VsCode-Plugin/terraform-manifests/graph-old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stacksimplify/terraform-on-azure-cloud/0674111699a3ac47a060d58e60b0648b0bf67e4c/06-Azure-Terraform-VsCode-Plugin/terraform-manifests/graph-old.png -------------------------------------------------------------------------------- /06-Azure-Terraform-VsCode-Plugin/terraform-manifests/graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stacksimplify/terraform-on-azure-cloud/0674111699a3ac47a060d58e60b0648b0bf67e4c/06-Azure-Terraform-VsCode-Plugin/terraform-manifests/graph.png -------------------------------------------------------------------------------- /07-Multiple-Provider-Configurations/terraform-manifests/c2-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Create a resource group in EastUS region - Uses Default Provider 2 | resource "azurerm_resource_group" "myrg1" { 3 | name = "myrg-1" 4 | location = "East US" 5 | } 6 | 7 | #Create a resource group in WestUS region - Uses "provider2-westus" provider 8 | resource "azurerm_resource_group" "myrg2" { 9 | name = "myrg-2" 10 | location = "West US" 11 | provider = azurerm.provider2-westus 12 | } 13 | 14 | 15 | /* 16 | Additional Note: 17 | provider = . # This is a Meta-Argument from Resources Section nothing but a Special Argument 18 | */ 19 | -------------------------------------------------------------------------------- /08-Providers-Dependency-Lock-File/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 0.15" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = "1.44.0" 8 | #version = ">= 2.0" 9 | } 10 | random = { 11 | source = "hashicorp/random" 12 | version = ">= 3.0" 13 | } 14 | } 15 | } 16 | 17 | # Provider Block 18 | provider "azurerm" { 19 | # features {} 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /09-Resource-Syntax-and-Behavior/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | } 10 | } 11 | 12 | # Provider Block 13 | provider "azurerm" { 14 | features {} 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /09-Resource-Syntax-and-Behavior/terraform-manifests/c2-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "myrg" { 3 | name = "myrg-1" 4 | location = "East US" 5 | } -------------------------------------------------------------------------------- /10-Azure-Virtual-Network-4Tier/section-10-vnet-nsg-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stacksimplify/terraform-on-azure-cloud/0674111699a3ac47a060d58e60b0648b0bf67e4c/10-Azure-Virtual-Network-4Tier/section-10-vnet-nsg-diagram.png -------------------------------------------------------------------------------- /10-Azure-Virtual-Network-4Tier/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | } 14 | } 15 | 16 | # Provider Block 17 | provider "azurerm" { 18 | features {} 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /10-Azure-Virtual-Network-4Tier/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | #name = "${local.owners}-${local.environment}" 7 | common_tags = { 8 | owners = local.owners 9 | environment = local.environment 10 | } 11 | } -------------------------------------------------------------------------------- /10-Azure-Virtual-Network-4Tier/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /10-Azure-Virtual-Network-4Tier/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /10-Azure-Virtual-Network-4Tier/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | -------------------------------------------------------------------------------- /10-Azure-Virtual-Network-4Tier/terraform-manifests/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "eastus" 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | -------------------------------------------------------------------------------- /11-Azure-Linux-Virtual-Machine/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | } 14 | } 15 | 16 | # Provider Block 17 | provider "azurerm" { 18 | features {} 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /11-Azure-Linux-Virtual-Machine/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | #name = "${local.owners}-${local.environment}" 7 | common_tags = { 8 | owners = local.owners 9 | environment = local.environment 10 | } 11 | } -------------------------------------------------------------------------------- /11-Azure-Linux-Virtual-Machine/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /11-Azure-Linux-Virtual-Machine/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /11-Azure-Linux-Virtual-Machine/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /11-Azure-Linux-Virtual-Machine/terraform-manifests/c7-01-web-linuxvm-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. -------------------------------------------------------------------------------- /11-Azure-Linux-Virtual-Machine/terraform-manifests/c7-02-web-linuxvm-publicip.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Create Public IP Address 2 | resource "azurerm_public_ip" "web_linuxvm_publicip" { 3 | name = "${local.resource_name_prefix}-web-linuxvm-publicip" 4 | resource_group_name = azurerm_resource_group.rg.name 5 | location = azurerm_resource_group.rg.location 6 | allocation_method = "Static" 7 | sku = "Standard" 8 | domain_name_label = "app1-vm-${random_string.myrandom.id}" 9 | } 10 | 11 | -------------------------------------------------------------------------------- /11-Azure-Linux-Virtual-Machine/terraform-manifests/c7-03-web-linuxvm-network-interface.tf: -------------------------------------------------------------------------------- 1 | # Resource-2: Create Network Interface 2 | resource "azurerm_network_interface" "web_linuxvm_nic" { 3 | name = "${local.resource_name_prefix}-web-linuxvm-nic" 4 | location = azurerm_resource_group.rg.location 5 | resource_group_name = azurerm_resource_group.rg.name 6 | 7 | ip_configuration { 8 | name = "web-linuxvm-ip-1" 9 | subnet_id = azurerm_subnet.websubnet.id 10 | private_ip_address_allocation = "Dynamic" 11 | public_ip_address_id = azurerm_public_ip.web_linuxvm_publicip.id 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /11-Azure-Linux-Virtual-Machine/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDBFiBa06YLmZdZ1+1xIvb3MNlazIDDw0b7DbAWKZlMd2is3XgZ6NYpN52DlJA1lzFpnlgUtdtqIMlnrYfu81I86umeY8VtjfmHAEbFrmjUOVO/0ITOOvCjwdnN88p/2UiyveAckTeR3hT9t1QAsUmDITJ6PhcprYB6vb401QF+DV90fxDiYRyFq9yOXlGG8Ux7oFSkVOw0SmdUobmDk/mcW92L+a+hIcCED3wGVhxDbKJR+25xOfPcgg2iA+scKoFX558RPAL2F20DhwVkFb29HYuZabTOrSajtWaUOFlsJ3gspFh3FW//xLgBJ19P7W/zNNDY9jXSkY1sNwnYc4AdOafHxvT+pdA0FrrhzVrA11XHB3JwzJxCDSxxtX2NtcpoCPGkwPapUvoUrIoExfbBQ0BiWhVPkeeG1xC70c1iaTcrDgG/3vSdBnI63McSJsfPN4wLLjVU8jdLJ+++Q5K8Csi22l/6FQfrVOn6qEslSwdeCmUtpcxlJHih85krHXf9OOICQeiifFaLibUIqPln6By3/1QQKNSjx2G8aZwjSNTPMccAhrJkO96tTumxjdf+ARqNZtPxTI+mpKrQagEbCeL2n6+JNc8fe4s0hIKHcXY+olAcCa1MwQUwtSf5yFn6hAdbsIU4iqvDOSYVJe+POfrk1mDIsT7iorGiBOGZZw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /11-Azure-Linux-Virtual-Machine/terraform-manifests/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "eastus" 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | -------------------------------------------------------------------------------- /12-Azure-Bastion-Service-and-Host/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /12-Azure-Bastion-Service-and-Host/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | #name = "${local.owners}-${local.environment}" 7 | common_tags = { 8 | owners = local.owners 9 | environment = local.environment 10 | } 11 | } -------------------------------------------------------------------------------- /12-Azure-Bastion-Service-and-Host/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /12-Azure-Bastion-Service-and-Host/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /12-Azure-Bastion-Service-and-Host/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /12-Azure-Bastion-Service-and-Host/terraform-manifests/c7-01-web-linuxvm-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. -------------------------------------------------------------------------------- /12-Azure-Bastion-Service-and-Host/terraform-manifests/c7-02-web-linuxvm-publicip.tf: -------------------------------------------------------------------------------- 1 | /* 2 | # Resource-1: Create Public IP Address 3 | resource "azurerm_public_ip" "web_linuxvm_publicip" { 4 | name = "${local.resource_name_prefix}-web-linuxvm-publicip" 5 | resource_group_name = azurerm_resource_group.rg.name 6 | location = azurerm_resource_group.rg.location 7 | allocation_method = "Static" 8 | sku = "Standard" 9 | #domain_name_label = "app1-vm-${random_string.myrandom.id}" 10 | } 11 | */ 12 | -------------------------------------------------------------------------------- /12-Azure-Bastion-Service-and-Host/terraform-manifests/c7-03-web-linuxvm-network-interface.tf: -------------------------------------------------------------------------------- 1 | # Resource-2: Create Network Interface 2 | resource "azurerm_network_interface" "web_linuxvm_nic" { 3 | name = "${local.resource_name_prefix}-web-linuxvm-nic" 4 | location = azurerm_resource_group.rg.location 5 | resource_group_name = azurerm_resource_group.rg.name 6 | 7 | ip_configuration { 8 | name = "web-linuxvm-ip-1" 9 | subnet_id = azurerm_subnet.websubnet.id 10 | private_ip_address_allocation = "Dynamic" 11 | #public_ip_address_id = azurerm_public_ip.web_linuxvm_publicip.id 12 | } 13 | } -------------------------------------------------------------------------------- /12-Azure-Bastion-Service-and-Host/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | variable "bastion_service_subnet_name" { 3 | description = "Bastion Service Subnet Name" 4 | default = "AzureBastionSubnet" 5 | } 6 | 7 | variable "bastion_service_address_prefixes" { 8 | description = "Bastion Service Address Prefixes" 9 | default = ["10.0.101.0/27"] 10 | } 11 | 12 | -------------------------------------------------------------------------------- /12-Azure-Bastion-Service-and-Host/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | ## Bastion Host Public IP Output 2 | output "bastion_host_linuxvm_public_ip_address" { 3 | description = "Bastion Host Linux VM Public Address" 4 | value = azurerm_public_ip.bastion_host_publicip.ip_address 5 | } 6 | 7 | -------------------------------------------------------------------------------- /12-Azure-Bastion-Service-and-Host/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /12-Azure-Bastion-Service-and-Host/terraform-manifests/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "eastus" 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | 20 | bastion_service_subnet_name = "AzureBastionSubnet" 21 | bastion_service_address_prefixes = ["10.1.101.0/27"] 22 | -------------------------------------------------------------------------------- /14-Azure-Standard-LoadBalancer-Basic/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /14-Azure-Standard-LoadBalancer-Basic/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | #name = "${local.owners}-${local.environment}" 7 | common_tags = { 8 | owners = local.owners 9 | environment = local.environment 10 | } 11 | } -------------------------------------------------------------------------------- /14-Azure-Standard-LoadBalancer-Basic/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /14-Azure-Standard-LoadBalancer-Basic/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /14-Azure-Standard-LoadBalancer-Basic/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /14-Azure-Standard-LoadBalancer-Basic/terraform-manifests/c7-01-web-linuxvm-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. -------------------------------------------------------------------------------- /14-Azure-Standard-LoadBalancer-Basic/terraform-manifests/c7-02-web-linuxvm-publicip.tf: -------------------------------------------------------------------------------- 1 | /* 2 | # Resource-1: Create Public IP Address 3 | resource "azurerm_public_ip" "web_linuxvm_publicip" { 4 | name = "${local.resource_name_prefix}-web-linuxvm-publicip" 5 | resource_group_name = azurerm_resource_group.rg.name 6 | location = azurerm_resource_group.rg.location 7 | allocation_method = "Static" 8 | sku = "Standard" 9 | #domain_name_label = "app1-vm-${random_string.myrandom.id}" 10 | } 11 | */ 12 | -------------------------------------------------------------------------------- /14-Azure-Standard-LoadBalancer-Basic/terraform-manifests/c7-03-web-linuxvm-network-interface.tf: -------------------------------------------------------------------------------- 1 | # Resource-2: Create Network Interface 2 | resource "azurerm_network_interface" "web_linuxvm_nic" { 3 | name = "${local.resource_name_prefix}-web-linuxvm-nic" 4 | location = azurerm_resource_group.rg.location 5 | resource_group_name = azurerm_resource_group.rg.name 6 | 7 | ip_configuration { 8 | name = "web-linuxvm-ip-1" 9 | subnet_id = azurerm_subnet.websubnet.id 10 | private_ip_address_allocation = "Dynamic" 11 | #public_ip_address_id = azurerm_public_ip.web_linuxvm_publicip.id 12 | } 13 | } -------------------------------------------------------------------------------- /14-Azure-Standard-LoadBalancer-Basic/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | variable "bastion_service_subnet_name" { 4 | description = "Bastion Service Subnet Name" 5 | default = "AzureBastionSubnet" 6 | } 7 | 8 | variable "bastion_service_address_prefixes" { 9 | description = "Bastion Service Address Prefixes" 10 | default = ["10.0.101.0/27"] 11 | } 12 | -------------------------------------------------------------------------------- /14-Azure-Standard-LoadBalancer-Basic/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | ## Bastion Host Public IP Output 2 | output "bastion_host_linuxvm_public_ip_address" { 3 | description = "Bastion Host Linux VM Public Address" 4 | value = azurerm_public_ip.bastion_host_publicip.ip_address 5 | } 6 | 7 | -------------------------------------------------------------------------------- /14-Azure-Standard-LoadBalancer-Basic/terraform-manifests/c9-01-web-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Placeholder file for Load Balancer Input Variables -------------------------------------------------------------------------------- /14-Azure-Standard-LoadBalancer-Basic/terraform-manifests/c9-03-web-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Public IP 2 | output "web_lb_public_ip_address" { 3 | description = "Web Load Balancer Public Address" 4 | value = azurerm_public_ip.web_lbpublicip.ip_address 5 | } 6 | 7 | # Load Balancer ID 8 | output "web_lb_id" { 9 | description = "Web Load Balancer ID." 10 | value = azurerm_lb.web_lb.id 11 | } 12 | 13 | # Load Balancer Frontend IP Configuration Block 14 | output "web_lb_frontend_ip_configuration" { 15 | description = "Web LB frontend_ip_configuration Block" 16 | value = [azurerm_lb.web_lb.frontend_ip_configuration] 17 | } -------------------------------------------------------------------------------- /14-Azure-Standard-LoadBalancer-Basic/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /14-Azure-Standard-LoadBalancer-Basic/terraform-manifests/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "eastus" 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | 20 | bastion_service_subnet_name = "AzureBastionSubnet" 21 | bastion_service_address_prefixes = ["10.1.101.0/27"] 22 | -------------------------------------------------------------------------------- /15-Azure-Standard-LoadBalancer-Inbound-NATRules/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /15-Azure-Standard-LoadBalancer-Inbound-NATRules/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | #name = "${local.owners}-${local.environment}" 7 | common_tags = { 8 | owners = local.owners 9 | environment = local.environment 10 | } 11 | } -------------------------------------------------------------------------------- /15-Azure-Standard-LoadBalancer-Inbound-NATRules/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /15-Azure-Standard-LoadBalancer-Inbound-NATRules/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /15-Azure-Standard-LoadBalancer-Inbound-NATRules/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /15-Azure-Standard-LoadBalancer-Inbound-NATRules/terraform-manifests/c7-01-web-linuxvm-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. -------------------------------------------------------------------------------- /15-Azure-Standard-LoadBalancer-Inbound-NATRules/terraform-manifests/c7-02-web-linuxvm-publicip.tf: -------------------------------------------------------------------------------- 1 | /* 2 | # Resource-1: Create Public IP Address 3 | resource "azurerm_public_ip" "web_linuxvm_publicip" { 4 | name = "${local.resource_name_prefix}-web-linuxvm-publicip" 5 | resource_group_name = azurerm_resource_group.rg.name 6 | location = azurerm_resource_group.rg.location 7 | allocation_method = "Static" 8 | sku = "Standard" 9 | #domain_name_label = "app1-vm-${random_string.myrandom.id}" 10 | } 11 | */ 12 | -------------------------------------------------------------------------------- /15-Azure-Standard-LoadBalancer-Inbound-NATRules/terraform-manifests/c7-03-web-linuxvm-network-interface.tf: -------------------------------------------------------------------------------- 1 | # Resource-2: Create Network Interface 2 | resource "azurerm_network_interface" "web_linuxvm_nic" { 3 | name = "${local.resource_name_prefix}-web-linuxvm-nic" 4 | location = azurerm_resource_group.rg.location 5 | resource_group_name = azurerm_resource_group.rg.name 6 | 7 | ip_configuration { 8 | name = "web-linuxvm-ip-1" 9 | subnet_id = azurerm_subnet.websubnet.id 10 | private_ip_address_allocation = "Dynamic" 11 | #public_ip_address_id = azurerm_public_ip.web_linuxvm_publicip.id 12 | } 13 | } -------------------------------------------------------------------------------- /15-Azure-Standard-LoadBalancer-Inbound-NATRules/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | variable "bastion_service_subnet_name" { 4 | description = "Bastion Service Subnet Name" 5 | default = "AzureBastionSubnet" 6 | } 7 | 8 | variable "bastion_service_address_prefixes" { 9 | description = "Bastion Service Address Prefixes" 10 | default = ["10.0.101.0/27"] 11 | } 12 | -------------------------------------------------------------------------------- /15-Azure-Standard-LoadBalancer-Inbound-NATRules/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | ## Bastion Host Public IP Output 2 | output "bastion_host_linuxvm_public_ip_address" { 3 | description = "Bastion Host Linux VM Public Address" 4 | value = azurerm_public_ip.bastion_host_publicip.ip_address 5 | } 6 | 7 | -------------------------------------------------------------------------------- /15-Azure-Standard-LoadBalancer-Inbound-NATRules/terraform-manifests/c9-01-web-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Placeholder file for Load Balancer Input Variables -------------------------------------------------------------------------------- /15-Azure-Standard-LoadBalancer-Inbound-NATRules/terraform-manifests/c9-03-web-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Public IP 2 | output "web_lb_public_ip_address" { 3 | description = "Web Load Balancer Public Address" 4 | value = azurerm_public_ip.web_lbpublicip.ip_address 5 | } 6 | 7 | # Load Balancer ID 8 | output "web_lb_id" { 9 | description = "Web Load Balancer ID." 10 | value = azurerm_lb.web_lb.id 11 | } 12 | 13 | # Load Balancer Frontend IP Configuration Block 14 | output "web_lb_frontend_ip_configuration" { 15 | description = "Web LB frontend_ip_configuration Block" 16 | value = [azurerm_lb.web_lb.frontend_ip_configuration] 17 | } -------------------------------------------------------------------------------- /15-Azure-Standard-LoadBalancer-Inbound-NATRules/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /15-Azure-Standard-LoadBalancer-Inbound-NATRules/terraform-manifests/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "eastus" 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | 20 | bastion_service_subnet_name = "AzureBastionSubnet" 21 | bastion_service_address_prefixes = ["10.1.101.0/27"] 22 | -------------------------------------------------------------------------------- /16-Azure-SLB-VM-with-MetaArgument-Count/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /16-Azure-SLB-VM-with-MetaArgument-Count/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | #name = "${local.owners}-${local.environment}" 7 | common_tags = { 8 | owners = local.owners 9 | environment = local.environment 10 | } 11 | } -------------------------------------------------------------------------------- /16-Azure-SLB-VM-with-MetaArgument-Count/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /16-Azure-SLB-VM-with-MetaArgument-Count/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /16-Azure-SLB-VM-with-MetaArgument-Count/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /16-Azure-SLB-VM-with-MetaArgument-Count/terraform-manifests/c7-01-web-linuxvm-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | 3 | # Web Linux VM Instance Count 4 | variable "web_linuxvm_instance_count" { 5 | description = "Web Linux VM Instance Count" 6 | type = number 7 | default = 1 8 | } 9 | 10 | # Web LB Inbout NAT Port for All VMs 11 | variable "lb_inbound_nat_ports" { 12 | description = "Web LB Inbound NAT Ports List" 13 | type = list(string) 14 | default = ["1022", "2022", "3022", "4022", "5022"] 15 | } -------------------------------------------------------------------------------- /16-Azure-SLB-VM-with-MetaArgument-Count/terraform-manifests/c7-02-web-linuxvm-publicip.tf: -------------------------------------------------------------------------------- 1 | /* 2 | # Resource-1: Create Public IP Address 3 | resource "azurerm_public_ip" "web_linuxvm_publicip" { 4 | name = "${local.resource_name_prefix}-web-linuxvm-publicip" 5 | resource_group_name = azurerm_resource_group.rg.name 6 | location = azurerm_resource_group.rg.location 7 | allocation_method = "Static" 8 | sku = "Standard" 9 | #domain_name_label = "app1-vm-${random_string.myrandom.id}" 10 | } 11 | */ 12 | -------------------------------------------------------------------------------- /16-Azure-SLB-VM-with-MetaArgument-Count/terraform-manifests/c7-03-web-linuxvm-network-interface.tf: -------------------------------------------------------------------------------- 1 | # Resource-2: Create Network Interface 2 | resource "azurerm_network_interface" "web_linuxvm_nic" { 3 | count = var.web_linuxvm_instance_count 4 | name = "${local.resource_name_prefix}-web-linuxvm-nic-${count.index}" 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | 8 | ip_configuration { 9 | name = "web-linuxvm-ip-1" 10 | subnet_id = azurerm_subnet.websubnet.id 11 | private_ip_address_allocation = "Dynamic" 12 | #public_ip_address_id = azurerm_public_ip.web_linuxvm_publicip.id 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /16-Azure-SLB-VM-with-MetaArgument-Count/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | variable "bastion_service_subnet_name" { 4 | description = "Bastion Service Subnet Name" 5 | default = "AzureBastionSubnet" 6 | } 7 | 8 | variable "bastion_service_address_prefixes" { 9 | description = "Bastion Service Address Prefixes" 10 | default = ["10.0.101.0/27"] 11 | } 12 | -------------------------------------------------------------------------------- /16-Azure-SLB-VM-with-MetaArgument-Count/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | ## Bastion Host Public IP Output 2 | output "bastion_host_linuxvm_public_ip_address" { 3 | description = "Bastion Host Linux VM Public Address" 4 | value = azurerm_public_ip.bastion_host_publicip.ip_address 5 | } 6 | 7 | -------------------------------------------------------------------------------- /16-Azure-SLB-VM-with-MetaArgument-Count/terraform-manifests/c9-01-web-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Placeholder file for Load Balancer Input Variables -------------------------------------------------------------------------------- /16-Azure-SLB-VM-with-MetaArgument-Count/terraform-manifests/c9-03-web-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Public IP 2 | output "web_lb_public_ip_address" { 3 | description = "Web Load Balancer Public Address" 4 | value = azurerm_public_ip.web_lbpublicip.ip_address 5 | } 6 | 7 | # Load Balancer ID 8 | output "web_lb_id" { 9 | description = "Web Load Balancer ID." 10 | value = azurerm_lb.web_lb.id 11 | } 12 | 13 | # Load Balancer Frontend IP Configuration Block 14 | output "web_lb_frontend_ip_configuration" { 15 | description = "Web LB frontend_ip_configuration Block" 16 | value = [azurerm_lb.web_lb.frontend_ip_configuration] 17 | } -------------------------------------------------------------------------------- /16-Azure-SLB-VM-with-MetaArgument-Count/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /16-Azure-SLB-VM-with-MetaArgument-Count/terraform-manifests/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "eastus" 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | 20 | bastion_service_subnet_name = "AzureBastionSubnet" 21 | bastion_service_address_prefixes = ["10.1.101.0/27"] 22 | 23 | web_linuxvm_instance_count = 5 24 | lb_inbound_nat_ports = ["1022", "2022", "3022", "4022", "5022"] 25 | -------------------------------------------------------------------------------- /17-Azure-SLB-VM-with-for-each-and-for-loops/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /17-Azure-SLB-VM-with-for-each-and-for-loops/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | #name = "${local.owners}-${local.environment}" 7 | common_tags = { 8 | owners = local.owners 9 | environment = local.environment 10 | } 11 | } -------------------------------------------------------------------------------- /17-Azure-SLB-VM-with-for-each-and-for-loops/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /17-Azure-SLB-VM-with-for-each-and-for-loops/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /17-Azure-SLB-VM-with-for-each-and-for-loops/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /17-Azure-SLB-VM-with-for-each-and-for-loops/terraform-manifests/c7-01-web-linuxvm-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | # Web Linux VM Instance Count 3 | variable "web_linuxvm_instance_count" { 4 | description = "Web Linux VM Instance Count" 5 | type = map(string) 6 | default = { 7 | "vm1" = "1022", 8 | "vm2" = "2022" 9 | } 10 | } -------------------------------------------------------------------------------- /17-Azure-SLB-VM-with-for-each-and-for-loops/terraform-manifests/c7-02-web-linuxvm-publicip.tf: -------------------------------------------------------------------------------- 1 | /* 2 | # Resource-1: Create Public IP Address 3 | resource "azurerm_public_ip" "web_linuxvm_publicip" { 4 | name = "${local.resource_name_prefix}-web-linuxvm-publicip" 5 | resource_group_name = azurerm_resource_group.rg.name 6 | location = azurerm_resource_group.rg.location 7 | allocation_method = "Static" 8 | sku = "Standard" 9 | #domain_name_label = "app1-vm-${random_string.myrandom.id}" 10 | } 11 | */ 12 | -------------------------------------------------------------------------------- /17-Azure-SLB-VM-with-for-each-and-for-loops/terraform-manifests/c7-03-web-linuxvm-network-interface.tf: -------------------------------------------------------------------------------- 1 | # Resource-2: Create Network Interface 2 | resource "azurerm_network_interface" "web_linuxvm_nic" { 3 | for_each = var.web_linuxvm_instance_count 4 | name = "${local.resource_name_prefix}-web-linuxvm-nic-${each.key}" 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | 8 | ip_configuration { 9 | name = "web-linuxvm-ip-1" 10 | subnet_id = azurerm_subnet.websubnet.id 11 | private_ip_address_allocation = "Dynamic" 12 | #public_ip_address_id = azurerm_public_ip.web_linuxvm_publicip.id 13 | } 14 | } -------------------------------------------------------------------------------- /17-Azure-SLB-VM-with-for-each-and-for-loops/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | variable "bastion_service_subnet_name" { 4 | description = "Bastion Service Subnet Name" 5 | default = "AzureBastionSubnet" 6 | } 7 | 8 | variable "bastion_service_address_prefixes" { 9 | description = "Bastion Service Address Prefixes" 10 | default = ["10.0.101.0/27"] 11 | } 12 | -------------------------------------------------------------------------------- /17-Azure-SLB-VM-with-for-each-and-for-loops/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | ## Bastion Host Public IP Output 2 | output "bastion_host_linuxvm_public_ip_address" { 3 | description = "Bastion Host Linux VM Public Address" 4 | value = azurerm_public_ip.bastion_host_publicip.ip_address 5 | } 6 | 7 | -------------------------------------------------------------------------------- /17-Azure-SLB-VM-with-for-each-and-for-loops/terraform-manifests/c9-01-web-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Placeholder file for Load Balancer Input Variables -------------------------------------------------------------------------------- /17-Azure-SLB-VM-with-for-each-and-for-loops/terraform-manifests/c9-03-web-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Public IP 2 | output "web_lb_public_ip_address" { 3 | description = "Web Load Balancer Public Address" 4 | value = azurerm_public_ip.web_lbpublicip.ip_address 5 | } 6 | 7 | # Load Balancer ID 8 | output "web_lb_id" { 9 | description = "Web Load Balancer ID." 10 | value = azurerm_lb.web_lb.id 11 | } 12 | 13 | # Load Balancer Frontend IP Configuration Block 14 | output "web_lb_frontend_ip_configuration" { 15 | description = "Web LB frontend_ip_configuration Block" 16 | value = [azurerm_lb.web_lb.frontend_ip_configuration] 17 | } -------------------------------------------------------------------------------- /17-Azure-SLB-VM-with-for-each-and-for-loops/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /17-Azure-SLB-VM-with-for-each-and-for-loops/terraform-manifests/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "eastus" 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | 20 | bastion_service_subnet_name = "AzureBastionSubnet" 21 | bastion_service_address_prefixes = ["10.1.101.0/27"] 22 | 23 | web_linuxvm_instance_count = { 24 | "vm1" = "1022", 25 | "vm2" = "2022" 26 | } 27 | 28 | -------------------------------------------------------------------------------- /18-Azure-VM-ScaleSets-Manual-scaling/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /18-Azure-VM-ScaleSets-Manual-scaling/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | common_tags = { 7 | owners = local.owners 8 | environment = local.environment 9 | } 10 | } -------------------------------------------------------------------------------- /18-Azure-VM-ScaleSets-Manual-scaling/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /18-Azure-VM-ScaleSets-Manual-scaling/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /18-Azure-VM-ScaleSets-Manual-scaling/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /18-Azure-VM-ScaleSets-Manual-scaling/terraform-manifests/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "web_vmss_nsg_inbound_ports" { 3 | description = "Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /18-Azure-VM-ScaleSets-Manual-scaling/terraform-manifests/c7-04-web-linux-vmss-autoscaling-cpu-usage.tf: -------------------------------------------------------------------------------- 1 | #----------------------------------------------- 2 | # Auto Scaling for Virtual machine scale set 3 | #----------------------------------------------- 4 | # https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_autoscale_setting 5 | # Placeholder till next section and next demo -------------------------------------------------------------------------------- /18-Azure-VM-ScaleSets-Manual-scaling/terraform-manifests/c7-05-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "web_vmss_id" { 4 | description = "Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.web_vmss.id 6 | } -------------------------------------------------------------------------------- /18-Azure-VM-ScaleSets-Manual-scaling/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | variable "bastion_service_subnet_name" { 4 | description = "Bastion Service Subnet Name" 5 | default = "AzureBastionSubnet" 6 | } 7 | 8 | variable "bastion_service_address_prefixes" { 9 | description = "Bastion Service Address Prefixes" 10 | default = ["10.0.101.0/27"] 11 | } 12 | -------------------------------------------------------------------------------- /18-Azure-VM-ScaleSets-Manual-scaling/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | ## Bastion Host Public IP Output 2 | output "bastion_host_linuxvm_public_ip_address" { 3 | description = "Bastion Host Linux VM Public Address" 4 | value = azurerm_public_ip.bastion_host_publicip.ip_address 5 | } 6 | 7 | -------------------------------------------------------------------------------- /18-Azure-VM-ScaleSets-Manual-scaling/terraform-manifests/c9-01-web-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Placeholder file for Load Balancer Input Variables -------------------------------------------------------------------------------- /18-Azure-VM-ScaleSets-Manual-scaling/terraform-manifests/c9-03-web-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Public IP 2 | output "web_lb_public_ip_address" { 3 | description = "Web Load Balancer Public Address" 4 | value = azurerm_public_ip.web_lbpublicip.ip_address 5 | } 6 | 7 | # Load Balancer ID 8 | output "web_lb_id" { 9 | description = "Web Load Balancer ID." 10 | value = azurerm_lb.web_lb.id 11 | } 12 | 13 | # Load Balancer Frontend IP Configuration Block 14 | output "web_lb_frontend_ip_configuration" { 15 | description = "Web LB frontend_ip_configuration Block" 16 | value = [azurerm_lb.web_lb.frontend_ip_configuration] 17 | } -------------------------------------------------------------------------------- /18-Azure-VM-ScaleSets-Manual-scaling/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /18-Azure-VM-ScaleSets-Manual-scaling/terraform-manifests/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "eastus" 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | 20 | bastion_service_subnet_name = "AzureBastionSubnet" 21 | bastion_service_address_prefixes = ["10.1.101.0/27"] 22 | 23 | web_vmss_nsg_inbound_ports = [22, 80, 443] 24 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-autoscaling/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-autoscaling/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | common_tags = { 7 | owners = local.owners 8 | environment = local.environment 9 | } 10 | } -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-autoscaling/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-autoscaling/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-autoscaling/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-autoscaling/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "web_vmss_nsg_inbound_ports" { 3 | description = "Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-autoscaling/c7-04-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "web_vmss_id" { 4 | description = "Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.web_vmss.id 6 | } -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-autoscaling/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | variable "bastion_service_subnet_name" { 4 | description = "Bastion Service Subnet Name" 5 | default = "AzureBastionSubnet" 6 | } 7 | 8 | variable "bastion_service_address_prefixes" { 9 | description = "Bastion Service Address Prefixes" 10 | default = ["10.0.101.0/27"] 11 | } 12 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-autoscaling/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | ## Bastion Host Public IP Output 2 | output "bastion_host_linuxvm_public_ip_address" { 3 | description = "Bastion Host Linux VM Public Address" 4 | value = azurerm_public_ip.bastion_host_publicip.ip_address 5 | } 6 | 7 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-autoscaling/c9-01-web-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Placeholder file for Load Balancer Input Variables -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-autoscaling/c9-03-web-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Public IP 2 | output "web_lb_public_ip_address" { 3 | description = "Web Load Balancer Public Address" 4 | value = azurerm_public_ip.web_lbpublicip.ip_address 5 | } 6 | 7 | # Load Balancer ID 8 | output "web_lb_id" { 9 | description = "Web Load Balancer ID." 10 | value = azurerm_lb.web_lb.id 11 | } 12 | 13 | # Load Balancer Frontend IP Configuration Block 14 | output "web_lb_frontend_ip_configuration" { 15 | description = "Web LB frontend_ip_configuration Block" 16 | value = [azurerm_lb.web_lb.frontend_ip_configuration] 17 | } -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-autoscaling/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-autoscaling/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "eastus" 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | 20 | bastion_service_subnet_name = "AzureBastionSubnet" 21 | bastion_service_address_prefixes = ["10.1.101.0/27"] 22 | 23 | web_vmss_nsg_inbound_ports = [22, 80, 443] -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-manualscaling/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-manualscaling/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | common_tags = { 7 | owners = local.owners 8 | environment = local.environment 9 | } 10 | } -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-manualscaling/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-manualscaling/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-manualscaling/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-manualscaling/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "web_vmss_nsg_inbound_ports" { 3 | description = "Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-manualscaling/c7-04-web-linux-vmss-autoscaling-cpu-usage.tf: -------------------------------------------------------------------------------- 1 | #----------------------------------------------- 2 | # Auto Scaling for Virtual machine scale set 3 | #----------------------------------------------- 4 | # https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_autoscale_setting 5 | # Placeholder till next section and next demo -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-manualscaling/c7-05-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "web_vmss_id" { 4 | description = "Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.web_vmss.id 6 | } -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-manualscaling/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | variable "bastion_service_subnet_name" { 4 | description = "Bastion Service Subnet Name" 5 | default = "AzureBastionSubnet" 6 | } 7 | 8 | variable "bastion_service_address_prefixes" { 9 | description = "Bastion Service Address Prefixes" 10 | default = ["10.0.101.0/27"] 11 | } 12 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-manualscaling/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | ## Bastion Host Public IP Output 2 | output "bastion_host_linuxvm_public_ip_address" { 3 | description = "Bastion Host Linux VM Public Address" 4 | value = azurerm_public_ip.bastion_host_publicip.ip_address 5 | } 6 | 7 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-manualscaling/c9-01-web-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Placeholder file for Load Balancer Input Variables -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-manualscaling/c9-03-web-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Public IP 2 | output "web_lb_public_ip_address" { 3 | description = "Web Load Balancer Public Address" 4 | value = azurerm_public_ip.web_lbpublicip.ip_address 5 | } 6 | 7 | # Load Balancer ID 8 | output "web_lb_id" { 9 | description = "Web Load Balancer ID." 10 | value = azurerm_lb.web_lb.id 11 | } 12 | 13 | # Load Balancer Frontend IP Configuration Block 14 | output "web_lb_frontend_ip_configuration" { 15 | description = "Web LB frontend_ip_configuration Block" 16 | value = [azurerm_lb.web_lb.frontend_ip_configuration] 17 | } -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-manualscaling/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /19-Azure-VM-ScaleSets-Auto-scaling/terraform-manifests-manualscaling/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "eastus" 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | 20 | bastion_service_subnet_name = "AzureBastionSubnet" 21 | bastion_service_address_prefixes = ["10.1.101.0/27"] 22 | 23 | web_vmss_nsg_inbound_ports = [22, 80, 443] 24 | -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/app-scripts/app1.conf: -------------------------------------------------------------------------------- 1 | LoadModule proxy_module modules/mod_proxy.so 2 | LoadModule proxy_balancer_module modules/mod_proxy_balancer.so 3 | LoadModule proxy_http_module modules/mod_proxy_http.so 4 | 5 | 6 | ServerName kubeoncloud.com 7 | ProxyPreserveHost On 8 | ProxyPass /webvm ! 9 | 10 | # Use when only IP Addresses are used - Section-15 11 | ProxyPass / http://10.1.11.241/ 12 | ProxyPassReverse / http://10.1.11.241/ 13 | 14 | # Use the below when using Private DNS Section - Section-16 15 | #ProxyPass / http://applb.terraformguru.com/ 16 | #ProxyPassReverse / http://applb.terraformguru.com/ 17 | 18 | DocumentRoot /var/www/html 19 | 20 | Options -Indexes 21 | Order allow,deny 22 | Allow from all 23 | 24 | 25 | -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c10-03-storage-account-outputs.tf: -------------------------------------------------------------------------------- 1 | # Storage Account Outputs 2 | output "storage_account_primary_access_key" { 3 | value = azurerm_storage_account.storage_account.primary_access_key 4 | sensitive = true 5 | } 6 | output "storage_account_primary_web_endpoint" { 7 | value = azurerm_storage_account.storage_account.primary_web_endpoint 8 | } 9 | output "storage_account_primary_web_host" { 10 | value = azurerm_storage_account.storage_account.primary_web_host 11 | } 12 | output "storage_account_name" { 13 | value = azurerm_storage_account.storage_account.name 14 | } 15 | -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c11-01-azure-nat-gateway-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables Place holder file -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c11-03-azure-nat-gateway-outputs.tf: -------------------------------------------------------------------------------- 1 | # NAT Gateway ID 2 | output "nat_gw_id" { 3 | description = "Azure NAT Gateway ID" 4 | value = azurerm_nat_gateway.natgw.id 5 | } 6 | 7 | # NAT Gateway Public IP 8 | output "nat_gw_public_ip" { 9 | description = "Azure NAT Gateway Public IP Address" 10 | value = azurerm_public_ip.natgw_publicip.ip_address 11 | } 12 | -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c12-01-app-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "app_vmss_nsg_inbound_ports" { 3 | description = "App VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c12-05-app-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "app_vmss_id" { 4 | description = "App Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.app_vmss.id 6 | } -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c13-01-app-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables place holder file -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c13-03-app-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Private IP Address List 2 | output "app_lb_private_ip_addresses" { 3 | description = "Load Balancer Public Address" 4 | value = [azurerm_lb.app_lb.private_ip_addresses] 5 | } 6 | 7 | # Load Balancer ID 8 | output "app_lb_id" { 9 | description = "The Internal Load Balancer ID." 10 | value = azurerm_lb.app_lb.id 11 | } 12 | 13 | # Load Balancer Frontend IP Configuration Block 14 | output "app_lb_frontend_ip_configuration" { 15 | description = "LB frontend_ip_configuration Block" 16 | value = [azurerm_lb.app_lb.frontend_ip_configuration] 17 | } -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | common_tags = { 7 | owners = local.owners 8 | environment = local.environment 9 | } 10 | } -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "web_vmss_nsg_inbound_ports" { 3 | description = "Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c7-04-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "web_vmss_id" { 4 | description = "Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.web_vmss.id 6 | } -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | variable "bastion_service_subnet_name" { 4 | description = "Bastion Service Subnet Name" 5 | default = "AzureBastionSubnet" 6 | } 7 | 8 | variable "bastion_service_address_prefixes" { 9 | description = "Bastion Service Address Prefixes" 10 | default = ["10.0.101.0/27"] 11 | } 12 | -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | ## Bastion Host Public IP Output 2 | output "bastion_host_linuxvm_public_ip_address" { 3 | description = "Bastion Host Linux VM Public Address" 4 | value = azurerm_public_ip.bastion_host_publicip.ip_address 5 | } 6 | 7 | -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c9-01-web-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Placeholder file for Load Balancer Input Variables -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/c9-03-web-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Public IP 2 | output "web_lb_public_ip_address" { 3 | description = "Web Load Balancer Public Address" 4 | value = azurerm_public_ip.web_lbpublicip.ip_address 5 | } 6 | 7 | # Load Balancer ID 8 | output "web_lb_id" { 9 | description = "Web Load Balancer ID." 10 | value = azurerm_lb.web_lb.id 11 | } 12 | 13 | # Load Balancer Frontend IP Configuration Block 14 | output "web_lb_frontend_ip_configuration" { 15 | description = "Web LB frontend_ip_configuration Block" 16 | value = [azurerm_lb.web_lb.frontend_ip_configuration] 17 | } -------------------------------------------------------------------------------- /20-Azure-External-and-Internal-LB-with-VMSS/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/app-scripts/app1.conf: -------------------------------------------------------------------------------- 1 | LoadModule proxy_module modules/mod_proxy.so 2 | LoadModule proxy_balancer_module modules/mod_proxy_balancer.so 3 | LoadModule proxy_http_module modules/mod_proxy_http.so 4 | 5 | 6 | ServerName kubeoncloud.com 7 | ProxyPreserveHost On 8 | ProxyPass /webvm ! 9 | 10 | # Use when only IP Addresses are used 11 | #ProxyPass / http://10.1.11.241/ 12 | #ProxyPassReverse / http://10.1.11.241/ 13 | 14 | # Use the below when using Private DNS Section 15 | ProxyPass / http://applb.terraformguru.com/ 16 | ProxyPassReverse / http://applb.terraformguru.com/ 17 | 18 | DocumentRoot /var/www/html 19 | 20 | Options -Indexes 21 | Order allow,deny 22 | Allow from all 23 | 24 | 25 | -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c10-03-storage-account-outputs.tf: -------------------------------------------------------------------------------- 1 | # Storage Account Outputs 2 | output "storage_account_primary_access_key" { 3 | value = azurerm_storage_account.storage_account.primary_access_key 4 | sensitive = true 5 | } 6 | output "storage_account_primary_web_endpoint" { 7 | value = azurerm_storage_account.storage_account.primary_web_endpoint 8 | } 9 | output "storage_account_primary_web_host" { 10 | value = azurerm_storage_account.storage_account.primary_web_host 11 | } 12 | output "storage_account_name" { 13 | value = azurerm_storage_account.storage_account.name 14 | } 15 | -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c11-01-azure-nat-gateway-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables Place holder file -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c11-03-azure-nat-gateway-outputs.tf: -------------------------------------------------------------------------------- 1 | # NAT Gateway ID 2 | output "nat_gw_id" { 3 | description = "Azure NAT Gateway ID" 4 | value = azurerm_nat_gateway.natgw.id 5 | } 6 | 7 | # NAT Gateway Public IP 8 | output "nat_gw_public_ip" { 9 | description = "Azure NAT Gateway Public IP Address" 10 | value = azurerm_public_ip.natgw_publicip.ip_address 11 | } 12 | -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c12-01-app-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "app_vmss_nsg_inbound_ports" { 3 | description = "App VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c12-05-app-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "app_vmss_id" { 4 | description = "App Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.app_vmss.id 6 | } -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c13-01-app-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables place holder file -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c13-03-app-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Private IP Address List 2 | output "app_lb_private_ip_addresses" { 3 | description = "Load Balancer Public Address" 4 | value = [azurerm_lb.app_lb.private_ip_addresses] 5 | } 6 | 7 | # Load Balancer ID 8 | output "app_lb_id" { 9 | description = "The Internal Load Balancer ID." 10 | value = azurerm_lb.app_lb.id 11 | } 12 | 13 | # Load Balancer Frontend IP Configuration Block 14 | output "app_lb_frontend_ip_configuration" { 15 | description = "LB frontend_ip_configuration Block" 16 | value = [azurerm_lb.app_lb.frontend_ip_configuration] 17 | } -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c14-01-private-dns-zone-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables Place holder file -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c14-03-private-dns-zone-outputs.tf: -------------------------------------------------------------------------------- 1 | # FQDN Outputs 2 | output "fqdn_app_lb" { 3 | description = "App LB FQDN" 4 | value = azurerm_private_dns_a_record.app_lb_dns_record.fqdn 5 | } 6 | -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c2-generic-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Generic Input Variables 2 | # Business Division 3 | variable "business_divsion" { 4 | description = "Business Division in the large organization this Infrastructure belongs" 5 | type = string 6 | default = "sap" 7 | } 8 | # Environment Variable 9 | variable "environment" { 10 | description = "Environment Variable used as a prefix" 11 | type = string 12 | default = "dev" 13 | } 14 | 15 | # Azure Resource Group Name 16 | variable "resource_group_name" { 17 | description = "Resource Group Name" 18 | type = string 19 | default = "rg-default" 20 | } 21 | 22 | # Azure Resources Location 23 | variable "resource_group_location" { 24 | description = "Region in which Azure Resources to be created" 25 | type = string 26 | default = "eastus2" 27 | } 28 | 29 | -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | common_tags = { 7 | owners = local.owners 8 | environment = local.environment 9 | } 10 | } -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "web_vmss_nsg_inbound_ports" { 3 | description = "Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c7-04-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "web_vmss_id" { 4 | description = "Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.web_vmss.id 6 | } -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | variable "bastion_service_subnet_name" { 4 | description = "Bastion Service Subnet Name" 5 | default = "AzureBastionSubnet" 6 | } 7 | 8 | variable "bastion_service_address_prefixes" { 9 | description = "Bastion Service Address Prefixes" 10 | default = ["10.0.101.0/27"] 11 | } 12 | -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | ## Bastion Host Public IP Output 2 | output "bastion_host_linuxvm_public_ip_address" { 3 | description = "Bastion Host Linux VM Public Address" 4 | value = azurerm_public_ip.bastion_host_publicip.ip_address 5 | } 6 | 7 | -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c9-01-web-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Placeholder file for Load Balancer Input Variables -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/c9-03-web-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Public IP 2 | output "web_lb_public_ip_address" { 3 | description = "Web Load Balancer Public Address" 4 | value = azurerm_public_ip.web_lbpublicip.ip_address 5 | } 6 | 7 | # Load Balancer ID 8 | output "web_lb_id" { 9 | description = "Web Load Balancer ID." 10 | value = azurerm_lb.web_lb.id 11 | } 12 | 13 | # Load Balancer Frontend IP Configuration Block 14 | output "web_lb_frontend_ip_configuration" { 15 | description = "Web LB frontend_ip_configuration Block" 16 | value = [azurerm_lb.web_lb.frontend_ip_configuration] 17 | } -------------------------------------------------------------------------------- /21-Azure-Private-DNS-Zones/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/app-scripts/app1.conf: -------------------------------------------------------------------------------- 1 | LoadModule proxy_module modules/mod_proxy.so 2 | LoadModule proxy_balancer_module modules/mod_proxy_balancer.so 3 | LoadModule proxy_http_module modules/mod_proxy_http.so 4 | 5 | 6 | ServerName kubeoncloud.com 7 | ProxyPreserveHost On 8 | ProxyPass /webvm ! 9 | 10 | # Use when only IP Addresses are used - Section-15 11 | #ProxyPass / http://10.1.11.241/ 12 | #ProxyPassReverse / http://10.1.11.241/ 13 | 14 | # Use the below when using Private DNS Section - Section-16 15 | ProxyPass / http://applb.terraformguru.com/ 16 | ProxyPassReverse / http://applb.terraformguru.com/ 17 | 18 | DocumentRoot /var/www/html 19 | 20 | Options -Indexes 21 | Order allow,deny 22 | Allow from all 23 | 24 | 25 | -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c10-03-storage-account-outputs.tf: -------------------------------------------------------------------------------- 1 | # Storage Account Outputs 2 | output "storage_account_primary_access_key" { 3 | value = azurerm_storage_account.storage_account.primary_access_key 4 | sensitive = true 5 | } 6 | output "storage_account_primary_web_endpoint" { 7 | value = azurerm_storage_account.storage_account.primary_web_endpoint 8 | } 9 | output "storage_account_primary_web_host" { 10 | value = azurerm_storage_account.storage_account.primary_web_host 11 | } 12 | output "storage_account_name" { 13 | value = azurerm_storage_account.storage_account.name 14 | } 15 | -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c11-01-azure-nat-gateway-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables Place holder file -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c11-03-azure-nat-gateway-outputs.tf: -------------------------------------------------------------------------------- 1 | # NAT Gateway ID 2 | output "nat_gw_id" { 3 | description = "Azure NAT Gateway ID" 4 | value = azurerm_nat_gateway.natgw.id 5 | } 6 | 7 | # NAT Gateway Public IP 8 | output "nat_gw_public_ip" { 9 | description = "Azure NAT Gateway Public IP Address" 10 | value = azurerm_public_ip.natgw_publicip.ip_address 11 | } 12 | -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c12-01-app-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "app_vmss_nsg_inbound_ports" { 3 | description = "App VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c12-05-app-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "app_vmss_id" { 4 | description = "App Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.app_vmss.id 6 | } -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c13-01-app-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables place holder file -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c13-03-app-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Private IP Address List 2 | output "app_lb_private_ip_addresses" { 3 | description = "Load Balancer Public Address" 4 | value = [azurerm_lb.app_lb.private_ip_addresses] 5 | } 6 | 7 | # Load Balancer ID 8 | output "app_lb_id" { 9 | description = "The Internal Load Balancer ID." 10 | value = azurerm_lb.app_lb.id 11 | } 12 | 13 | # Load Balancer Frontend IP Configuration Block 14 | output "app_lb_frontend_ip_configuration" { 15 | description = "LB frontend_ip_configuration Block" 16 | value = [azurerm_lb.app_lb.frontend_ip_configuration] 17 | } -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c14-01-private-dns-zone-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables Place holder file -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c14-03-private-dns-zone-outputs.tf: -------------------------------------------------------------------------------- 1 | # FQDN Outputs 2 | output "fqdn_app_lb" { 3 | description = "App LB FQDN" 4 | value = azurerm_private_dns_a_record.app_lb_dns_record.fqdn 5 | } 6 | -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c15-01-public-dns-zone-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables Placeholder file -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c15-03-public-dns-zone-output-values.tf: -------------------------------------------------------------------------------- 1 | # DNS Zone Datasource Outputs 2 | output "dns_zone_id" { 3 | value = data.azurerm_dns_zone.dns_zone.id 4 | } 5 | output "dns_zone_name" { 6 | value = data.azurerm_dns_zone.dns_zone.name 7 | } 8 | 9 | # FQDN 10 | output "fqdn_public_dns_1" { 11 | description = "FQDN Public DNS 1" 12 | value = azurerm_dns_a_record.dns_record.fqdn 13 | } 14 | 15 | output "fqdn_public_dns_2" { 16 | description = "FQDN Public DNS 2" 17 | value = azurerm_dns_a_record.dns_record_www.fqdn 18 | } 19 | 20 | output "fqdn_public_dns_3" { 21 | description = "FQDN Public DNS 3" 22 | value = azurerm_dns_a_record.dns_record_app1.fqdn 23 | } -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c2-generic-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Generic Input Variables 2 | # Business Division 3 | variable "business_divsion" { 4 | description = "Business Division in the large organization this Infrastructure belongs" 5 | type = string 6 | default = "sap" 7 | } 8 | # Environment Variable 9 | variable "environment" { 10 | description = "Environment Variable used as a prefix" 11 | type = string 12 | default = "dev" 13 | } 14 | 15 | # Azure Resource Group Name 16 | variable "resource_group_name" { 17 | description = "Resource Group Name" 18 | type = string 19 | default = "rg-default" 20 | } 21 | 22 | # Azure Resources Location 23 | variable "resource_group_location" { 24 | description = "Region in which Azure Resources to be created" 25 | type = string 26 | default = "eastus2" 27 | } 28 | 29 | -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | common_tags = { 7 | owners = local.owners 8 | environment = local.environment 9 | } 10 | } -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "web_vmss_nsg_inbound_ports" { 3 | description = "Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c7-04-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "web_vmss_id" { 4 | description = "Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.web_vmss.id 6 | } -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | variable "bastion_service_subnet_name" { 4 | description = "Bastion Service Subnet Name" 5 | default = "AzureBastionSubnet" 6 | } 7 | 8 | variable "bastion_service_address_prefixes" { 9 | description = "Bastion Service Address Prefixes" 10 | default = ["10.0.101.0/27"] 11 | } 12 | -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | ## Bastion Host Public IP Output 2 | output "bastion_host_linuxvm_public_ip_address" { 3 | description = "Bastion Host Linux VM Public Address" 4 | value = azurerm_public_ip.bastion_host_publicip.ip_address 5 | } 6 | 7 | -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c9-01-web-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Placeholder file for Load Balancer Input Variables -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/c9-03-web-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Public IP 2 | output "web_lb_public_ip_address" { 3 | description = "Web Load Balancer Public Address" 4 | value = azurerm_public_ip.web_lbpublicip.ip_address 5 | } 6 | 7 | # Load Balancer ID 8 | output "web_lb_id" { 9 | description = "Web Load Balancer ID." 10 | value = azurerm_lb.web_lb.id 11 | } 12 | 13 | # Load Balancer Frontend IP Configuration Block 14 | output "web_lb_frontend_ip_configuration" { 15 | description = "Web LB frontend_ip_configuration Block" 16 | value = [azurerm_lb.web_lb.frontend_ip_configuration] 17 | } -------------------------------------------------------------------------------- /23-Azure-Public-DNS-Zone/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /24-Terraform-Remote-State-Storage/project-1-eastus2-vmss/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | #resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | resource_name_prefix = "${var.resource_group_location}-${var.business_divsion}-${var.environment}" 7 | common_tags = { 8 | owners = local.owners 9 | environment = local.environment 10 | Tag = "demo-tag1" # Uncomment during step-08 11 | Tag = "demo-tag2" 12 | Tag = "demo-tag3" 13 | Tag = "demo-tag4" 14 | } 15 | } -------------------------------------------------------------------------------- /24-Terraform-Remote-State-Storage/project-1-eastus2-vmss/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /24-Terraform-Remote-State-Storage/project-1-eastus2-vmss/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /24-Terraform-Remote-State-Storage/project-1-eastus2-vmss/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /24-Terraform-Remote-State-Storage/project-1-eastus2-vmss/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "web_vmss_nsg_inbound_ports" { 3 | description = "Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /24-Terraform-Remote-State-Storage/project-1-eastus2-vmss/c7-04-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "web_vmss_id" { 4 | description = "Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.web_vmss.id 6 | } -------------------------------------------------------------------------------- /24-Terraform-Remote-State-Storage/project-1-eastus2-vmss/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | /* 3 | variable "bastion_service_subnet_name" { 4 | description = "Bastion Service Subnet Name" 5 | default = "AzureBastionSubnet" 6 | } 7 | 8 | variable "bastion_service_address_prefixes" { 9 | description = "Bastion Service Address Prefixes" 10 | default = ["10.0.101.0/27"] 11 | } 12 | */ -------------------------------------------------------------------------------- /24-Terraform-Remote-State-Storage/project-1-eastus2-vmss/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | /* 2 | ## Bastion Host Public IP Output 3 | output "bastion_host_linuxvm_public_ip_address" { 4 | description = "Bastion Host Linux VM Public Address" 5 | value = azurerm_public_ip.bastion_host_publicip.ip_address 6 | } 7 | */ 8 | -------------------------------------------------------------------------------- /24-Terraform-Remote-State-Storage/project-1-eastus2-vmss/c9-01-web-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Placeholder file for Load Balancer Input Variables -------------------------------------------------------------------------------- /24-Terraform-Remote-State-Storage/project-1-eastus2-vmss/c9-03-web-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Public IP 2 | output "web_lb_public_ip_address" { 3 | description = "Web Load Balancer Public Address" 4 | value = azurerm_public_ip.web_lbpublicip.ip_address 5 | } 6 | 7 | # LB Public IP ID 8 | output "web_lb_public_ip_address_id" { 9 | description = "Web Load Balancer Public Address Resource ID" 10 | value = azurerm_public_ip.web_lbpublicip.id 11 | } 12 | 13 | # Load Balancer ID 14 | output "web_lb_id" { 15 | description = "Web Load Balancer ID." 16 | value = azurerm_lb.web_lb.id 17 | } 18 | 19 | # Load Balancer Frontend IP Configuration Block 20 | output "web_lb_frontend_ip_configuration" { 21 | description = "Web LB frontend_ip_configuration Block" 22 | value = [azurerm_lb.web_lb.frontend_ip_configuration] 23 | } -------------------------------------------------------------------------------- /24-Terraform-Remote-State-Storage/project-1-eastus2-vmss/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /24-Terraform-Remote-State-Storage/project-1-eastus2-vmss/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "eastus2" 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | 20 | #bastion_service_subnet_name = "AzureBastionSubnet" 21 | #bastion_service_address_prefixes = ["10.1.101.0/27"] 22 | 23 | web_vmss_nsg_inbound_ports = [22, 80, 443] -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-1-eastus2-vmss/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | #resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | resource_name_prefix = "${var.resource_group_location}-${var.business_divsion}-${var.environment}" 7 | common_tags = { 8 | owners = local.owners 9 | environment = local.environment 10 | Tag = "demo-tag1" # Uncomment during step-08 11 | } 12 | } -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-1-eastus2-vmss/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-1-eastus2-vmss/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-1-eastus2-vmss/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-1-eastus2-vmss/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "web_vmss_nsg_inbound_ports" { 3 | description = "Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-1-eastus2-vmss/c7-04-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "web_vmss_id" { 4 | description = "Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.web_vmss.id 6 | } -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-1-eastus2-vmss/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | /* 3 | variable "bastion_service_subnet_name" { 4 | description = "Bastion Service Subnet Name" 5 | default = "AzureBastionSubnet" 6 | } 7 | 8 | variable "bastion_service_address_prefixes" { 9 | description = "Bastion Service Address Prefixes" 10 | default = ["10.0.101.0/27"] 11 | } 12 | */ -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-1-eastus2-vmss/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | /* 2 | ## Bastion Host Public IP Output 3 | output "bastion_host_linuxvm_public_ip_address" { 4 | description = "Bastion Host Linux VM Public Address" 5 | value = azurerm_public_ip.bastion_host_publicip.ip_address 6 | } 7 | */ 8 | -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-1-eastus2-vmss/c9-01-web-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Placeholder file for Load Balancer Input Variables -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-1-eastus2-vmss/c9-03-web-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Public IP 2 | output "web_lb_public_ip_address" { 3 | description = "Web Load Balancer Public Address" 4 | value = azurerm_public_ip.web_lbpublicip.ip_address 5 | } 6 | 7 | # LB Public IP ID 8 | output "web_lb_public_ip_address_id" { 9 | description = "Web Load Balancer Public Address Resource ID" 10 | value = azurerm_public_ip.web_lbpublicip.id 11 | } 12 | 13 | # Load Balancer ID 14 | output "web_lb_id" { 15 | description = "Web Load Balancer ID." 16 | value = azurerm_lb.web_lb.id 17 | } 18 | 19 | # Load Balancer Frontend IP Configuration Block 20 | output "web_lb_frontend_ip_configuration" { 21 | description = "Web LB frontend_ip_configuration Block" 22 | value = [azurerm_lb.web_lb.frontend_ip_configuration] 23 | } -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-1-eastus2-vmss/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-1-eastus2-vmss/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "eastus2" 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | 20 | #bastion_service_subnet_name = "AzureBastionSubnet" 21 | #bastion_service_address_prefixes = ["10.1.101.0/27"] 22 | 23 | web_vmss_nsg_inbound_ports = [22, 80, 443] -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-2-westus2-vmss/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | #resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | resource_name_prefix = "${var.resource_group_location}-${var.business_divsion}-${var.environment}" 7 | common_tags = { 8 | owners = local.owners 9 | environment = local.environment 10 | Tag = "demo-tag1" # Uncomment during step-08 11 | } 12 | } -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-2-westus2-vmss/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-2-westus2-vmss/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-2-westus2-vmss/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-2-westus2-vmss/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "web_vmss_nsg_inbound_ports" { 3 | description = "Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-2-westus2-vmss/c7-04-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "web_vmss_id" { 4 | description = "Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.web_vmss.id 6 | } -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-2-westus2-vmss/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | /* 3 | variable "bastion_service_subnet_name" { 4 | description = "Bastion Service Subnet Name" 5 | default = "AzureBastionSubnet" 6 | } 7 | 8 | variable "bastion_service_address_prefixes" { 9 | description = "Bastion Service Address Prefixes" 10 | default = ["10.0.101.0/27"] 11 | } 12 | */ -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-2-westus2-vmss/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | /* 2 | ## Bastion Host Public IP Output 3 | output "bastion_host_linuxvm_public_ip_address" { 4 | description = "Bastion Host Linux VM Public Address" 5 | value = azurerm_public_ip.bastion_host_publicip.ip_address 6 | } 7 | */ 8 | -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-2-westus2-vmss/c9-01-web-loadbalancer-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Placeholder file for Load Balancer Input Variables -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-2-westus2-vmss/c9-03-web-loadbalancer-outputs.tf: -------------------------------------------------------------------------------- 1 | # LB Public IP 2 | output "web_lb_public_ip_address" { 3 | description = "Web Load Balancer Public Address" 4 | value = azurerm_public_ip.web_lbpublicip.ip_address 5 | } 6 | 7 | # LB Public IP ID 8 | output "web_lb_public_ip_address_id" { 9 | description = "Web Load Balancer Public Address Resource ID" 10 | value = azurerm_public_ip.web_lbpublicip.id 11 | } 12 | 13 | # Load Balancer ID 14 | output "web_lb_id" { 15 | description = "Web Load Balancer ID." 16 | value = azurerm_lb.web_lb.id 17 | } 18 | 19 | # Load Balancer Frontend IP Configuration Block 20 | output "web_lb_frontend_ip_configuration" { 21 | description = "Web LB frontend_ip_configuration Block" 22 | value = [azurerm_lb.web_lb.frontend_ip_configuration] 23 | } -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-2-westus2-vmss/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-2-westus2-vmss/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "westus2" 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | 20 | #bastion_service_subnet_name = "AzureBastionSubnet" 21 | #bastion_service_address_prefixes = ["10.1.101.0/27"] 22 | 23 | web_vmss_nsg_inbound_ports = [22, 80, 443] -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-3-azure-traffic-manager/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | #resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | resource_name_prefix = "${var.resource_group_location}-${var.business_divsion}-${var.environment}" 7 | common_tags = { 8 | owners = local.owners 9 | environment = local.environment 10 | } 11 | } -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-3-azure-traffic-manager/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-3-azure-traffic-manager/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "tm-${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-3-azure-traffic-manager/c7-traffic-manager-outputs.tf: -------------------------------------------------------------------------------- 1 | # Traffic Manager FQDN Output 2 | output "traffic_manager_fqdn" { 3 | description = "Traffic Manager FQDN" 4 | value = azurerm_traffic_manager_profile.tm_profile.fqdn 5 | } -------------------------------------------------------------------------------- /25-Azure-Traffic-Manager/project-3-azure-traffic-manager/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "eastus2" 5 | -------------------------------------------------------------------------------- /26-Azure-Application-Gateway-using-Portal/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /26-Azure-Application-Gateway-using-Portal/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | common_tags = { 7 | owners = local.owners 8 | environment = local.environment 9 | } 10 | } -------------------------------------------------------------------------------- /26-Azure-Application-Gateway-using-Portal/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /26-Azure-Application-Gateway-using-Portal/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /26-Azure-Application-Gateway-using-Portal/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /26-Azure-Application-Gateway-using-Portal/terraform-manifests/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "web_vmss_nsg_inbound_ports" { 3 | description = "Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /26-Azure-Application-Gateway-using-Portal/terraform-manifests/c7-04-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "web_vmss_id" { 4 | description = "Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.web_vmss.id 6 | } -------------------------------------------------------------------------------- /26-Azure-Application-Gateway-using-Portal/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | /* 4 | variable "bastion_service_subnet_name" { 5 | description = "Bastion Service Subnet Name" 6 | default = "AzureBastionSubnet" 7 | } 8 | 9 | variable "bastion_service_address_prefixes" { 10 | description = "Bastion Service Address Prefixes" 11 | default = ["10.0.101.0/27"] 12 | } 13 | */ -------------------------------------------------------------------------------- /26-Azure-Application-Gateway-using-Portal/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | /* 2 | ## Bastion Host Public IP Output 3 | output "bastion_host_linuxvm_public_ip_address" { 4 | description = "Bastion Host Linux VM Public Address" 5 | value = azurerm_public_ip.bastion_host_publicip.ip_address 6 | } 7 | */ 8 | 9 | -------------------------------------------------------------------------------- /26-Azure-Application-Gateway-using-Portal/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /26-Azure-Application-Gateway-using-Portal/terraform-manifests/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "eastus" 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | 20 | #bastion_service_subnet_name = "AzureBastionSubnet" 21 | #bastion_service_address_prefixes = ["10.1.101.0/27"] 22 | 23 | web_vmss_nsg_inbound_ports = [22, 80, 443] 24 | 25 | ag_subnet_name = "agsubnet" 26 | ag_subnet_address = ["10.1.51.0/24"] 27 | -------------------------------------------------------------------------------- /27-Azure-Application-Gateway-Basics/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /27-Azure-Application-Gateway-Basics/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | common_tags = { 7 | owners = local.owners 8 | environment = local.environment 9 | } 10 | } -------------------------------------------------------------------------------- /27-Azure-Application-Gateway-Basics/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /27-Azure-Application-Gateway-Basics/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /27-Azure-Application-Gateway-Basics/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /27-Azure-Application-Gateway-Basics/terraform-manifests/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "web_vmss_nsg_inbound_ports" { 3 | description = "Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /27-Azure-Application-Gateway-Basics/terraform-manifests/c7-04-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "web_vmss_id" { 4 | description = "Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.web_vmss.id 6 | } -------------------------------------------------------------------------------- /27-Azure-Application-Gateway-Basics/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | /* 4 | variable "bastion_service_subnet_name" { 5 | description = "Bastion Service Subnet Name" 6 | default = "AzureBastionSubnet" 7 | } 8 | 9 | variable "bastion_service_address_prefixes" { 10 | description = "Bastion Service Address Prefixes" 11 | default = ["10.0.101.0/27"] 12 | } 13 | */ -------------------------------------------------------------------------------- /27-Azure-Application-Gateway-Basics/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | /* 2 | ## Bastion Host Public IP Output 3 | output "bastion_host_linuxvm_public_ip_address" { 4 | description = "Bastion Host Linux VM Public Address" 5 | value = azurerm_public_ip.bastion_host_publicip.ip_address 6 | } 7 | */ 8 | 9 | -------------------------------------------------------------------------------- /27-Azure-Application-Gateway-Basics/terraform-manifests/c9-01-application-gateway-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables Placeholder file. 2 | 3 | -------------------------------------------------------------------------------- /27-Azure-Application-Gateway-Basics/terraform-manifests/c9-03-application-gateway-outputs.tf: -------------------------------------------------------------------------------- 1 | # Application Gateway Outputs 2 | output "web_ag_id" { 3 | description = "Azure Application Gateway ID" 4 | value = azurerm_application_gateway.web_ag.id 5 | } 6 | 7 | output "web_ag_public_ip_1" { 8 | description = "Azure Application Gateway Public IP 1" 9 | value = azurerm_public_ip.web_ag_publicip.ip_address 10 | } -------------------------------------------------------------------------------- /27-Azure-Application-Gateway-Basics/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /27-Azure-Application-Gateway-Basics/terraform-manifests/terraform.tfvars: -------------------------------------------------------------------------------- 1 | business_divsion = "hr" 2 | environment = "dev" 3 | resource_group_name = "rg" 4 | resource_group_location = "eastus" 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | 20 | #bastion_service_subnet_name = "AzureBastionSubnet" 21 | #bastion_service_address_prefixes = ["10.1.101.0/27"] 22 | 23 | web_vmss_nsg_inbound_ports = [22, 80, 443] 24 | 25 | ag_subnet_name = "agsubnet" 26 | ag_subnet_address = ["10.1.51.0/24"] 27 | -------------------------------------------------------------------------------- /28-Azure-Application-Gateway-Path-Based-Routing/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /28-Azure-Application-Gateway-Path-Based-Routing/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | common_tags = { 7 | owners = local.owners 8 | environment = local.environment 9 | } 10 | } -------------------------------------------------------------------------------- /28-Azure-Application-Gateway-Path-Based-Routing/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /28-Azure-Application-Gateway-Path-Based-Routing/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /28-Azure-Application-Gateway-Path-Based-Routing/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /28-Azure-Application-Gateway-Path-Based-Routing/terraform-manifests/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "app1_web_vmss_nsg_inbound_ports" { 3 | description = "App1 Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | variable "app2_web_vmss_nsg_inbound_ports" { 9 | description = "App2 Web VMSS NSG Inbound Ports" 10 | type = list(string) 11 | default = [22, 80, 443] 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /28-Azure-Application-Gateway-Path-Based-Routing/terraform-manifests/c7-08-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "app1_web_vmss_id" { 4 | description = "App1 Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.app1_web_vmss.id 6 | } 7 | 8 | output "app2_web_vmss_id" { 9 | description = "App2 Web Virtual Machine Scale Set ID" 10 | value = azurerm_linux_virtual_machine_scale_set.app2_web_vmss.id 11 | } -------------------------------------------------------------------------------- /28-Azure-Application-Gateway-Path-Based-Routing/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | /* 4 | variable "bastion_service_subnet_name" { 5 | description = "Bastion Service Subnet Name" 6 | default = "AzureBastionSubnet" 7 | } 8 | 9 | variable "bastion_service_address_prefixes" { 10 | description = "Bastion Service Address Prefixes" 11 | default = ["10.0.101.0/27"] 12 | } 13 | */ -------------------------------------------------------------------------------- /28-Azure-Application-Gateway-Path-Based-Routing/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | /* 2 | ## Bastion Host Public IP Output 3 | output "bastion_host_linuxvm_public_ip_address" { 4 | description = "Bastion Host Linux VM Public Address" 5 | value = azurerm_public_ip.bastion_host_publicip.ip_address 6 | } 7 | */ 8 | 9 | -------------------------------------------------------------------------------- /28-Azure-Application-Gateway-Path-Based-Routing/terraform-manifests/c9-01-application-gateway-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables Placeholder file. 2 | 3 | -------------------------------------------------------------------------------- /28-Azure-Application-Gateway-Path-Based-Routing/terraform-manifests/c9-03-application-gateway-outputs.tf: -------------------------------------------------------------------------------- 1 | # Application Gateway Outputs 2 | output "web_ag_id" { 3 | description = "Azure Application Gateway ID" 4 | value = azurerm_application_gateway.web_ag.id 5 | } 6 | 7 | output "web_ag_public_ip_1" { 8 | description = "Azure Application Gateway Public IP 1" 9 | value = azurerm_public_ip.web_ag_publicip.ip_address 10 | } -------------------------------------------------------------------------------- /28-Azure-Application-Gateway-Path-Based-Routing/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /29-Azure-Application-Gateway-Multisite-Hosting/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /29-Azure-Application-Gateway-Multisite-Hosting/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | common_tags = { 7 | owners = local.owners 8 | environment = local.environment 9 | } 10 | } -------------------------------------------------------------------------------- /29-Azure-Application-Gateway-Multisite-Hosting/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /29-Azure-Application-Gateway-Multisite-Hosting/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /29-Azure-Application-Gateway-Multisite-Hosting/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /29-Azure-Application-Gateway-Multisite-Hosting/terraform-manifests/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "app1_web_vmss_nsg_inbound_ports" { 3 | description = "App1 Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | variable "app2_web_vmss_nsg_inbound_ports" { 9 | description = "App2 Web VMSS NSG Inbound Ports" 10 | type = list(string) 11 | default = [22, 80, 443] 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /29-Azure-Application-Gateway-Multisite-Hosting/terraform-manifests/c7-08-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "app1_web_vmss_id" { 4 | description = "App1 Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.app1_web_vmss.id 6 | } 7 | 8 | output "app2_web_vmss_id" { 9 | description = "App2 Web Virtual Machine Scale Set ID" 10 | value = azurerm_linux_virtual_machine_scale_set.app2_web_vmss.id 11 | } -------------------------------------------------------------------------------- /29-Azure-Application-Gateway-Multisite-Hosting/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | /* 4 | variable "bastion_service_subnet_name" { 5 | description = "Bastion Service Subnet Name" 6 | default = "AzureBastionSubnet" 7 | } 8 | 9 | variable "bastion_service_address_prefixes" { 10 | description = "Bastion Service Address Prefixes" 11 | default = ["10.0.101.0/27"] 12 | } 13 | */ -------------------------------------------------------------------------------- /29-Azure-Application-Gateway-Multisite-Hosting/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | /* 2 | ## Bastion Host Public IP Output 3 | output "bastion_host_linuxvm_public_ip_address" { 4 | description = "Bastion Host Linux VM Public Address" 5 | value = azurerm_public_ip.bastion_host_publicip.ip_address 6 | } 7 | */ 8 | 9 | -------------------------------------------------------------------------------- /29-Azure-Application-Gateway-Multisite-Hosting/terraform-manifests/c9-01-application-gateway-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables Placeholder file. 2 | 3 | -------------------------------------------------------------------------------- /29-Azure-Application-Gateway-Multisite-Hosting/terraform-manifests/c9-03-application-gateway-outputs.tf: -------------------------------------------------------------------------------- 1 | # Application Gateway Outputs 2 | output "web_ag_id" { 3 | description = "Azure Application Gateway ID" 4 | value = azurerm_application_gateway.web_ag.id 5 | } 6 | 7 | output "web_ag_public_ip_1" { 8 | description = "Azure Application Gateway Public IP 1" 9 | value = azurerm_public_ip.web_ag_publicip.ip_address 10 | } -------------------------------------------------------------------------------- /29-Azure-Application-Gateway-Multisite-Hosting/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/c10-03-storage-account-outputs.tf: -------------------------------------------------------------------------------- 1 | # Storage Account Outputs 2 | output "storage_account_primary_access_key" { 3 | value = azurerm_storage_account.storage_account.primary_access_key 4 | sensitive = true 5 | } 6 | output "storage_account_primary_web_endpoint" { 7 | value = azurerm_storage_account.storage_account.primary_web_endpoint 8 | } 9 | output "storage_account_primary_web_host" { 10 | value = azurerm_storage_account.storage_account.primary_web_host 11 | } 12 | output "storage_account_name" { 13 | value = azurerm_storage_account.storage_account.name 14 | } 15 | -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | common_tags = { 7 | owners = local.owners 8 | environment = local.environment 9 | } 10 | } -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "web_vmss_nsg_inbound_ports" { 3 | description = "Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/c7-04-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "web_vmss_id" { 4 | description = "Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.web_vmss.id 6 | } -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | /* 4 | variable "bastion_service_subnet_name" { 5 | description = "Bastion Service Subnet Name" 6 | default = "AzureBastionSubnet" 7 | } 8 | 9 | variable "bastion_service_address_prefixes" { 10 | description = "Bastion Service Address Prefixes" 11 | default = ["10.0.101.0/27"] 12 | } 13 | */ -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | /* 2 | ## Bastion Host Public IP Output 3 | output "bastion_host_linuxvm_public_ip_address" { 4 | description = "Bastion Host Linux VM Public Address" 5 | value = azurerm_public_ip.bastion_host_publicip.ip_address 6 | } 7 | */ 8 | 9 | -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/c9-01-application-gateway-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables Placeholder file. 2 | 3 | -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/c9-03-application-gateway-outputs.tf: -------------------------------------------------------------------------------- 1 | # Application Gateway Outputs 2 | output "web_ag_id" { 3 | description = "Azure Application Gateway ID" 4 | value = azurerm_application_gateway.web_ag.id 5 | } 6 | 7 | output "web_ag_public_ip_1" { 8 | description = "Azure Application Gateway Public IP 1" 9 | value = azurerm_public_ip.web_ag_publicip.ip_address 10 | } -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/custom-error-pages/403.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify

5 |

User don't have access

6 |

HTTP 403 Error Page

7 |

Application Version: V1

8 | 9 | -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/custom-error-pages/502.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify

5 |

Backend Application is down

6 |

HTTP 502 Error Page

7 |

Application Version: V1

8 | 9 | -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/custom-error-pages/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify

5 |

Used for Application Gateway Error Pages

6 |

Static Website Error Page

7 |

Application Version: V1

8 | 9 | -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/custom-error-pages/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify

5 |

Used for Application Gateway Error Pages

6 |

Static Website Index Page

7 |

Application Version: V1

8 | 9 | -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/ssl-self-signed/httpd.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stacksimplify/terraform-on-azure-cloud/0674111699a3ac47a060d58e60b0648b0bf67e4c/30-Azure-Application-Gateway-SSL-SelfSigned/terraform-manifests/ssl-self-signed/httpd.pfx -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/c10-03-storage-account-outputs.tf: -------------------------------------------------------------------------------- 1 | # Storage Account Outputs 2 | output "storage_account_primary_access_key" { 3 | value = azurerm_storage_account.storage_account.primary_access_key 4 | sensitive = true 5 | } 6 | output "storage_account_primary_web_endpoint" { 7 | value = azurerm_storage_account.storage_account.primary_web_endpoint 8 | } 9 | output "storage_account_primary_web_host" { 10 | value = azurerm_storage_account.storage_account.primary_web_host 11 | } 12 | output "storage_account_name" { 13 | value = azurerm_storage_account.storage_account.name 14 | } 15 | -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/c11-01-azure-key-vault-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables Placeholder file -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/c11-03-azure-key-vault-outputs.tf: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Output Values 4 | output "azurerm_key_vault_certificate_id" { 5 | value = azurerm_key_vault_certificate.my_cert_1.id 6 | } 7 | 8 | output "azurerm_key_vault_certificate_secret_id" { 9 | value = azurerm_key_vault_certificate.my_cert_1.secret_id 10 | } 11 | output "azurerm_key_vault_certificate_version" { 12 | value = azurerm_key_vault_certificate.my_cert_1.version 13 | } 14 | -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | common_tags = { 7 | owners = local.owners 8 | environment = local.environment 9 | } 10 | } -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "web_vmss_nsg_inbound_ports" { 3 | description = "Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/c7-04-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "web_vmss_id" { 4 | description = "Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.web_vmss.id 6 | } -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | /* 4 | variable "bastion_service_subnet_name" { 5 | description = "Bastion Service Subnet Name" 6 | default = "AzureBastionSubnet" 7 | } 8 | 9 | variable "bastion_service_address_prefixes" { 10 | description = "Bastion Service Address Prefixes" 11 | default = ["10.0.101.0/27"] 12 | } 13 | */ -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | /* 2 | ## Bastion Host Public IP Output 3 | output "bastion_host_linuxvm_public_ip_address" { 4 | description = "Bastion Host Linux VM Public Address" 5 | value = azurerm_public_ip.bastion_host_publicip.ip_address 6 | } 7 | */ 8 | 9 | -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/c9-01-application-gateway-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables Placeholder file. 2 | 3 | -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/c9-03-application-gateway-outputs.tf: -------------------------------------------------------------------------------- 1 | # Application Gateway Outputs 2 | output "web_ag_id" { 3 | description = "Azure Application Gateway ID" 4 | value = azurerm_application_gateway.web_ag.id 5 | } 6 | 7 | output "web_ag_public_ip_1" { 8 | description = "Azure Application Gateway Public IP 1" 9 | value = azurerm_public_ip.web_ag_publicip.ip_address 10 | } -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/custom-error-pages/403.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify

5 |

User don't have access

6 |

HTTP 403 Error Page

7 |

Application Version: V1

8 | 9 | -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/custom-error-pages/502.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify

5 |

Backend Application is down

6 |

HTTP 502 Error Page

7 |

Application Version: V1

8 | 9 | -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/custom-error-pages/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify

5 |

Used for Application Gateway Error Pages

6 |

Static Website Error Page

7 |

Application Version: V1

8 | 9 | -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/custom-error-pages/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify

5 |

Used for Application Gateway Error Pages

6 |

Static Website Index Page

7 |

Application Version: V1

8 | 9 | -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/ssl-self-signed/httpd.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stacksimplify/terraform-on-azure-cloud/0674111699a3ac47a060d58e60b0648b0bf67e4c/31-Azure-Application-Gateway-SSL-SelfSigned-KeyVault/terraform-manifests/ssl-self-signed/httpd.pfx -------------------------------------------------------------------------------- /32-Azure-IaC-DevOps/Git-Repo-Files/README.md: -------------------------------------------------------------------------------- 1 | # Terraform on Azure with Azure IaC DevOps for Terraform Project 2 | 3 | 1. Implement IaC usecases with Terraform on Azure cloud using Azure DevOps 4 | 2. Implement Azure Build Pipelines (Continuous Integration Pipelines) 5 | 3. Implement Azure Release Pipelines (Continuous Delivery Pipelines) 6 | 4. [Github SSH Connection](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/about-ssh) 7 | -------------------------------------------------------------------------------- /32-Azure-IaC-DevOps/Git-Repo-Files/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | # Terraform State Storage to Azure Storage Container (Values will be taken from Azure DevOps) 19 | backend "azurerm" { 20 | 21 | } 22 | } 23 | 24 | # Provider Block 25 | provider "azurerm" { 26 | features {} 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /32-Azure-IaC-DevOps/Git-Repo-Files/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | #name = "${local.owners}-${local.environment}" 7 | common_tags = { 8 | owners = local.owners 9 | environment = local.environment 10 | } 11 | } -------------------------------------------------------------------------------- /32-Azure-IaC-DevOps/Git-Repo-Files/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /32-Azure-IaC-DevOps/Git-Repo-Files/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /32-Azure-IaC-DevOps/Git-Repo-Files/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /32-Azure-IaC-DevOps/Git-Repo-Files/terraform-manifests/c7-01-web-linuxvm-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "web_linuxvm_size" { 3 | description = "Web Linux VM Size" 4 | type = string 5 | default = "Standard_DS1_v2" 6 | } 7 | 8 | variable "web_linuxvm_admin_user" { 9 | description = "Web Linux VM Admin Username" 10 | type = string 11 | default = "azureuser" 12 | } -------------------------------------------------------------------------------- /32-Azure-IaC-DevOps/Git-Repo-Files/terraform-manifests/c7-02-web-linuxvm-publicip.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Create Public IP Address 2 | resource "azurerm_public_ip" "web_linuxvm_publicip" { 3 | name = "${local.resource_name_prefix}-web-linuxvm-publicip" 4 | resource_group_name = azurerm_resource_group.rg.name 5 | location = azurerm_resource_group.rg.location 6 | allocation_method = "Static" 7 | sku = "Standard" 8 | domain_name_label = "app1-vm-${random_string.myrandom.id}" 9 | } 10 | 11 | -------------------------------------------------------------------------------- /32-Azure-IaC-DevOps/Git-Repo-Files/terraform-manifests/c7-03-web-linuxvm-network-interface.tf: -------------------------------------------------------------------------------- 1 | # Resource-2: Create Network Interface 2 | resource "azurerm_network_interface" "web_linuxvm_nic" { 3 | name = "${local.resource_name_prefix}-web-linuxvm-nic" 4 | location = azurerm_resource_group.rg.location 5 | resource_group_name = azurerm_resource_group.rg.name 6 | 7 | ip_configuration { 8 | name = "web-linuxvm-ip-1" 9 | subnet_id = azurerm_subnet.websubnet.id 10 | private_ip_address_allocation = "Dynamic" 11 | public_ip_address_id = azurerm_public_ip.web_linuxvm_publicip.id 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /32-Azure-IaC-DevOps/Git-Repo-Files/terraform-manifests/dev.tfvars: -------------------------------------------------------------------------------- 1 | # Environment Name 2 | environment = "dev" 3 | 4 | # Virtual Network Variables 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.1.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.1.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.1.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.1.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.1.100.0/24"] 19 | 20 | # Web Linux VM Variables 21 | web_linuxvm_size = "Standard_DS1_v2" 22 | web_linuxvm_admin_user = "azureuser" -------------------------------------------------------------------------------- /32-Azure-IaC-DevOps/Git-Repo-Files/terraform-manifests/prod.tfvars: -------------------------------------------------------------------------------- 1 | # Environment Name 2 | environment = "prod" 3 | 4 | # Virtual Network Variables 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.4.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.4.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.4.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.4.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.4.100.0/24"] 19 | 20 | # Web Linux VM Variables 21 | web_linuxvm_size = "Standard_DS1_v2" 22 | web_linuxvm_admin_user = "azureuser" 23 | #web_linuxvm_admin_user = "produser" # Enable during step-21 24 | -------------------------------------------------------------------------------- /32-Azure-IaC-DevOps/Git-Repo-Files/terraform-manifests/qa.tfvars: -------------------------------------------------------------------------------- 1 | # Environment Name 2 | environment = "qa" 3 | 4 | # Virtual Network Variables 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.2.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.2.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.2.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.2.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.2.100.0/24"] 19 | 20 | # Web Linux VM Variables 21 | web_linuxvm_size = "Standard_DS1_v2" 22 | web_linuxvm_admin_user = "azureuser" -------------------------------------------------------------------------------- /32-Azure-IaC-DevOps/Git-Repo-Files/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /32-Azure-IaC-DevOps/Git-Repo-Files/terraform-manifests/stage.tfvars: -------------------------------------------------------------------------------- 1 | # Environment Name 2 | environment = "stage" 3 | 4 | # Virtual Network Variables 5 | vnet_name = "vnet" 6 | vnet_address_space = ["10.3.0.0/16"] 7 | 8 | web_subnet_name = "websubnet" 9 | web_subnet_address = ["10.3.1.0/24"] 10 | 11 | app_subnet_name = "appsubnet" 12 | app_subnet_address = ["10.3.11.0/24"] 13 | 14 | db_subnet_name = "dbsubnet" 15 | db_subnet_address = ["10.3.21.0/24"] 16 | 17 | bastion_subnet_name = "bastionsubnet" 18 | bastion_subnet_address = ["10.3.100.0/24"] 19 | 20 | # Web Linux VM Variables 21 | web_linuxvm_size = "Standard_DS1_v2" 22 | web_linuxvm_admin_user = "azureuser" -------------------------------------------------------------------------------- /32-Azure-IaC-DevOps/Git-Repo-Files/terraform-manifests/terraform.tfvars: -------------------------------------------------------------------------------- 1 | # Generic Variables 2 | business_divsion = "hr" 3 | resource_group_location = "eastus" 4 | resource_group_name = "rg" 5 | -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | null = { 14 | source = "hashicorp/null" 15 | version = ">= 3.0" 16 | } 17 | } 18 | } 19 | 20 | # Provider Block 21 | provider "azurerm" { 22 | features {} 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/c10-03-storage-account-outputs.tf: -------------------------------------------------------------------------------- 1 | # Storage Account Outputs 2 | output "storage_account_primary_access_key" { 3 | value = azurerm_storage_account.storage_account.primary_access_key 4 | sensitive = true 5 | } 6 | output "storage_account_primary_web_endpoint" { 7 | value = azurerm_storage_account.storage_account.primary_web_endpoint 8 | } 9 | output "storage_account_primary_web_host" { 10 | value = azurerm_storage_account.storage_account.primary_web_host 11 | } 12 | output "storage_account_name" { 13 | value = azurerm_storage_account.storage_account.name 14 | } 15 | -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/c11-01-mysql-servers-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables 2 | # DB Name 3 | variable "mysql_db_name" { 4 | description = "Azure MySQL Database Name" 5 | type = string 6 | } 7 | 8 | # DB Username - Enable Sensitive flag 9 | variable "mysql_db_username" { 10 | description = "Azure MySQL Database Administrator Username" 11 | type = string 12 | } 13 | # DB Password - Enable Sensitive flag 14 | variable "mysql_db_password" { 15 | description = "Azure MySQL Database Administrator Password" 16 | type = string 17 | sensitive = true 18 | } 19 | 20 | # DB Schema Name 21 | variable "mysql_db_schema" { 22 | description = "Azure MySQL Database Schema Name" 23 | type = string 24 | } -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/c11-03-mysql-servers-output-values.tf: -------------------------------------------------------------------------------- 1 | # Output Values 2 | output "mysql_server_fqdn" { 3 | description = "MySQL Server FQDN" 4 | value = azurerm_mysql_server.mysql_server.fqdn 5 | } -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/c3-locals.tf: -------------------------------------------------------------------------------- 1 | # Define Local Values in Terraform 2 | locals { 3 | owners = var.business_divsion 4 | environment = var.environment 5 | resource_name_prefix = "${var.business_divsion}-${var.environment}" 6 | common_tags = { 7 | owners = local.owners 8 | environment = local.environment 9 | } 10 | } -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/c4-random-resources.tf: -------------------------------------------------------------------------------- 1 | # Random String Resource 2 | resource "random_string" "myrandom" { 3 | length = 6 4 | upper = false 5 | special = false 6 | number = false 7 | } 8 | -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/c5-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "rg" { 3 | # name = "${local.resource_name_prefix}-${var.resource_group_name}" 4 | name = "${local.resource_name_prefix}-${var.resource_group_name}-${random_string.myrandom.id}" 5 | location = var.resource_group_location 6 | tags = local.common_tags 7 | } 8 | -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/c6-02-virtual-network.tf: -------------------------------------------------------------------------------- 1 | # Create Virtual Network 2 | resource "azurerm_virtual_network" "vnet" { 3 | name = "${local.resource_name_prefix}-${var.vnet_name}" 4 | address_space = var.vnet_address_space 5 | location = azurerm_resource_group.rg.location 6 | resource_group_name = azurerm_resource_group.rg.name 7 | tags = local.common_tags 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/c7-01-web-linux-vmss-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Linux VM Input Variables Placeholder file. 2 | variable "web_vmss_nsg_inbound_ports" { 3 | description = "Web VMSS NSG Inbound Ports" 4 | type = list(string) 5 | default = [22, 80, 443, 8080] 6 | } 7 | 8 | -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/c7-04-web-linux-vmss-outputs.tf: -------------------------------------------------------------------------------- 1 | # VM Scale Set Outputs 2 | 3 | output "web_vmss_id" { 4 | description = "Web Virtual Machine Scale Set ID" 5 | value = azurerm_linux_virtual_machine_scale_set.web_vmss.id 6 | } -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/c8-01-bastion-host-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Bastion Linux VM Input Variables Placeholder file. 2 | 3 | /* 4 | variable "bastion_service_subnet_name" { 5 | description = "Bastion Service Subnet Name" 6 | default = "AzureBastionSubnet" 7 | } 8 | 9 | variable "bastion_service_address_prefixes" { 10 | description = "Bastion Service Address Prefixes" 11 | default = ["10.0.101.0/27"] 12 | } 13 | */ -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/c8-05-bastion-outputs.tf: -------------------------------------------------------------------------------- 1 | 2 | ## Bastion Host Public IP Output 3 | output "bastion_host_linuxvm_public_ip_address" { 4 | description = "Bastion Host Linux VM Public Address" 5 | value = azurerm_public_ip.bastion_host_publicip.ip_address 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/c9-01-application-gateway-input-variables.tf: -------------------------------------------------------------------------------- 1 | # Input Variables Placeholder file. 2 | 3 | -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/c9-03-application-gateway-outputs.tf: -------------------------------------------------------------------------------- 1 | # Application Gateway Outputs 2 | output "web_ag_id" { 3 | description = "Azure Application Gateway ID" 4 | value = azurerm_application_gateway.web_ag.id 5 | } 6 | 7 | output "web_ag_public_ip_1" { 8 | description = "Azure Application Gateway Public IP 1" 9 | value = azurerm_public_ip.web_ag_publicip.ip_address 10 | } -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/custom-error-pages/403.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify

5 |

User don't have access

6 |

HTTP 403 Error Page

7 |

Application Version: V1

8 | 9 | -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/custom-error-pages/502.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify

5 |

Backend Application is down

6 |

HTTP 502 Error Page

7 |

Application Version: V1

8 | 9 | -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/custom-error-pages/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify

5 |

Used for Application Gateway Error Pages

6 |

Static Website Error Page

7 |

Application Version: V1

8 | 9 | -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/custom-error-pages/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify

5 |

Used for Application Gateway Error Pages

6 |

Static Website Index Page

7 |

Application Version: V1

8 | 9 | -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/mysqldb.auto.tfvars: -------------------------------------------------------------------------------- 1 | # MySQL DB Name 2 | mysql_db_name = "mysql" 3 | mysql_db_username = "dbadmin" 4 | mysql_db_schema = "webappdb" 5 | 6 | -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/secrets.tfvars: -------------------------------------------------------------------------------- 1 | # Secret Variables (Should not be checked-in to Github) 2 | mysql_db_password = "H@Sh1CoR3!" -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxA6mEMrD7t6WV9VkWDiNLLtfJo9Fjiq9BQ0QSST1lfz6khwr7ALrjddDSVELMqtDsey7otyz+GvsXYN5Pw2/aR50ym5ft7Plz7f2YmTEzhSBa5nAnin1HnGFQwiYsYF25qdUsNDvkLrkWs8Nn2n7wGT8hmrRK+NROWNb4Jl7fqdiHdmd2xbWQNMIZ3D6rjFF2rVpmTHaK7w6P1ZwWRdjH+6rcFOdS1O76zctpoVPcZ3731FxHnsBwUEucAbVdT9oKefwCsgsF8IUeKMAdHexkpB6OO/7DU4sy22yByrHBsv+e2KBAFSRNwom4Fa+kpy3iMlMklysJDtAF9Ob6EqDXuKEyFdis8rbND1byN4H/kKw9nDsLqIW3KjoUf/hBHafLbElKSsq8kRZKTHPhzVIHKfOJhX2lsOW2s2X/RnNrb1cDTqZQanqNIk/umnJZR8hG87CbxOyni04xFp89OqbRl7Pnm7+efqGVYA5wLk7EnwHnj9uI+Yxz2HyBW7Y645pNt8WuwiEabcyHe+ht40Sx8XVAayCoaA6RhZjMGP4xykBf3i7Is9VlrwgjcrYbrwJo5aF/4x7pP+6SgNKnAi39JGL1kzEHVu5FJiHxJqd8/fYNlKz+I9/e+b1IZgQchelsUPG8SYtU7/6wi70xw4fvaEkwFYRDaF1SowqDBggnFw== azureuser@myserver 2 | -------------------------------------------------------------------------------- /33-Azure-MySQL-Single-Server/terraform-manifests/ssl-self-signed/httpd.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stacksimplify/terraform-on-azure-cloud/0674111699a3ac47a060d58e60b0648b0bf67e4c/33-Azure-MySQL-Single-Server/terraform-manifests/ssl-self-signed/httpd.pfx -------------------------------------------------------------------------------- /34-Terraform-Modules-use-Public-Module/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 0.15" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | } 14 | } 15 | 16 | # Provider Block 17 | provider "azurerm" { 18 | features {} 19 | } 20 | 21 | # Random String Resource 22 | resource "random_string" "myrandom" { 23 | length = 6 24 | upper = false 25 | special = false 26 | number = false 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /34-Terraform-Modules-use-Public-Module/terraform-manifests/c4-resource-group.tf: -------------------------------------------------------------------------------- 1 | # Resource-1: Azure Resource Group 2 | resource "azurerm_resource_group" "myrg" { 3 | name = local.rg_name 4 | location = var.resoure_group_location 5 | tags = local.common_tags 6 | } -------------------------------------------------------------------------------- /34-Terraform-Modules-use-Public-Module/terraform-manifests/ssh-keys/terraform-azure.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDBp1PP0AMY1Q55cB5ASHz2kFMdqevNU6TLc6Jw/igPQIhM+y8jtX3nlu+QW1YyQdkGblb22j1z1NvK4ym30dWdgZjEz2tCowgou7IHF3Kc/c1MEjsdQc1LpwCOKkQQJrrGwQ5ZqEd2F1I70365SRVHCK8BMq8HXxh9pmAXQ9pcL2paKBi1O9pzCCxuodP0FFjWvfRnT8rPf2V5dV8LqWiQDqKYivLC89kiXcLf5u/6WU4e25geqgWJpXiMXgTpkV9g7lZtcU9v/fG6VMi5DGQMGHICwsMYaeN/cDwJMy85awbeJdlRWPIP/Ox9Y1NB2qssiUS+fse/rbFiWMkTg5Yp6bvL3tk6M9kJ9DFu9sCfA5hAWpbLVQ8t6DvkxQQb6AeqZtJx5Zm2FMerFWb5me1fqKSzmk6KGOshZZy1y+ctcjlw9HwgxUtYUARklkN4YA4U47UBXZtH20e0BG6QnTBMxH1LgfbbCJvyX4ytPqG+ebTq9xiAij+/ZoX+ZpfMyphr6xiNzFvypqFcpNSdJTVaNU8XPtfpk7NH33ZBWryERriN0MADlRtVJm2TKJ4wZOy+1YF+Zu+yzbPOSAKMA5vKIv8uYW3arnOFFiDl27Fji4bSiBZTDLyXb95xkTixB0NXgbeUBBsPtUpvvGTU8nSpw8hj/7FEE6i94juFu7nP/Q== azureuser@myserver 2 | -------------------------------------------------------------------------------- /34-Terraform-Modules-use-Public-Module/terraform-manifests/terraform.tfvars: -------------------------------------------------------------------------------- 1 | # Generic Variables 2 | business_unit = "it" 3 | #environment = "dev" 4 | 5 | # Resource Variables 6 | resoure_group_name = "rg" 7 | resoure_group_location = "eastus" 8 | virtual_network_name = "vnet" 9 | subnet_name = "subnet" 10 | publicip_name = "publicip" 11 | network_interface_name = "nic" 12 | virtual_machine_name = "vm" 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /35-Terraform-Azure-Static-Website/static-content/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify - APP-1

5 |

Terraform Modules Demo

6 |

ERROR PAGE

7 | 8 | -------------------------------------------------------------------------------- /35-Terraform-Azure-Static-Website/static-content/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify - APP-1

5 |

Terraform Modules Demo

6 |

Application Version: V1

7 | 8 | -------------------------------------------------------------------------------- /35-Terraform-Azure-Static-Website/terraform-manifests/terraform.tfvars: -------------------------------------------------------------------------------- 1 | location = "eastus" 2 | resource_group_name = "myrg1" 3 | storage_account_name = "staticwebsite" 4 | storage_account_tier = "Standard" 5 | storage_account_replication_type = "LRS" 6 | storage_account_kind = "StorageV2" 7 | static_website_index_document = "index.html" 8 | static_website_error_404_document = "error.html" 9 | -------------------------------------------------------------------------------- /35-Terraform-Azure-Static-Website/terraform-manifests/versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /36-Terraform-Modules-Build-Local-Module/static-content/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify - APP-1

5 |

Terraform Modules Demo

6 |

ERROR PAGE

7 | 8 | -------------------------------------------------------------------------------- /36-Terraform-Modules-Build-Local-Module/static-content/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify - APP-1

5 |

Terraform Modules Demo

6 |

Application Version: V1

7 | 8 | -------------------------------------------------------------------------------- /36-Terraform-Modules-Build-Local-Module/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | } 10 | } 11 | 12 | # Provider Block 13 | provider "azurerm" { 14 | features {} 15 | } 16 | 17 | -------------------------------------------------------------------------------- /36-Terraform-Modules-Build-Local-Module/terraform-manifests/c2-variables.tf: -------------------------------------------------------------------------------- 1 | # Input variable definitions 2 | ## Place holder file 3 | 4 | -------------------------------------------------------------------------------- /36-Terraform-Modules-Build-Local-Module/terraform-manifests/c3-static-website.tf: -------------------------------------------------------------------------------- 1 | # Call our Custom Terraform Module which we built earlier 2 | module "azure_static_website" { 3 | source = "./modules/azure-static-website" # Mandatory 4 | 5 | # Resource Group 6 | location = "eastus" 7 | resource_group_name = "myrg1" 8 | 9 | # Storage Account 10 | storage_account_name = "staticwebsite" 11 | storage_account_tier = "Standard" 12 | storage_account_replication_type = "LRS" 13 | storage_account_kind = "StorageV2" 14 | static_website_index_document = "index.html" 15 | static_website_error_404_document = "error.html" 16 | } -------------------------------------------------------------------------------- /36-Terraform-Modules-Build-Local-Module/terraform-manifests/modules/azure-static-website/LICENSE: -------------------------------------------------------------------------------- 1 | Licensed under the Apache License, Version 2.0 (the "License"); 2 | you may not use this file except in compliance with the License. 3 | You may obtain a copy of the License at 4 | 5 | http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. -------------------------------------------------------------------------------- /36-Terraform-Modules-Build-Local-Module/terraform-manifests/modules/azure-static-website/README.md: -------------------------------------------------------------------------------- 1 | # Azure Static Website using Storage Account 2 | - This module provisions Azure Storage Account for static website hosting. 3 | - This is just for Terraform Demo's 4 | 5 | 6 | -------------------------------------------------------------------------------- /36-Terraform-Modules-Build-Local-Module/terraform-manifests/modules/azure-static-website/versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /37-Terraform-Module-Publish-to-Public-Registry/static-content/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify - APP-1

5 |

Terraform Modules Demo

6 |

ERROR PAGE

7 | 8 | -------------------------------------------------------------------------------- /37-Terraform-Module-Publish-to-Public-Registry/static-content/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to Stack Simplify - APP-1

5 |

Terraform Modules Demo

6 |

Application Version: V1

7 | 8 | -------------------------------------------------------------------------------- /37-Terraform-Module-Publish-to-Public-Registry/terraform-azure-static-website-module-manifests/LICENSE: -------------------------------------------------------------------------------- 1 | Licensed under the Apache License, Version 2.0 (the "License"); 2 | you may not use this file except in compliance with the License. 3 | You may obtain a copy of the License at 4 | 5 | http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. -------------------------------------------------------------------------------- /37-Terraform-Module-Publish-to-Public-Registry/terraform-azure-static-website-module-manifests/README.md: -------------------------------------------------------------------------------- 1 | # Azure Static Website using Storage Account 2 | - This module provisions Azure Storage Account for static website hosting. 3 | - This is just for Terraform Demo's 4 | - Version: 1.0.0 5 | 6 | 7 | -------------------------------------------------------------------------------- /37-Terraform-Module-Publish-to-Public-Registry/terraform-azure-static-website-module-manifests/versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | random = { 10 | source = "hashicorp/random" 11 | version = ">= 3.0" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /37-Terraform-Module-Publish-to-Public-Registry/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | } 10 | } 11 | 12 | # Provider Block 13 | provider "azurerm" { 14 | features {} 15 | } 16 | 17 | -------------------------------------------------------------------------------- /37-Terraform-Module-Publish-to-Public-Registry/terraform-manifests/c2-variables.tf: -------------------------------------------------------------------------------- 1 | # Input variable definitions 2 | ## Place holder file -------------------------------------------------------------------------------- /37-Terraform-Module-Publish-to-Public-Registry/terraform-manifests/c3-static-website.tf: -------------------------------------------------------------------------------- 1 | # Call our Custom Terraform Module which we built earlier 2 | module "azure_static_website" { 3 | #source = "./modules/azure-static-website" 4 | source = "stacksimplify/staticwebsitepublic/azurerm" 5 | version = "1.0.0" 6 | 7 | # Resource Group 8 | location = "eastus" 9 | resource_group_name = "myrg1" 10 | 11 | # Storage Account 12 | storage_account_name = "staticwebsite" 13 | storage_account_tier = "Standard" 14 | storage_account_replication_type = "LRS" 15 | storage_account_kind = "StorageV2" 16 | static_website_index_document = "index.html" 17 | static_website_error_404_document = "error.html" 18 | } -------------------------------------------------------------------------------- /38-Terraform-Module-Sources/terraform-manifests/c1-versions.tf: -------------------------------------------------------------------------------- 1 | # Terraform Block 2 | terraform { 3 | required_version = ">= 1.0.0" 4 | required_providers { 5 | azurerm = { 6 | source = "hashicorp/azurerm" 7 | version = ">= 2.0" 8 | } 9 | } 10 | } 11 | 12 | # Provider Block 13 | provider "azurerm" { 14 | features {} 15 | } 16 | 17 | -------------------------------------------------------------------------------- /38-Terraform-Module-Sources/terraform-manifests/c2-variables.tf: -------------------------------------------------------------------------------- 1 | # Input variable definitions 2 | ## Place holder file -------------------------------------------------------------------------------- /course-presentation/Terraform-on-Azure-Cloud-v9.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stacksimplify/terraform-on-azure-cloud/0674111699a3ac47a060d58e60b0648b0bf67e4c/course-presentation/Terraform-on-Azure-Cloud-v9.pptx -------------------------------------------------------------------------------- /git-deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Add files and do local commit" 4 | git add . 5 | git commit -am "Welcome to StackSimplify" 6 | 7 | echo "Pushing to Github Repository" 8 | git push 9 | --------------------------------------------------------------------------------