1- Install Terraform (https://learn.hashicorp.com/tutorials/terraform/install-cli?in=terraform/aws-get-started)
2- Create azure account
3- Install the Azure CLI and authenticate with Azure with the following command:
az login
- Create an image with web app configuration based on this repository: https://github.com/LetsCreatProjects/bootcamp-app.git
- The configuration of the app you can find here: https://www.youtube.com/watch?v=LWPIdzeiThs
- For keeping app up at restart you can use pm2.
terraform_creating_elastic_scaleset_with_postgres is template that building an Elastic High Availability virtual network on azure with terraform code. On that infrastructure we are going to deploy a Node.js Weight Tracker App. input for variables for via .tfvars:
- instance_num =
- VnetName = ""
- ScaleSetName = ""
- admin_user_name = ""
- admin_password = ""
- pg_user = ""
- pg_pass = ""
blob_creation template create container inside blob storage and stores terraform.tfstate file in there (inside RG).
Input variables for port creation via .tfvars:
- resource_group_name = ""
- location = ""
- storage_account_name = ""
- storage_container_name = ""
The second template blob_insert_into_container inserts file terraform.state inside blob storage container. In order to do that, inset in this folder terraform.state.
Commands to run templates:
- // init
- terraform init
- // plan
- terraform plan
- // apply
- terraform apply
please notice if .tfvars file is needed to add to command: -var-file="{filename}.tfvars"
Name | Version |
---|---|
terraform | >= 1.2.2 |
azurerm | ~> 2.65 |
Name | Version |
---|---|
azurerm | 2.99.0 |
Name | Source | Version |
---|---|---|
Scale_set_module | ./Scalsetmodule | n/a |
Name | Description | Type | Default | Required |
---|---|---|---|---|
RG | RG_VMSS_with_postgresSQL | string |
"RG_VMSS_with_postgresSQL" |
no |
ScaleSetName | ScaleSetName | string |
"AppScaleSet" |
no |
Vnet | Vnet | string |
"Vnet" |
no |
VnetName | VnetName | string |
"Vnet" |
no |
address_space | n/a | list(any) |
[ |
no |
admin_password | password for vm login | string |
"Input your password here" |
no |
admin_user_name | user name for vm login | string |
"" |
no |
instance_num | scale set min instance num to differ the Staging and Production workspaces | number |
2 |
no |
location | Azure location of terraform server environment | string |
"australiaeast" |
no |
pg_pass | pg_pass | string |
"" |
no |
pg_user | pg_user | string |
"" |
no |
tags | tags | string |
"enviroment" |
no |
Name | Description |
---|---|
password_VMSS | n/a |