# Reference for the teleport\_access\_list\_member Terraform resource

This page describes the supported values of the teleport\_access\_list\_member resource of the Teleport Terraform provider.

## Example Usage

```
resource "teleport_access_list" "characters" {
  header = {
    metadata = {
      name = "crane-operation"
    }
  }
  spec = {
    type        = "static" # the access list must be of type "static" to manage its members with Terraform
    title       = "Characters"
    description = "The list of game characters."
    owners = [
      { name = "dungeon_master" },
    ]
    grants = {
      roles = ["dungeon_access"]
    }
  }
}

# User member:

resource "teleport_access_list_member" "fighter" {
  header = {
    version = "v1"
    metadata = {
      name = "fighter" # Teleport user name
    }
  }
  spec = {
    access_list     = teleport_access_list.characters.id
    membership_kind = 1 # 1 for "MEMBERSHIP_KIND_USER", 2 for "MEMBERSHIP_KIND_LIST"
  }
}

# Nested Access List member:

resource "teleport_access_list" "npcs" {
  header = {
    metadata = {
      name = "npcs"
    }
  }
  spec = {
    title       = "NPCs"
    description = "Non-player characters."
    owners = [
      { name = "dungeon_master" }
    ]
    grants = {
      roles = ["dungeon_access"]
    }
    audit = {
      recurrence = {
        frequency    = 3
        day_of_month = 15
      }
    }
  }
}

resource "teleport_access_list_member" "npcs" {
  header = {
    version = "v1"
    metadata = {
      name = teleport_access_list.npcs.id
    }
  }
  spec = {
    access_list     = teleport_access_list.characters.id
    membership_kind = 2 # 1 for "MEMBERSHIP_KIND_USER", 2 for "MEMBERSHIP_KIND_LIST"
  }
}

```

## Schema

### Optional

- `header` (Attributes) header is the header for the resource. (see [below for nested schema](#nested-schema-for-header))
- `spec` (Attributes) spec is the specification for the Access List member. (see [below for nested schema](#nested-schema-for-spec))

### Nested Schema for `header`

Required:

- `version` (String) Version is the API version used to create the resource. It must be specified. Based on this version, Teleport will apply different defaults on resource creation or deletion. It must be an integer prefixed by "v". For example: `v1`

Optional:

- `kind` (String) kind is a resource kind.
- `metadata` (Attributes) metadata is resource metadata. (see [below for nested schema](#nested-schema-for-headermetadata))
- `sub_kind` (String) sub\_kind is an optional resource sub kind, used in some resources.

### Nested Schema for `header.metadata`

Required:

- `name` (String) name is an object name.

Optional:

- `description` (String) description is object description.
- `expires` (String) expires is a global expiry time header can be set on any resource in the system.
- `labels` (Map of String) labels is a set of labels.
- `namespace` (String) namespace is object namespace. The field should be called "namespace" when it returns in Teleport 2.4.
- `revision` (String) revision is an opaque identifier which tracks the versions of a resource over time. Clients should ignore and not alter its value but must return the revision in any updates of a resource.

### Nested Schema for `spec`

Required:

- `access_list` (String) associated Access List
- `membership_kind` (Number) membership\_kind describes the type of membership, either `MEMBERSHIP_KIND_USER` or `MEMBERSHIP_KIND_LIST`.

Optional:

- `added_by` (String) added\_by is the user that added this user to the Access List.
- `expires` (String) expires is when the user's membership to the Access List expires.
- `joined` (String) joined is when the user joined the Access List.
- `name` (String) name is the name of the member of the Access List.
- `reason` (String) reason is the reason this user was added to the Access List.
