diff --git a/docs/data-sources/s3_object.md b/docs/data-sources/s3_object.md new file mode 100644 index 00000000..58c03b53 --- /dev/null +++ b/docs/data-sources/s3_object.md @@ -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 + +### 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 diff --git a/docs/resources/iam_group.md b/docs/resources/iam_group.md index 8f0e3325..a80eafed 100644 --- a/docs/resources/iam_group.md +++ b/docs/resources/iam_group.md @@ -27,7 +27,7 @@ output "minio_user_group" { ### Required -- `name` (String) +- `name` (String) Name of the group ### Optional @@ -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. diff --git a/docs/resources/iam_group_membership.md b/docs/resources/iam_group_membership.md index 6d361acf..affec0e7 100644 --- a/docs/resources/iam_group_membership.md +++ b/docs/resources/iam_group_membership.md @@ -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 diff --git a/docs/resources/iam_group_policy.md b/docs/resources/iam_group_policy.md index 843c46e0..1191e2fb 100644 --- a/docs/resources/iam_group_policy.md +++ b/docs/resources/iam_group_policy.md @@ -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 diff --git a/docs/resources/iam_group_policy_attachment.md b/docs/resources/iam_group_policy_attachment.md index 4c9d959c..83fa47c8 100644 --- a/docs/resources/iam_group_policy_attachment.md +++ b/docs/resources/iam_group_policy_attachment.md @@ -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}" } ``` @@ -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 diff --git a/docs/resources/iam_group_user_attachment.md b/docs/resources/iam_group_user_attachment.md index 68aac63a..ce63baeb 100644 --- a/docs/resources/iam_group_user_attachment.md +++ b/docs/resources/iam_group_user_attachment.md @@ -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 diff --git a/docs/resources/iam_policy.md b/docs/resources/iam_policy.md index b7a83ccd..defa68b7 100644 --- a/docs/resources/iam_policy.md +++ b/docs/resources/iam_policy.md @@ -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 diff --git a/docs/resources/iam_service_account.md b/docs/resources/iam_service_account.md index 0d05268d..619cc394 100644 --- a/docs/resources/iam_service_account.md +++ b/docs/resources/iam_service_account.md @@ -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) diff --git a/docs/resources/iam_user.md b/docs/resources/iam_user.md index 33ca338d..b6dade78 100644 --- a/docs/resources/iam_user.md +++ b/docs/resources/iam_user.md @@ -39,7 +39,7 @@ output "secret" { ### Required -- `name` (String) +- `name` (String) Name of the user ### Optional diff --git a/docs/resources/iam_user_policy_attachment.md b/docs/resources/iam_user_policy_attachment.md index 97879946..0fff02bd 100644 --- a/docs/resources/iam_user_policy_attachment.md +++ b/docs/resources/iam_user_policy_attachment.md @@ -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 diff --git a/docs/resources/kms_key.md b/docs/resources/kms_key.md index ff81840e..46da5121 100644 --- a/docs/resources/kms_key.md +++ b/docs/resources/kms_key.md @@ -17,7 +17,7 @@ description: |- ### Required -- `key_id` (String) +- `key_id` (String) KMS key ID ### Read-Only diff --git a/docs/resources/s3_bucket.md b/docs/resources/s3_bucket.md index 207b2d87..ff92f416 100644 --- a/docs/resources/s3_bucket.md +++ b/docs/resources/s3_bucket.md @@ -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. diff --git a/docs/resources/s3_bucket_notification.md b/docs/resources/s3_bucket_notification.md index 90854a47..5e05e8e1 100644 --- a/docs/resources/s3_bucket_notification.md +++ b/docs/resources/s3_bucket_notification.md @@ -39,7 +39,4 @@ Optional: - `filter_prefix` (String) - `filter_suffix` (String) - -Read-Only: - -- `id` (String) The ID of this resource. +- `id` (String) diff --git a/docs/resources/s3_bucket_policy.md b/docs/resources/s3_bucket_policy.md index e4ed604f..a2c1c859 100644 --- a/docs/resources/s3_bucket_policy.md +++ b/docs/resources/s3_bucket_policy.md @@ -17,8 +17,8 @@ description: |- ### Required -- `bucket` (String) -- `policy` (String) +- `bucket` (String) Name of the bucket +- `policy` (String) Policy JSON string ### Read-Only diff --git a/docs/resources/s3_bucket_server_side_encryption.md b/docs/resources/s3_bucket_server_side_encryption.md index d4fc4f19..27f023b9 100644 --- a/docs/resources/s3_bucket_server_side_encryption.md +++ b/docs/resources/s3_bucket_server_side_encryption.md @@ -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 diff --git a/docs/resources/s3_bucket_versioning.md b/docs/resources/s3_bucket_versioning.md index 1d5a5ae8..b2d74986 100644 --- a/docs/resources/s3_bucket_versioning.md +++ b/docs/resources/s3_bucket_versioning.md @@ -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 diff --git a/docs/resources/s3_object.md b/docs/resources/s3_object.md index 5a9720ff..8d3b0507 100644 --- a/docs/resources/s3_object.md +++ b/docs/resources/s3_object.md @@ -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 diff --git a/examples/data-sources/minio_s3_object/data-source.tf b/examples/data-sources/minio_s3_object/data-source.tf new file mode 100644 index 00000000..af568a0e --- /dev/null +++ b/examples/data-sources/minio_s3_object/data-source.tf @@ -0,0 +1,4 @@ +data "minio_s3_object" "document" { + object_name = "document.txt" + bucket_name = "documents-bucket" +} diff --git a/examples/resources/minio_iam_group_membership/resources.tf b/examples/resources/minio_iam_group_membership/resource.tf similarity index 100% rename from examples/resources/minio_iam_group_membership/resources.tf rename to examples/resources/minio_iam_group_membership/resource.tf diff --git a/minio/resource_minio_iam_group.go b/minio/resource_minio_iam_group.go index f8ba4da5..ee6539b1 100644 --- a/minio/resource_minio_iam_group.go +++ b/minio/resource_minio_iam_group.go @@ -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", }, }, } diff --git a/minio/resource_minio_iam_group_membership.go b/minio/resource_minio_iam_group_membership.go index 66582a6b..7411a5ae 100644 --- a/minio/resource_minio_iam_group_membership.go +++ b/minio/resource_minio_iam_group_membership.go @@ -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", }, }, } diff --git a/minio/resource_minio_iam_group_policy.go b/minio/resource_minio_iam_group_policy.go index b1fd6d4c..ef201921 100644 --- a/minio/resource_minio_iam_group_policy.go +++ b/minio/resource_minio_iam_group_policy.go @@ -24,12 +24,14 @@ func resourceMinioIAMGroupPolicy() *schema.Resource { Schema: map[string]*schema.Schema{ "policy": { Type: schema.TypeString, + Description: "Policy JSON string", Required: true, ValidateFunc: validateIAMPolicyJSON, DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, }, "name": { Type: schema.TypeString, + Description: "Name of the policy. If omitted, Terraform will assign a random, unique name.", Optional: true, Computed: true, ForceNew: true, @@ -38,15 +40,17 @@ func resourceMinioIAMGroupPolicy() *schema.Resource { }, "name_prefix": { Type: schema.TypeString, + Description: "Prefix to the generated policy name. Do not use with `name`.", Optional: true, ForceNew: true, ConflictsWith: []string{"name"}, ValidateFunc: validateIAMNamePolicy, }, "group": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Description: "Name of group the policy belongs to.", + Required: true, + ForceNew: true, }, }, } diff --git a/minio/resource_minio_iam_group_policy_attachment.go b/minio/resource_minio_iam_group_policy_attachment.go index a0376ff3..d417adc1 100644 --- a/minio/resource_minio_iam_group_policy_attachment.go +++ b/minio/resource_minio_iam_group_policy_attachment.go @@ -26,12 +26,14 @@ func resourceMinioIAMGroupPolicyAttachment() *schema.Resource { Schema: map[string]*schema.Schema{ "policy_name": { Type: schema.TypeString, + Description: "Name of policy to attach to group", Required: true, ForceNew: true, ValidateFunc: validateIAMNamePolicy, }, "group_name": { Type: schema.TypeString, + Description: "Name of group to attach policy to", Required: true, ForceNew: true, ValidateFunc: validateMinioIamGroupName, diff --git a/minio/resource_minio_iam_group_user_attachment.go b/minio/resource_minio_iam_group_user_attachment.go index ea7d1fa6..a6e88e5e 100644 --- a/minio/resource_minio_iam_group_user_attachment.go +++ b/minio/resource_minio_iam_group_user_attachment.go @@ -24,12 +24,14 @@ func resourceMinioIAMGroupUserAttachment() *schema.Resource { Schema: map[string]*schema.Schema{ "group_name": { Type: schema.TypeString, + Description: "Name of group to attach user to", Required: true, ForceNew: true, ValidateFunc: validateIAMNamePolicy, }, "user_name": { Type: schema.TypeString, + Description: "Name of user", Required: true, ForceNew: true, ValidateFunc: validateMinioIamUserName, diff --git a/minio/resource_minio_iam_policy.go b/minio/resource_minio_iam_policy.go index c015bbbf..6039a88a 100644 --- a/minio/resource_minio_iam_policy.go +++ b/minio/resource_minio_iam_policy.go @@ -4,11 +4,12 @@ import ( "context" "errors" "fmt" - "github.com/minio/madmin-go/v3" "log" "regexp" "strings" + "github.com/minio/madmin-go/v3" + "github.com/aws/aws-sdk-go/aws" awspolicy "github.com/hashicorp/awspolicyequivalence" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -30,12 +31,14 @@ func resourceMinioIAMPolicy() *schema.Resource { Schema: map[string]*schema.Schema{ "policy": { Type: schema.TypeString, + Description: "Policy JSON string", Required: true, ValidateFunc: validateIAMPolicyJSON, DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, }, "name": { Type: schema.TypeString, + Description: "Name of the policy. Conflicts with `name_prefix`.", Optional: true, Computed: true, ForceNew: true, @@ -44,6 +47,7 @@ func resourceMinioIAMPolicy() *schema.Resource { }, "name_prefix": { Type: schema.TypeString, + Description: "Prefix to the generated policy name. Do not use with `name`.", Optional: true, ForceNew: true, ConflictsWith: []string{"name"}, diff --git a/minio/resource_minio_iam_user.go b/minio/resource_minio_iam_user.go index cf960825..81f23658 100644 --- a/minio/resource_minio_iam_user.go +++ b/minio/resource_minio_iam_user.go @@ -32,27 +32,28 @@ func resourceMinioIAMUser() *schema.Resource { Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, + Description: "Name of the user", Required: true, ValidateFunc: validateMinioIamUserName, ForceNew: true, }, "force_destroy": { Type: schema.TypeBool, + Description: "Delete user even if it has non-Terraform-managed IAM access keys", Optional: true, Default: false, - Description: "Delete user even if it has non-Terraform-managed IAM access keys", }, "disable_user": { Type: schema.TypeBool, + Description: "Disable user", Optional: true, Default: false, - Description: "Disable user", }, "update_secret": { Type: schema.TypeBool, + Description: "Rotate Minio User Secret Key", Optional: true, Default: false, - Description: "Rotate Minio User Secret Key", }, "status": { Type: schema.TypeString, diff --git a/minio/resource_minio_iam_user_policy_attachment.go b/minio/resource_minio_iam_user_policy_attachment.go index e7d634d4..5b6d539b 100644 --- a/minio/resource_minio_iam_user_policy_attachment.go +++ b/minio/resource_minio_iam_user_policy_attachment.go @@ -26,12 +26,14 @@ func resourceMinioIAMUserPolicyAttachment() *schema.Resource { Schema: map[string]*schema.Schema{ "policy_name": { Type: schema.TypeString, + Description: "Name of policy to attach to user", Required: true, ForceNew: true, ValidateFunc: validateIAMNamePolicy, }, "user_name": { Type: schema.TypeString, + Description: "Name of user", Required: true, ForceNew: true, ValidateFunc: validateMinioIamUserName, diff --git a/minio/resource_minio_kms_key.go b/minio/resource_minio_kms_key.go index ed4a14bd..685a6af8 100644 --- a/minio/resource_minio_kms_key.go +++ b/minio/resource_minio_kms_key.go @@ -21,9 +21,10 @@ func resourceMinioKMSKey() *schema.Resource { Schema: map[string]*schema.Schema{ "key_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Description: "KMS key ID", + Required: true, + ForceNew: true, }, }, } diff --git a/minio/resource_minio_s3_bucket.go b/minio/resource_minio_s3_bucket.go index 637d5cb6..1cc72f8f 100644 --- a/minio/resource_minio_s3_bucket.go +++ b/minio/resource_minio_s3_bucket.go @@ -65,16 +65,19 @@ func resourceMinioBucket() *schema.Resource { ForceNew: false, }, "arn": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "ARN of the bucket", + Computed: true, }, "bucket_domain_name": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "The bucket domain name", + Computed: true, }, "quota": { - Type: schema.TypeInt, - Optional: true, + Type: schema.TypeInt, + Description: "Quota of the bucket", + Optional: true, }, "object_locking": { Type: schema.TypeBool, diff --git a/minio/resource_minio_s3_bucket_policy.go b/minio/resource_minio_s3_bucket_policy.go index 2ca8b7e8..71d23cee 100644 --- a/minio/resource_minio_s3_bucket_policy.go +++ b/minio/resource_minio_s3_bucket_policy.go @@ -22,12 +22,14 @@ func resourceMinioBucketPolicy() *schema.Resource { }, Schema: map[string]*schema.Schema{ "bucket": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Description: "Name of the bucket", + Required: true, + ForceNew: true, }, "policy": { Type: schema.TypeString, + Description: "Policy JSON string", Required: true, ValidateFunc: validateIAMPolicyJSON, DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, diff --git a/minio/resource_minio_s3_bucket_replication.go b/minio/resource_minio_s3_bucket_replication.go index 3eb09e73..c7e0457a 100644 --- a/minio/resource_minio_s3_bucket_replication.go +++ b/minio/resource_minio_s3_bucket_replication.go @@ -37,34 +37,35 @@ func resourceMinioBucketReplication() *schema.Resource { Schema: map[string]*schema.Schema{ "bucket": { Type: schema.TypeString, + Description: "Name of the bucket on which to setup replication rules", Required: true, ForceNew: true, - Description: "Name of the bucket on which to setup replication rules", }, "rule": { Type: schema.TypeList, - Optional: true, Description: "Rule definitions", + Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { Type: schema.TypeString, - Computed: true, Description: "Rule ID generated by MinIO", + Computed: true, }, "arn": { Type: schema.TypeString, - Computed: true, Description: "Rule ARN genrated by MinIO", + Computed: true, }, "enabled": { Type: schema.TypeBool, + Description: "Whether or not this rule is enabled", Optional: true, Default: true, - Description: "Whether or not this rule is enabled", }, "priority": { Type: schema.TypeInt, + Description: "Rule priority. If omitted, the inverted index will be used as priority. This means that the first rule definition will have the higher priority", Optional: true, ValidateFunc: validation.IntAtLeast(1), DiffSuppressFunc: func(k, oldValue, newValue string, d *schema.ResourceData) bool { @@ -72,113 +73,113 @@ func resourceMinioBucketReplication() *schema.Resource { newVal, _ := strconv.Atoi(newValue) return oldVal == 0 && newVal == 0 || oldVal == newVal }, - Description: "Rule priority. If omitted, the inverted index will be used as priority. This means that the first rule definition will have the higher priority", }, "prefix": { Type: schema.TypeString, + Description: "Bucket prefix object must be in to be syncronised", Optional: true, Default: "", - Description: "Bucket prefix object must be in to be syncronised", }, "tags": { - Type: schema.TypeMap, - Optional: true, + Type: schema.TypeMap, + Description: "Tags which objects must have to be syncronised", + Optional: true, ValidateDiagFunc: validation.AllDiag( validation.MapValueMatch(regexp.MustCompile(`^[a-zA-Z0-9-+\-._:/@ ]+$`), ""), validation.MapKeyMatch(regexp.MustCompile(`^[a-zA-Z0-9-+\-._:/@ ]+$`), ""), validation.MapValueLenBetween(1, 256), validation.MapKeyLenBetween(1, 128), ), - Description: "Tags which objects must have to be syncronised", }, "delete_replication": { Type: schema.TypeBool, - Optional: true, Description: "Whether or not to propagate deletion", + Optional: true, }, "delete_marker_replication": { Type: schema.TypeBool, - Optional: true, Description: "Whether or not to synchronise marker deletion", + Optional: true, }, "existing_object_replication": { Type: schema.TypeBool, - Optional: true, Description: "Whether or not to synchronise object created prior the replication configuration", + Optional: true, }, "metadata_sync": { Type: schema.TypeBool, - Optional: true, Description: "Whether or not to synchonise buckets and objects metadata (such as locks). This must be enabled to achieve a two-way replication", + Optional: true, }, "target": { Type: schema.TypeList, + Description: "Bucket prefix", MinItems: 1, MaxItems: 1, Required: true, - Description: "Bucket prefix", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "bucket": { Type: schema.TypeString, - Required: true, Description: "The name of the existing target bucket to replicate into", + Required: true, }, "storage_class": { Type: schema.TypeString, - Optional: true, Description: "The storage class to use for the object on this target", + Optional: true, }, "host": { Type: schema.TypeString, - Required: true, Description: "The target host (pair IP/port or domain port). If port is omitted, HTTPS port (or HTTP if unsecure) will be used. This host must be reachable by the MinIO instance itself", + Required: true, }, "secure": { Type: schema.TypeBool, + Description: "Whether to use HTTPS with this target (Recommended). Note that disabling HTTPS will yield Terraform warning for security reason`", Optional: true, Default: true, - Description: "Whether to use HTTPS with this target (Recommended). Note that disabling HTTPS will yield Terraform warning for security reason`", }, "path_style": { Type: schema.TypeString, + Description: "Whether to use path-style or virtual-hosted-syle request to this target (https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#path-style-access). `auto` allows MinIO to chose automatically the appropriate option (Recommened)`", Optional: true, Default: "auto", ValidateFunc: validation.StringInSlice([]string{"on", "off", "auto"}, true), - Description: "Whether to use path-style or virtual-hosted-syle request to this target (https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#path-style-access). `auto` allows MinIO to chose automatically the appropriate option (Recommened)`", }, "path": { Type: schema.TypeString, - Optional: true, Description: "Path of the Minio endpoint. This is usefull if MinIO API isn't served on at the root, e.g for `example.com/minio/`, the path would be `/minio/`", + Optional: true, }, "syncronous": { Type: schema.TypeBool, + Description: "Use synchronous replication.", Optional: true, Default: false, - Description: "Use synchronous replication.", }, "disable_proxy": { Type: schema.TypeBool, + Description: "Disable proxy for this target", Optional: true, Default: false, - Description: "Disable proxy for this target", }, "health_check_period": { - Type: schema.TypeString, - Optional: true, - Default: "30s", + Type: schema.TypeString, + Description: "Period where the health of this target will be checked. This must be a valid duration, such as `5s` or `2m`", + Optional: true, + Default: "30s", DiffSuppressFunc: func(k, oldValue, newValue string, d *schema.ResourceData) bool { newVal, err := time.ParseDuration(newValue) return err == nil && shortDur(newVal) == oldValue }, ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[0-9]+\s?[s|m|h]$`), "must be a valid golang duration"), - Description: "Period where the health of this target will be checked. This must be a valid duration, such as `5s` or `2m`", }, "bandwidth_limt": { - Type: schema.TypeString, - Optional: true, - Default: "0", + Type: schema.TypeString, + Description: "Maximum bandwidth in byte per second that MinIO can used when syncronysing this target. Minimum is 100MB", + Optional: true, + Default: "0", DiffSuppressFunc: func(k, oldValue, newValue string, d *schema.ResourceData) bool { newVal, err := humanize.ParseBytes(newValue) return err == nil && humanize.Bytes(newVal) == oldValue @@ -214,25 +215,24 @@ func resourceMinioBucketReplication() *schema.Resource { } return }, - Description: "Maximum bandwidth in byte per second that MinIO can used when syncronysing this target. Minimum is 100MB", }, "region": { Type: schema.TypeString, - Optional: true, Description: "Region of the target MinIO. This will be used to generate the target ARN", + Optional: true, }, "access_key": { Type: schema.TypeString, + Description: "Access key for the replication service account in the target MinIO", Required: true, ValidateFunc: validation.StringIsNotEmpty, - Description: "Access key for the replication service account in the target MinIO", }, "secret_key": { Type: schema.TypeString, + Description: "Secret key for the replication service account in the target MinIO. This is optional so it can be imported but prevent secret update", Optional: true, Sensitive: true, ValidateFunc: validation.StringIsNotEmpty, - Description: "Secret key for the replication service account in the target MinIO. This is optional so it can be imported but prevent secret update", }, }, }, diff --git a/minio/resource_minio_s3_bucket_server_side_encryption_configuration.go b/minio/resource_minio_s3_bucket_server_side_encryption_configuration.go index 841eff23..221ac2fa 100644 --- a/minio/resource_minio_s3_bucket_server_side_encryption_configuration.go +++ b/minio/resource_minio_s3_bucket_server_side_encryption_configuration.go @@ -23,18 +23,21 @@ func resourceMinioBucketServerSideEncryption() *schema.Resource { Schema: map[string]*schema.Schema{ "bucket": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Description: "Name of the bucket on which to setup server side encryption", + Required: true, + ForceNew: true, }, "encryption_type": { Type: schema.TypeString, + Description: "Server side encryption type", Required: true, ValidateFunc: validation.StringInSlice([]string{"aws:kms"}, false), }, "kms_key_id": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Description: "KMS key id to use for server side encryption", + Required: true, }, }, } diff --git a/minio/resource_minio_s3_bucket_versioning.go b/minio/resource_minio_s3_bucket_versioning.go index 3d060242..2b542ea1 100644 --- a/minio/resource_minio_s3_bucket_versioning.go +++ b/minio/resource_minio_s3_bucket_versioning.go @@ -22,9 +22,10 @@ func resourceMinioBucketVersioning() *schema.Resource { }, Schema: map[string]*schema.Schema{ "bucket": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Description: "Name of the bucket", + Required: true, + ForceNew: true, }, "versioning_configuration": { Type: schema.TypeList, diff --git a/minio/resource_minio_s3_object.go b/minio/resource_minio_s3_object.go index 340bb791..6573b912 100644 --- a/minio/resource_minio_s3_object.go +++ b/minio/resource_minio_s3_object.go @@ -67,14 +67,16 @@ func resourceMinioObject() *schema.Resource { ConflictsWith: []string{"source", "content"}, }, "etag": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Type: schema.TypeString, + Description: "ETag of the object", + Optional: true, + Computed: true, }, "version_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Type: schema.TypeString, + Description: "Version ID of the object", + Optional: true, + Computed: true, }, }, } diff --git a/minio/resource_minio_service_account.go b/minio/resource_minio_service_account.go index a39f6483..13a0790f 100644 --- a/minio/resource_minio_service_account.go +++ b/minio/resource_minio_service_account.go @@ -24,41 +24,44 @@ func resourceMinioServiceAccount() *schema.Resource { Schema: map[string]*schema.Schema{ "target_user": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Description: "User the service account will be created for", + Required: true, + ForceNew: true, }, "disable_user": { Type: schema.TypeBool, + Description: "Disable service account", Optional: true, Default: false, - Description: "Disable service account", }, "update_secret": { Type: schema.TypeBool, + Description: "rotate secret key", Optional: true, Default: false, - Description: "rotate secret key", }, "status": { Type: schema.TypeString, Computed: true, }, "secret_key": { - Type: schema.TypeString, - Computed: true, - Sensitive: true, + Type: schema.TypeString, + Description: "secret key of service account", + Computed: true, + Sensitive: true, }, "access_key": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Description: "access key of service account", + Computed: true, }, "policy": { Type: schema.TypeString, + Description: "policy of service account as encoded JSON string", Optional: true, ValidateFunc: validateIAMPolicyJSON, DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, - Description: "policy of service account", }, }, }