Challenge -1
- One virtual network tied in three subnets.
- Each subnet will have one virtual machine.
- First virtual machine -> allow inbound traffic from internet only.
- Second virtual machine -> entertain traffic from first virtual machine only and can reply the same virtual machine again.
- App can connect to database and database can connect to app but database cannot connect to web.
For the solution, we have created and used five modules:
- resourcegroup - creating resourcegroup
- networking - creating azure virtual network and required subnets
- securitygroup - creating network security group, setting desired security rules and associating them to subnets
- compute - creating availability sets, network interfaces and virtual machines
- database - creating database server and database
├── main.tf // The primary entrypoint for terraform resources.
├── vars.tf // It contain the declarations for variables.
├── output.tf // It contain the declarations for outputs.
├── terraform.tfvars // The file to pass the terraform variables values.
Challenge-2
To get the entire JSON, the code can be run as:
python metadata.py
Challenge-3
To test the python function written to achieve this, run
python testgetValue.py