2023-09-12 11:37:31 -07:00
|
|
|
---
|
|
|
|
|
layout: docs
|
|
|
|
|
page_title: roles add-principals - Command
|
2024-12-17 14:13:18 -05:00
|
|
|
description: >-
|
|
|
|
|
The "roles add-principals" command add principals to an existing role resource. Principals can be users or groups.
|
2023-09-12 11:37:31 -07:00
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# roles add-principals
|
|
|
|
|
|
|
|
|
|
Command: `roles add-principals`
|
|
|
|
|
|
|
|
|
|
The `roles add-principals` command lets you add principals to a role.
|
|
|
|
|
Principals can be users or groups.
|
|
|
|
|
You can specify multiple principals per role.
|
|
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
|
|
This example adds the principals `$GROUP_ID` to a role with the ID `r_1234567890`:
|
|
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
|
$ boundary roles add-principals -id r_1234567890 -principal=$GROUP_ID
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
<CodeBlockConfig hideClipboard>
|
|
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
|
$ boundary roles add-principals [options] [args]
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</CodeBlockConfig>
|
|
|
|
|
|
|
|
|
|
### Command options
|
|
|
|
|
|
|
|
|
|
- `-id=<string>` - The ID of the role you want to add principals to.
|
|
|
|
|
- `-principal=<string>` - The principals you want to add to the role.
|
|
|
|
|
Principals can be users or groups.
|
|
|
|
|
You can optionally specify multiple principals per role.
|
|
|
|
|
- `-version=<int>` The version of the role to add principals to.
|
|
|
|
|
If you do not specify a version, the command performs a check-and-set automatically.
|
|
|
|
|
|
|
|
|
|
@include 'cmd-option-note.mdx'
|