Skip to content

Latest commit

 

History

History
247 lines (206 loc) · 5.04 KB

nsxt_dhcp_server_ip_pool.md

File metadata and controls

247 lines (206 loc) · 5.04 KB

nsxt_dhcp_server_ip_pool

back

Index

Terraform

terraform {
  required_providers {
    nsxt = ">= 3.1.1"
  }
}

top

Example Usage

module "nsxt_dhcp_server_ip_pool" {
  source = "./modules/nsxt/r/nsxt_dhcp_server_ip_pool"

  # description - (optional) is a type of string
  description = null
  # display_name - (optional) is a type of string
  display_name = null
  # error_threshold - (optional) is a type of number
  error_threshold = null
  # gateway_ip - (optional) is a type of string
  gateway_ip = null
  # lease_time - (optional) is a type of number
  lease_time = null
  # logical_dhcp_server_id - (required) is a type of string
  logical_dhcp_server_id = null
  # warning_threshold - (optional) is a type of number
  warning_threshold = null

  dhcp_generic_option = [{
    code   = null
    values = []
  }]

  dhcp_option_121 = [{
    network  = null
    next_hop = null
  }]

  ip_range = [{
    end   = null
    start = null
  }]

  tag = [{
    scope = null
    tag   = null
  }]
}

top

Variables

variable "description" {
  description = "(optional) - Description of this resource"
  type        = string
  default     = null
}

variable "display_name" {
  description = "(optional) - The display name of this resource. Defaults to ID if not set"
  type        = string
  default     = null
}

variable "error_threshold" {
  description = "(optional) - Error threshold"
  type        = number
  default     = null
}

variable "gateway_ip" {
  description = "(optional) - Gateway ip"
  type        = string
  default     = null
}

variable "lease_time" {
  description = "(optional) - Lease time, in seconds"
  type        = number
  default     = null
}

variable "logical_dhcp_server_id" {
  description = "(required) - Id of dhcp server this pool is serving"
  type        = string
}

variable "warning_threshold" {
  description = "(optional) - Warning threshold"
  type        = number
  default     = null
}

variable "dhcp_generic_option" {
  description = "nested block: NestingList, min items: 0, max items: 0"
  type = set(object(
    {
      code   = number
      values = list(string)
    }
  ))
  default = []
}

variable "dhcp_option_121" {
  description = "nested block: NestingList, min items: 0, max items: 0"
  type = set(object(
    {
      network  = string
      next_hop = string
    }
  ))
  default = []
}

variable "ip_range" {
  description = "nested block: NestingList, min items: 0, max items: 0"
  type = set(object(
    {
      end   = string
      start = string
    }
  ))
  default = []
}

variable "tag" {
  description = "nested block: NestingSet, min items: 0, max items: 0"
  type = set(object(
    {
      scope = string
      tag   = string
    }
  ))
  default = []
}

top

Resource

resource "nsxt_dhcp_server_ip_pool" "this" {
  # description - (optional) is a type of string
  description = var.description
  # display_name - (optional) is a type of string
  display_name = var.display_name
  # error_threshold - (optional) is a type of number
  error_threshold = var.error_threshold
  # gateway_ip - (optional) is a type of string
  gateway_ip = var.gateway_ip
  # lease_time - (optional) is a type of number
  lease_time = var.lease_time
  # logical_dhcp_server_id - (required) is a type of string
  logical_dhcp_server_id = var.logical_dhcp_server_id
  # warning_threshold - (optional) is a type of number
  warning_threshold = var.warning_threshold

  dynamic "dhcp_generic_option" {
    for_each = var.dhcp_generic_option
    content {
      # code - (required) is a type of number
      code = dhcp_generic_option.value["code"]
      # values - (required) is a type of list of string
      values = dhcp_generic_option.value["values"]
    }
  }

  dynamic "dhcp_option_121" {
    for_each = var.dhcp_option_121
    content {
      # network - (required) is a type of string
      network = dhcp_option_121.value["network"]
      # next_hop - (required) is a type of string
      next_hop = dhcp_option_121.value["next_hop"]
    }
  }

  dynamic "ip_range" {
    for_each = var.ip_range
    content {
      # end - (required) is a type of string
      end = ip_range.value["end"]
      # start - (required) is a type of string
      start = ip_range.value["start"]
    }
  }

  dynamic "tag" {
    for_each = var.tag
    content {
      # scope - (optional) is a type of string
      scope = tag.value["scope"]
      # tag - (optional) is a type of string
      tag = tag.value["tag"]
    }
  }

}

top

Outputs

output "display_name" {
  description = "returns a string"
  value       = nsxt_dhcp_server_ip_pool.this.display_name
}

output "id" {
  description = "returns a string"
  value       = nsxt_dhcp_server_ip_pool.this.id
}

output "revision" {
  description = "returns a number"
  value       = nsxt_dhcp_server_ip_pool.this.revision
}

output "this" {
  value = nsxt_dhcp_server_ip_pool.this
}

top