/
main.tf
53 lines (45 loc) · 1.36 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "rgterraf" {
name = var.rg
location = "West Europe"
}
resource "azurerm_public_ip_prefix" "public_ip_prefix" {
name = "ppp01"
location = var.loc
resource_group_name = "terraform"
prefix_length = 28
}
resource "azurerm_lb" "elb" {
name = "Balanceador"
resource_group_name = var.rg
location = var.loc
sku = "Standard"
}
resource "azurerm_lb_probe" "elb_probe" {
name = "prob"
resource_group_name = "terraform"
loadbalancer_id = azurerm_lb.elb.id
protocol = "Tcp"
port = "8117"
interval_in_seconds = "5"
number_of_probes = "2"
depends_on = [azurerm_lb.elb]
}
resource "azurerm_lb_rule" "example" {
resource_group_name = "terraform"
loadbalancer_id = azurerm_lb.elb.id
load_distribution = "SourceIPProtocol"
name = "LBRule"
protocol = "Tcp"
frontend_port = 3389
backend_port = 3389
frontend_ip_configuration_name = "PublicIPAddress"
}
resource "azurerm_public_ip" "example" {
name = "PublicIPForLB"
location = var.loc
resource_group_name = "terraform"
allocation_method = "Static"
}