-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(resources): iam_member documentation and examples (#63)
- Loading branch information
Showing
3 changed files
with
102 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
page_title: "montecarlo_iam_member Resource - terraform-provider-montecarlo" | ||
subcategory: "" | ||
description: |- | ||
A named resource which lets you assign users to the Monte Carlo authorization group. | ||
--- | ||
|
||
# montecarlo_iam_member (Resource) | ||
|
||
Represents a named resource which lets you assign user to the _Monte Carlo_ **authorization group** (see [montecarlo_iam_group](iam_group.md)). This assignment is allowed only if the **authorization group** is not configured for SSO. Configured member (user) will be asigned to the configured group, selected by the group name. This group name is effectively group ID as well (see [montecarlo_iam_group](iam_group.md)) and is not shown in the _Monte Carlo_ UI by default. | ||
|
||
`montecarlo_iam_group` resource sets the group name (ID) to the same value as its label, so the value displayed in the _Monte Carlo_ UI, for groups terraformed by that resource, is also a group name (ID). Alternatively, if you are using `montecarlo_iam_group` resource, you can reference group name (ID) directly in the _Terraform_ code. | ||
|
||
To get more information about _Monte Carlo_ **authorization groups** member assignments, see: | ||
- [API documentation](https://apidocs.getmontecarlo.com/#definition-UpdateUserAuthorizationGroupMembership) | ||
- How-to Guides | ||
- [Authorization](https://docs.getmontecarlo.com/docs/authorization) | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "montecarlo_iam_member" "example_builtin" { | ||
group = "groups/editors-all" | ||
member = "user:[email protected]" | ||
} | ||
resource "montecarlo_iam_member" "example_custom" { | ||
group = "groups/custom-group" | ||
member = "user:[email protected]" | ||
} | ||
resource "montecarlo_iam_member" "example_multiple" { | ||
group = "groups/custom-group" | ||
member = each.value | ||
for_each = toset([ | ||
"user:[email protected]", | ||
"user:[email protected]" | ||
]) | ||
} | ||
``` | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `group` (String) ID (name) of the **authorization group** to which the member (user) will be assigned. Current implementation requires the value to follow this format `groups/<group_name>`. _Monte Carlo_ UI currently does not expose name of the groups, therefore it might be complicated to obtain this value for existing groups. For this purpose, resource [montecarlo_iam_group](iam_group.md) sets name of the group and its label to the same values. | ||
|
||
- builtin groups are supported (e.g. `groups/editors-all`) | ||
- custom groups are supported (e.g. `groups/custom-group`) | ||
|
||
- `member` (String) This attribute represents the user that will be assigned to the specified Monte Carlo **authorization group**. Current implementation requires the value to follow this format `user:[email protected]`. If user with this **email** is not found in the _Monte Carlo_, the resource operations will fail. | ||
|
||
|
||
|
||
## Import | ||
|
||
This resource can be imported using the import ID with following format: | ||
|
||
* `{{groups/<group_name>,user:<user_email>}}` | ||
|
||
In **Terraform v1.5.0** and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import a _Member assignment_ using one of the formats above. For example: | ||
|
||
```terraform | ||
import { | ||
id = "{{groups/<group_name>,user:<user_email>}}" | ||
to = montecarlo_iam_member.default | ||
} | ||
``` | ||
|
||
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), _Member assignment_ can be imported using one of the formats above. For example: | ||
|
||
``` | ||
$ terraform import montecarlo_iam_member.default {{groups/<group_name>,user:<user_email>}} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
resource "montecarlo_iam_member" "example_builtin" { | ||
group = "groups/editors-all" | ||
member = "user:[email protected]" | ||
} | ||
|
||
resource "montecarlo_iam_member" "example_custom" { | ||
group = "groups/custom-group" | ||
member = "user:[email protected]" | ||
} | ||
|
||
resource "montecarlo_iam_member" "example_multiple" { | ||
group = "groups/custom-group" | ||
member = each.value | ||
for_each = toset([ | ||
"user:[email protected]", | ||
"user:[email protected]" | ||
]) | ||
} |