Skip to content

Commit d4f9c3e

Browse files
committed
created dns for lb
1 parent e2b5fac commit d4f9c3e

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# 📖 Azure Cloud Web App Deployment <a name="about-project"></a>
3434

3535
This project automates the provisioning and deployment of a scalable cloud application on Microsoft Azure. It uses **Terraform** to create infrastructure, and **Ansible** to configure services like a backend API running on 2 VMs behind a Load Balancer, connected to an **Azure MySQL** database, along with a frontend deployed on **Azure Web App**.
36-
36+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
3737
## 🛠 Built With <a name="built-with"></a>
3838

3939
### Tech Stack <a name="tech-stack"></a>

infra/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ module "load-balancer" {
6969
mysql_fqdn = module.mysql-database.mysql_fqdn
7070
admin_username = var.admin_username
7171
ssh_public_key = var.ssh_public_key
72+
lb_dns_name = var.lb_dns_name
7273
}
7374

7475

infra/modules/load-balancer/lb.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ resource "azurerm_public_ip" "lb" {
44
resource_group_name = var.resource_group_name
55
allocation_method = "Static"
66
sku = "Standard"
7+
8+
domain_name_label = var.lb_dns_name
79
}
810

911
resource "azurerm_lb" "main" {

infra/modules/load-balancer/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ variable "lb_api_port" {
1717
type = number
1818
default = 8080
1919
}
20+
21+
variable "lb_dns_name" {
22+
description = "DNS label for the public IP"
23+
type = string
24+
}

infra/variables.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,8 @@ variable "ssh_public_key" {
5252
sensitive = true
5353
}
5454

55-
55+
variable "lb_dns_name" {
56+
description = "DNS label for the public IP"
57+
type = string
58+
}
5659

0 commit comments

Comments
 (0)