# juju_jaas_access_model (Resource)

A resource that represent access to a model when using JAAS.

## Example Usage

```terraform
resource "juju_jaas_access_model" "development" {
  model_uuid       = juju_model.development.uuid
  access           = "administrator"
  users            = ["foo@domain.com"]
  groups           = [juju_jaas_group.development.uuid]
  idp_groups       = ["engineering"]
  service_accounts = ["Client-ID-1", "Client-ID-2"]
}
```

<!-- schema generated by tfplugindocs -->

## Schema

### Required

- `access` (String) Level of access to grant. Changing this value will replace the Terraform resource. Valid access levels are described at [https://canonical-jaas-documentation.readthedocs-hosted.com/latest/howto/manage-permissions/#add-a-permission](https://canonical-jaas-documentation.readthedocs-hosted.com/latest/howto/manage-permissions/#add-a-permission)
- `model_uuid` (String) The uuid of the model for access management. If this is changed the resource will be deleted and a new resource will be created.

### Optional

- `groups` (Set of String) List of groups to grant access. A valid group ID is the group’s UUID.
- `idp_groups` (Set of String) List of identity provider groups to grant access. IdP groups have no provider-side format restriction.
- `roles` (Set of String) List of roles UUIDs to grant access.
- `service_accounts` (Set of String) List of service accounts to grant access. A valid service account is the service account’s name.
- `users` (Set of String) List of users to grant access. A valid user is the user’s name or email.

### Read-Only

- `id` (String) The ID of this resource.

## Import

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
# JAAS model access can be imported using the model name and access level
$ terraform import juju_jaas_access_model.development development:can_addmodel
```
