Skip to content

Latest commit

 

History

History
115 lines (90 loc) · 2.13 KB

vsphere_entity_permissions.md

File metadata and controls

115 lines (90 loc) · 2.13 KB

vsphere_entity_permissions

back

Index

Terraform

terraform {
  required_providers {
    vsphere = ">= 1.25.0"
  }
}

top

Example Usage

module "vsphere_entity_permissions" {
  source = "./modules/vsphere/r/vsphere_entity_permissions"

  # entity_id - (required) is a type of string
  entity_id = null
  # entity_type - (required) is a type of string
  entity_type = null

  permissions = [{
    is_group      = null
    propagate     = null
    role_id       = null
    user_or_group = null
  }]
}

top

Variables

variable "entity_id" {
  description = "(required) - The managed object id or uuid of the entity."
  type        = string
}

variable "entity_type" {
  description = "(required) - The entity managed object type."
  type        = string
}

variable "permissions" {
  description = "nested block: NestingList, min items: 1, max items: 0"
  type = set(object(
    {
      is_group      = bool
      propagate     = bool
      role_id       = string
      user_or_group = string
    }
  ))
}

top

Resource

resource "vsphere_entity_permissions" "this" {
  # entity_id - (required) is a type of string
  entity_id = var.entity_id
  # entity_type - (required) is a type of string
  entity_type = var.entity_type

  dynamic "permissions" {
    for_each = var.permissions
    content {
      # is_group - (required) is a type of bool
      is_group = permissions.value["is_group"]
      # propagate - (required) is a type of bool
      propagate = permissions.value["propagate"]
      # role_id - (required) is a type of string
      role_id = permissions.value["role_id"]
      # user_or_group - (required) is a type of string
      user_or_group = permissions.value["user_or_group"]
    }
  }

}

top

Outputs

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

output "this" {
  value = vsphere_entity_permissions.this
}

top