Skip to content

Terraform module which manages NSX-T Application Port Profile ressources on VMWare Cloud Director.

Notifications You must be signed in to change notification settings

noris-network/terraform-vcd-nsxt-app-port-profile

Repository files navigation

terraform-vcd-nsxt-app-port-profile

Terraform module which manages NSX-T Application Port Profile ressources on VMWare Cloud Director.

Requirements

Name Version
terraform >= 1.1.9
vcd >= 3.9.0

Providers

Name Version
vcd 3.9.0

Modules

No modules.

Resources

Name Type
vcd_nsxt_app_port_profile.nsxt_app_port_profile resource

Inputs

Name Description Type Default Required
app_ports At least one block of Application Port definition.
list(object({
protocol = string
port = set(string)
}))
n/a yes
name A unique name for Port Profile. string n/a yes
context_id ID of NSX-T Manager, VDC or VDC Group. It accepts VDC, VDC Group or NSX-T Manager ID. string null no
description (Optional) An optional description of the Application Port Profile. string null no
scope Application Port Profile scope - PROVIDER, TENANT. Default: TENANT string "TENANT" no
vdc_org_name The name of the organization to use. string null no

Outputs

Name Description
id The ID of the Port Profile.

Examples

Single instance

module "app_port_profile" {
  source       = "git::https://github.com/noris-network/terraform-vcd-nsxt-app-port-profile?ref=1.0.0"
  vdc_org_name = "myORG"
  name         = "myPort"
  app_ports    = {
    protocol = "TCP"
    port     = ["31337"]
  }
}

Real world example

locals {
  port_profiles = [
    {
      name = "webserver"
      app_ports = [
        {
          protocol = "TCP"
          port     = ["80", "81-82"]
        }.
        {
          protocol = "TCP"
          port     = ["83"]
        },
        { protocol = "ICMP" }
      ]
    },
    {
      name = "db"
      app_ports = [
        {
          protocol = "TCP"
          port     = ["1111"]
        }
      ]
    }
  ]
}

module "app_port_profiles" {
  source       = "git::https://github.com/noris-network/terraform-vcd-nsxt-app-port-profile?ref=1.0.0"
  for_each     = { for profile in locals.port_profiles : profile.name => profile }
  vdc_org_name = var.vdc_org_name
  name         = each.value.name
  app_ports    = each.value.app_ports
}

About

Terraform module which manages NSX-T Application Port Profile ressources on VMWare Cloud Director.

Topics

Resources

Stars

Watchers

Forks

Languages