tfwriter

Terraform HCL code generator.

Download as .zip Download as .tar.gz View on GitHub

avi_role

back

Index

Terraform

terraform {
  required_providers {
    avi = ">= 0.2.3"
  }
}

top

Example Usage

module "avi_role" {
  source = "./modules/avi/r/avi_role"

  # name - (required) is a type of string
  name = null
  # tenant_ref - (optional) is a type of string
  tenant_ref = null
  # uuid - (optional) is a type of string
  uuid = null

  privileges = [{
    resource = null
    type     = null
  }]
}

top

Variables

variable "name" {
  description = "(required)"
  type        = string
}

variable "tenant_ref" {
  description = "(optional)"
  type        = string
  default     = null
}

variable "uuid" {
  description = "(optional)"
  type        = string
  default     = null
}

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

top

Resource

resource "avi_role" "this" {
  # name - (required) is a type of string
  name = var.name
  # tenant_ref - (optional) is a type of string
  tenant_ref = var.tenant_ref
  # uuid - (optional) is a type of string
  uuid = var.uuid

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

}

top

Outputs

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

output "tenant_ref" {
  description = "returns a string"
  value       = avi_role.this.tenant_ref
}

output "uuid" {
  description = "returns a string"
  value       = avi_role.this.uuid
}

output "this" {
  value = avi_role.this
}

top