Skip to content

Commit

Permalink
Improve documentation (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzofelletti authored Jul 31, 2024
1 parent 188e959 commit c2eeaf9
Show file tree
Hide file tree
Showing 35 changed files with 250 additions and 133 deletions.
47 changes: 47 additions & 0 deletions docs/data-sources/s3_object.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "minio_s3_object Data Source - terraform-provider-minio"
subcategory: ""
description: |-
---

# minio_s3_object (Data Source)



## Example Usage

```terraform
data "minio_s3_object" "document" {
object_name = "document.txt"
bucket_name = "documents-bucket"
}
```

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

### Required

- `bucket_name` (String) The name of the bucket containing the object
- `object_name` (String) The name of the object

### Read-Only

- `checksum_crc32` (String) The CRC32 checksum of the object
- `checksum_crc32c` (String) The CRC32C checksum of the object
- `checksum_sha1` (String) The SHA1 checksum of the object
- `checksum_sha256` (String) The SHA256 checksum of the object
- `content` (String) The content of the object
- `content_type` (String) The content type of the object
- `etag` (String) The ETag of the object
- `expiration_rule_id` (String) The lifecycle expiry-date and ruleID associated with the expiry
- `expires` (String) The date and time at which the object is no longer able to be cached
- `id` (String) The ID of this resource.
- `is_latest` (Boolean) Whether the object is the latest version
- `last_modified` (String) The last modified time of the object
- `owner` (Map of String) The owner of the object
- `size` (Number) The size of the object
- `storage_class` (String) The storage class of the object
- `version_id` (String) The version ID of the object
4 changes: 2 additions & 2 deletions docs/resources/iam_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ output "minio_user_group" {

### Required

- `name` (String)
- `name` (String) Name of the group

### Optional

Expand All @@ -36,5 +36,5 @@ output "minio_user_group" {

### Read-Only

- `group_name` (String)
- `group_name` (String) The name of the group.
- `id` (String) The ID of this resource.
37 changes: 37 additions & 0 deletions docs/resources/iam_group_membership.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,44 @@ description: |-



## Example Usage

```terraform
resource "minio_iam_group" "developer" {
name = "developer"
}
resource "minio_iam_user" "user_one" {
name = "test-user"
}
resource "minio_iam_user" "user_two" {
name = "test-user-two"
}
resource "minio_iam_group_membership" "developer" {
name = "tf-testing-group-membership"
users = [
"${minio_iam_user.user_one.name}",
"${minio_iam_user.user_two.name}",
]
group = minio_iam_group.developer.name
}
output "minio_name" {
value = "${minio_iam_group_membership.developer.id}"
}
output "minio_users" {
value = "${minio_iam_group_membership.developer.users}"
}
output "minio_group" {
value = "${minio_iam_group_membership.developer.group}"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
8 changes: 4 additions & 4 deletions docs/resources/iam_group_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ output "minio_group" {

### Required

- `group` (String)
- `policy` (String)
- `group` (String) Name of group the policy belongs to.
- `policy` (String) Policy JSON string

### Optional

- `name` (String)
- `name_prefix` (String)
- `name` (String) Name of the policy. If omitted, Terraform will assign a random, unique name.
- `name_prefix` (String) Prefix to the generated policy name. Do not use with `name`.

### Read-Only

Expand Down
6 changes: 3 additions & 3 deletions docs/resources/iam_group_policy_attachment.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ output "minio_group" {
# Example using an LDAP Group instead of a static MinIO group
resource "minio_iam_group_policy_attachment" "developer" {
group_name = "OU=Unit,DC=example,DC=com"
user_name = "OU=Unit,DC=example,DC=com"
policy_name = "${minio_iam_policy.test_policy.id}"
}
```
Expand All @@ -66,8 +66,8 @@ resource "minio_iam_group_policy_attachment" "developer" {

### Required

- `group_name` (String)
- `policy_name` (String)
- `group_name` (String) Name of group to attach policy to
- `policy_name` (String) Name of policy to attach to group

### Read-Only

Expand Down
4 changes: 2 additions & 2 deletions docs/resources/iam_group_user_attachment.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ output "minio_group" {

### Required

- `group_name` (String)
- `user_name` (String)
- `group_name` (String) Name of group to attach user to
- `user_name` (String) Name of user

### Read-Only

Expand Down
6 changes: 3 additions & 3 deletions docs/resources/iam_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ output "minio_policy" {

### Required

- `policy` (String)
- `policy` (String) Policy JSON string

### Optional

- `name` (String)
- `name_prefix` (String)
- `name` (String) Name of the policy. Conflicts with `name_prefix`.
- `name_prefix` (String) Prefix to the generated policy name. Do not use with `name`.

### Read-Only

Expand Down
8 changes: 4 additions & 4 deletions docs/resources/iam_service_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ output "minio_password" {

### Required

- `target_user` (String)
- `target_user` (String) User the service account will be created for

### Optional

- `disable_user` (Boolean) Disable service account
- `policy` (String) policy of service account
- `policy` (String) policy of service account as encoded JSON string
- `update_secret` (Boolean) rotate secret key

### Read-Only

- `access_key` (String)
- `access_key` (String) access key of service account
- `id` (String) The ID of this resource.
- `secret_key` (String, Sensitive)
- `secret_key` (String, Sensitive) secret key of service account
- `status` (String)
2 changes: 1 addition & 1 deletion docs/resources/iam_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ output "secret" {

### Required

- `name` (String)
- `name` (String) Name of the user

### Optional

Expand Down
4 changes: 2 additions & 2 deletions docs/resources/iam_user_policy_attachment.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ resource "minio_iam_user_policy_attachment" "developer" {

### Required

- `policy_name` (String)
- `user_name` (String)
- `policy_name` (String) Name of policy to attach to user
- `user_name` (String) Name of user

### Read-Only

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/kms_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ description: |-

### Required

- `key_id` (String)
- `key_id` (String) KMS key ID

### Read-Only

Expand Down
16 changes: 8 additions & 8 deletions docs/resources/s3_bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ output "minio_url" {

### Optional

- `acl` (String)
- `bucket` (String)
- `bucket_prefix` (String)
- `force_destroy` (Boolean)
- `object_locking` (Boolean)
- `quota` (Number)
- `acl` (String) Bucket's Access Control List (default: private)
- `bucket` (String) Name of the bucket
- `bucket_prefix` (String) Prefix of the bucket
- `force_destroy` (Boolean) Force destroy the bucket (default: false)
- `object_locking` (Boolean) Enable object locking for the bucket (default: false)
- `quota` (Number) Quota of the bucket

### Read-Only

- `arn` (String)
- `bucket_domain_name` (String)
- `arn` (String) ARN of the bucket
- `bucket_domain_name` (String) The bucket domain name
- `id` (String) The ID of this resource.
5 changes: 1 addition & 4 deletions docs/resources/s3_bucket_notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,4 @@ Optional:

- `filter_prefix` (String)
- `filter_suffix` (String)

Read-Only:

- `id` (String) The ID of this resource.
- `id` (String)
4 changes: 2 additions & 2 deletions docs/resources/s3_bucket_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ description: |-

### Required

- `bucket` (String)
- `policy` (String)
- `bucket` (String) Name of the bucket
- `policy` (String) Policy JSON string

### Read-Only

Expand Down
6 changes: 3 additions & 3 deletions docs/resources/s3_bucket_server_side_encryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ description: |-

### Required

- `bucket` (String)
- `encryption_type` (String)
- `kms_key_id` (String)
- `bucket` (String) Name of the bucket on which to setup server side encryption
- `encryption_type` (String) Server side encryption type
- `kms_key_id` (String) KMS key id to use for server side encryption

### Read-Only

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/s3_bucket_versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ description: |-

### Required

- `bucket` (String)
- `bucket` (String) Name of the bucket
- `versioning_configuration` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--versioning_configuration))

### Read-Only
Expand Down
16 changes: 8 additions & 8 deletions docs/resources/s3_object.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ output "minio_id" {

### Required

- `bucket_name` (String)
- `object_name` (String)
- `bucket_name` (String) Name of the bucket
- `object_name` (String) Name of the object

### Optional

- `content` (String)
- `content_base64` (String)
- `content_type` (String)
- `etag` (String)
- `source` (String)
- `version_id` (String)
- `content` (String) Content of the object as a string. Use only one of content, content_base64, or source
- `content_base64` (String) Base64-encoded content of the object. Use only one of content, content_base64, or source
- `content_type` (String) Content type of the object, in the form of a MIME type
- `etag` (String) ETag of the object
- `source` (String) Path to the file that will be uploaded. Use only one of content, content_base64, or source
- `version_id` (String) Version ID of the object

### Read-Only

Expand Down
4 changes: 4 additions & 0 deletions examples/data-sources/minio_s3_object/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "minio_s3_object" "document" {
object_name = "document.txt"
bucket_name = "documents-bucket"
}
10 changes: 6 additions & 4 deletions minio/resource_minio_iam_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,26 @@ func resourceMinioIAMGroup() *schema.Resource {
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Description: "Name of the group",
Required: true,
ValidateFunc: validateMinioIamGroupName,
},
"force_destroy": {
Type: schema.TypeBool,
Description: "Delete group even if it has non-Terraform-managed members",
Optional: true,
Default: false,
Description: "Delete group even if it has non-Terraform-managed members",
},
"group_name": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Description: "The name of the group.",
Computed: true,
},
"disable_group": {
Type: schema.TypeBool,
Description: "Disable group",
Optional: true,
Default: false,
Description: "Disable group",
},
},
}
Expand Down
6 changes: 3 additions & 3 deletions minio/resource_minio_iam_group_membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ func resourceMinioIAMGroupMembership() *schema.Resource {
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Description: "Name of group membership",
Required: true,
ForceNew: true,
Description: "Name of group membership",
},
"users": {
Type: schema.TypeSet,
Required: true,
Description: "Add user or list of users such as a group membership",
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
Description: "Add user or list of users such as a group membership",
},
"group": {
Type: schema.TypeString,
Description: "Group name to add users",
Required: true,
ForceNew: true,
Description: "Group name to add users",
},
},
}
Expand Down
Loading

0 comments on commit c2eeaf9

Please sign in to comment.