-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
22 lines (20 loc) · 844 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
data "vcd_vdc_group" "orgGroup" {
name = var.vcd_group_name
}
data "vcd_nsxt_edgegateway" "orgEdge" {
name = var.vcd_edge_name
owner_id = data.vcd_vdc_group.orgGroup.id
}
# Создание NAT правила
resource "vcd_nsxt_nat_rule" "nat" {
edge_gateway_id = data.vcd_nsxt_edgegateway.orgEdge.id
name = var.name
description = var.description
enabled = var.state
rule_type = var.type
external_address = var.ext_ip != "" ? var.ext_ip : tolist(data.vcd_nsxt_edgegateway.orgEdge.subnet)[0].primary_ip
internal_address = var.int_ip
dnat_external_port = var.in_port != "" ? var.in_port : ""
snat_destination_address = var.dst_ip != "" ? var.dst_ip : ""
app_port_profile_id = var.app_id != "" ? var.app_id : ""
}