This project is a Terraform configuration for deploying a resilient and scalable 2-Tier Architecture in Azure.
Before you can use this project, you will need to have the following installed:
- Terraform
- Azure CLI
You will also need to have an Azure subscription and an Azure storage account for storing the Terraform state.
To get started with this project, follow these steps:
- Clone the repository to your local machine.
- Configure the
remote-state.shscript with the appropriate values for the already defined variables. - Run the
remote-state.shscript to create the storage account and container for storing the Terraform state. - Configure the
backend.tffile with the appropriate values for the Azure Storage account, Container and Resource Group used in the script previously. - Initialize Terraform by running
terraform init. - Create a
terraform.tfvarfile to define default values for the variables used in the terraform config.
# terraform.tfvars template
resource_group_name = "" // Name of the resource group to deploy the resources to
location = "" // Azure region to deploy the resources to
vnet_address_space = "" // CIDR Address space for the virtual network
app_gateway_subnet = "" // CIDR Address space for the application gateway subnet
jumpbox_subnet = "" // CIDR Address space for the jumpbox subnet
web_tier_subnet = "" // CIDR Address space for the web tier subnet
database_subnet = "" // CIDR Address space for the database subnet
vm_name = "" // Name of the Jumpbox virtual machine
vmss_name = "" // Name of the Web Tier virtual machine scale set
admin_username = "" // Username for the virtual machines
admin_password = "" // Password for the Database Server
app_gateway_name = "" // Name of the Application Gateway
kv_name = "" // Name of the Key Vault
cdn_profile_name = "" // Name of the CDN Profile
cdn_endpoint_name = "" // Name of the CDN Endpoint
database_name = "" // Name of the MySQL Database
private_dns_zone_name = "" // Name of the Private DNS Zone to create "example.mysql.database.azure.com"
private_dns_zone_link_name = "" // Name of the Private DNS Zone Link to create
- Review the resources that will be created by running
terraform plan. - Deploy the resources by running
terraform apply --auto-approve.
This project deploys the following resources:
azurerm_resource_groupazurerm_virtual_networkazurerm_subnetazurerm_network_security_groupazurerm_linux_virtual_machineazurerm_linux_virtual_machine_scale_setazurerm_application_gatewayazurerm_key_vaultazurerm_cdn_profileazurerm_cdn_endpoint
Note that the actual resources deployed by the project will be shown when you run terraform plan.
If you would like to contribute to this project, please fork the repository and submit a pull request.
