-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds LDAP user and group policy attachment resources (#581)
- Loading branch information
Showing
11 changed files
with
550 additions
and
32 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,56 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "minio_iam_ldap_group_policy_attachment Resource - terraform-provider-minio" | ||
subcategory: "" | ||
description: |- | ||
Attaches LDAP group to a policy. Can be used against both built-in and user-defined policies. | ||
--- | ||
|
||
# minio_iam_ldap_group_policy_attachment (Resource) | ||
|
||
Attaches LDAP group to a policy. Can be used against both built-in and user-defined policies. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "minio_iam_policy" "test_policy" { | ||
name = "state-terraform-s3" | ||
policy = <<EOF | ||
{ | ||
"Version":"2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid":"ListAllBucket", | ||
"Effect": "Allow", | ||
"Action": ["s3:PutObject"], | ||
"Principal":"*", | ||
"Resource": "arn:aws:s3:::state-terraform-s3/*" | ||
} | ||
] | ||
} | ||
EOF | ||
} | ||
resource "minio_iam_ldap_group_policy_attachment" "developer" { | ||
group_dn = "CN=terraform-user,OU=Unit,DC=example,DC=com" | ||
policy_name = minio_iam_policy.test_policy.id | ||
} | ||
# Example using a builtin policy | ||
resource "minio_iam_ldap_group_policy_attachment" "admins" { | ||
group_dn = "CN=minioadmins-admins,OU=Unit,DC=example,DC=com" | ||
policy_name = "consoleAdmin" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `group_dn` (String) The distinguished name (dn) of group to attach policy to | ||
- `policy_name` (String) Name of policy to attach to group | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. |
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,56 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "minio_iam_ldap_user_policy_attachment Resource - terraform-provider-minio" | ||
subcategory: "" | ||
description: |- | ||
Attaches LDAP user to a policy. Can be used against both built-in and user-defined policies. | ||
--- | ||
|
||
# minio_iam_ldap_user_policy_attachment (Resource) | ||
|
||
Attaches LDAP user to a policy. Can be used against both built-in and user-defined policies. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "minio_iam_policy" "test_policy" { | ||
name = "state-terraform-s3" | ||
policy = <<EOF | ||
{ | ||
"Version":"2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid":"ListAllBucket", | ||
"Effect": "Allow", | ||
"Action": ["s3:PutObject"], | ||
"Principal":"*", | ||
"Resource": "arn:aws:s3:::state-terraform-s3/*" | ||
} | ||
] | ||
} | ||
EOF | ||
} | ||
resource "minio_iam_ldap_user_policy_attachment" "developer" { | ||
user_dn = "CN=developer,OU=Unit,DC=example,DC=com" | ||
policy_name = minio_iam_policy.test_policy.id | ||
} | ||
# Example using a builtin policy | ||
resource "minio_iam_ldap_user_policy_attachment" "admins" { | ||
user_dn = "CN=admin,OU=Unit,DC=example,DC=com" | ||
policy_name = "consoleAdmin" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `policy_name` (String) Name of policy to attach to user | ||
- `user_dn` (String) The dn of user to attach policy to | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. |
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
28 changes: 28 additions & 0 deletions
28
examples/resources/minio_iam_ldap_group_policy_attachment/resource.tf
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,28 @@ | ||
resource "minio_iam_policy" "test_policy" { | ||
name = "state-terraform-s3" | ||
policy = <<EOF | ||
{ | ||
"Version":"2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid":"ListAllBucket", | ||
"Effect": "Allow", | ||
"Action": ["s3:PutObject"], | ||
"Principal":"*", | ||
"Resource": "arn:aws:s3:::state-terraform-s3/*" | ||
} | ||
] | ||
} | ||
EOF | ||
} | ||
|
||
resource "minio_iam_ldap_group_policy_attachment" "developer" { | ||
group_dn = "CN=terraform-user,OU=Unit,DC=example,DC=com" | ||
policy_name = minio_iam_policy.test_policy.id | ||
} | ||
|
||
# Example using a builtin policy | ||
resource "minio_iam_ldap_group_policy_attachment" "admins" { | ||
group_dn = "CN=minioadmins-admins,OU=Unit,DC=example,DC=com" | ||
policy_name = "consoleAdmin" | ||
} |
28 changes: 28 additions & 0 deletions
28
examples/resources/minio_iam_ldap_user_policy_attachment/resource.tf
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,28 @@ | ||
resource "minio_iam_policy" "test_policy" { | ||
name = "state-terraform-s3" | ||
policy = <<EOF | ||
{ | ||
"Version":"2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid":"ListAllBucket", | ||
"Effect": "Allow", | ||
"Action": ["s3:PutObject"], | ||
"Principal":"*", | ||
"Resource": "arn:aws:s3:::state-terraform-s3/*" | ||
} | ||
] | ||
} | ||
EOF | ||
} | ||
|
||
resource "minio_iam_ldap_user_policy_attachment" "developer" { | ||
user_dn = "CN=developer,OU=Unit,DC=example,DC=com" | ||
policy_name = minio_iam_policy.test_policy.id | ||
} | ||
|
||
# Example using a builtin policy | ||
resource "minio_iam_ldap_user_policy_attachment" "admins" { | ||
user_dn = "CN=admin,OU=Unit,DC=example,DC=com" | ||
policy_name = "consoleAdmin" | ||
} |
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
Oops, something went wrong.