The Underlined architecture and its references are taken from Azure Architecture Center. The microsoft site has all content and services details and deployment details outlined are available in ARM-template (json format). This article deploys the same architecture using hashicorp language (HCL) terraform. The code build is enterprise ready code in modularized structure.
By Changing the values in terraform.tfvars
files you can deploy this architecture in N-number of environments you have in your organization.
The architecture shows proven practices for a web application that uses Azure App Service and Azure SQL Database. The architecture has other components like Resource groups, App Service Plan & App, Deployment Slots, IP-Address, Azure DNS, Azure SQL Database, Logical Server, Azure Storage, Azure Active Directory for more details on the each resources please click on this link
- README.md
- main.tf
- variables.tf
- outputs.tf
$ tree minimal-module/
.
├── README.md
├── main.tf
├── variables.tf
├── outputs.tf
Where each file details are outlined as;
- LICENSE will contain the license under which the module is distributed.
- readme.md will contain documentation describing how to use the module, in markdown format.
- main.tf will contain the main set of configuration for the module.
- variables.tf will contain the variable definitions for the module.
- outputs.tf Module outputs are made available to the configuration using the module, so they are often used to pass information about the parts of the infrastructure defined in the module to other parts of current configuration.
Terraform | Cloud-Provider | Function | Module Full-Name |
---|---|---|---|
terraform | azure | dns | tf-az-dns |
terraform | azure | storage | tf-az-strg |
terraform | azure | app service plan | tf-az-web |
terraform | azure | app service web app | tf-az-web |
terraform | azure | sql server | tf-az-db |
terraform | azure | sql databases | tf-az-db |
- Resource group in azure account is created manually.
- Choice of region for deployment of azure resources is "Central India"
- Define terraform version and azure provider in
main.tf
file - Define resource groups in
main.tf
file - Create files and update code in module folder named tf-az-dns
- Define dns code in
main.tf
,variables.tf
&terraform.tfvars
file. - Create files and update code in module folder named tf-az-strg
- Define dns code in
main.tf
,variables.tf
&terraform.tfvars
file. - Create files and update code in module folder named tf-az-db
- Define azure sql server and database code in
main.tf
,variables.tf
&terraform.tfvars
file. - Create files and update code in module folder named tf-az-web
- Define azure app service plan and web app service code in
main.tf
,variables.tf
&terraform.tfvars
file.
Parameter | URL | Terraformed Status |
---|---|---|
Azure Provider | link | Complete |
Azure DNS | link | Complete |
Azure Web App | link | Complete |
Azure Storage | link | Complete |
Azure SQL Database | link | Complete |