Skip to content

Instantly share code, notes, and snippets.

@nvibert
Created September 30, 2021 15:46
Show Gist options
  • Save nvibert/c49282f29c1cd7e7ce2d4756a0a34440 to your computer and use it in GitHub Desktop.
Save nvibert/c49282f29c1cd7e7ce2d4756a0a34440 to your computer and use it in GitHub Desktop.
Prototype of Fortinet CTS Module
resource "fortios_firewall_address" "consul_service" {
for_each = var.services
name = each.value.id
subnet = "${each.value.address} ${lookup(each.value.meta, "subnet_mask", "255.255.255.255")}"
type = "ipmask"
visibility = "enable"
}
resource "fortios_firewall_addrgrp" "ctsAddrGroup" {
allow_routing = "disable"
color = 0
exclude = "disable"
name = "groupCts"
visibility = "enable"
dynamic "member" {
for_each = fortios_firewall_address.consul_service
content {
name = member.value["name"]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment