Skip to content

Commit

Permalink
docs(role-jaas): add docs for jaas' roles
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoneDutto committed Dec 17, 2024
1 parent 28502e5 commit 98e7909
Show file tree
Hide file tree
Showing 13 changed files with 139 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/data-sources/jaas_role.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "juju_jaas_role Data Source - terraform-provider-juju"
subcategory: ""
description: |-
A data source representing a Juju JAAS Role.
---

# juju_jaas_role (Data Source)

A data source representing a Juju JAAS Role.

## Example Usage

```terraform
data "juju_jaas_role" "test" {
name = "role-0"
}
output "role_uuid" {
value = data.juju_jaas_role.test.uuid
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) The name of the role.

### Read-Only

- `uuid` (String) The UUID of the role.
1 change: 1 addition & 0 deletions docs/resources/jaas_access_cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ resource "juju_jaas_access_cloud" "development" {
### Optional

- `groups` (Set of String) List of groups to grant access.
- `roles` (Set of String) List of roles to grant access.
- `service_accounts` (Set of String) List of service accounts to grant access.
- `users` (Set of String) List of users to grant access.

Expand Down
1 change: 1 addition & 0 deletions docs/resources/jaas_access_controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ resource "juju_jaas_access_controller" "development" {
### Optional

- `groups` (Set of String) List of groups to grant access.
- `roles` (Set of String) List of roles to grant access.
- `service_accounts` (Set of String) List of service accounts to grant access.
- `users` (Set of String) List of users to grant access.

Expand Down
1 change: 1 addition & 0 deletions docs/resources/jaas_access_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ resource "juju_jaas_access_group" "development" {
### Optional

- `groups` (Set of String) List of groups to grant access.
- `roles` (Set of String) List of roles to grant access.
- `service_accounts` (Set of String) List of service accounts to grant access.
- `users` (Set of String) List of users to grant access.

Expand Down
1 change: 1 addition & 0 deletions docs/resources/jaas_access_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ resource "juju_jaas_access_model" "development" {
### Optional

- `groups` (Set of String) List of groups to grant access.
- `roles` (Set of String) List of roles to grant access.
- `service_accounts` (Set of String) List of service accounts to grant access.
- `users` (Set of String) List of users to grant access.

Expand Down
1 change: 1 addition & 0 deletions docs/resources/jaas_access_offer.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ resource "juju_jaas_access_offer" "development" {
### Optional

- `groups` (Set of String) List of groups to grant access.
- `roles` (Set of String) List of roles to grant access.
- `service_accounts` (Set of String) List of service accounts to grant access.
- `users` (Set of String) List of users to grant access.

Expand Down
50 changes: 50 additions & 0 deletions docs/resources/jaas_access_role.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "juju_jaas_access_role Resource - terraform-provider-juju"
subcategory: ""
description: |-
A resource that represents access to a role when using JAAS.
---

# juju_jaas_access_role (Resource)

A resource that represents access to a role when using JAAS.

## Example Usage

```terraform
resource "juju_jaas_access_role" "development" {
role_id = juju_jaas_role.target-role.uuid
access = "member"
users = ["[email protected]"]
roles = [juju_jaas_role.development.uuid]
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/en/latest/reference/authorisation_model/#valid-relations
- `role_id` (String) The ID of the role 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.
- `service_accounts` (Set of String) List of service accounts to grant access.
- `users` (Set of String) List of users to grant access.

### Read-Only

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

## Import

Import is supported using the following syntax:

```shell
# JAAS role access can be imported using the role UUID and access level
$ terraform import juju_jaas_access_role.development UUID:member
```
1 change: 1 addition & 0 deletions docs/resources/jaas_access_service_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ resource "juju_jaas_access_service_account" "development" {
### Optional

- `groups` (Set of String) List of groups to grant access.
- `roles` (Set of String) List of roles to grant access.
- `service_accounts` (Set of String) List of service accounts to grant access.
- `users` (Set of String) List of users to grant access.

Expand Down
30 changes: 30 additions & 0 deletions docs/resources/jaas_role.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "juju_jaas_role Resource - terraform-provider-juju"
subcategory: ""
description: |-
A resource that represents a role in JAAS
---

# juju_jaas_role (Resource)

A resource that represents a role in JAAS

## Example Usage

```terraform
resource "juju_jaas_role" "development" {
name = "devops-team"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Name of the role

### Read-Only

- `uuid` (String) UUID of the role
7 changes: 7 additions & 0 deletions examples/data-sources/juju_jaas_role/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "juju_jaas_role" "test" {
name = "role-0"
}

output "role_uuid" {
value = data.juju_jaas_role.test.uuid
}
2 changes: 2 additions & 0 deletions examples/resources/juju_jaas_access_role/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# JAAS role access can be imported using the role UUID and access level
$ terraform import juju_jaas_access_role.development UUID:member
7 changes: 7 additions & 0 deletions examples/resources/juju_jaas_access_role/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resource "juju_jaas_access_role" "development" {
role_id = juju_jaas_role.target-role.uuid
access = "member"
users = ["[email protected]"]
roles = [juju_jaas_role.development.uuid]
service_accounts = ["Client-ID-1", "Client-ID-2"]
}
3 changes: 3 additions & 0 deletions examples/resources/juju_jaas_role/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resource "juju_jaas_role" "development" {
name = "devops-team"
}

0 comments on commit 98e7909

Please sign in to comment.