Skip to content

Commit

Permalink
Improve documentation of a handful of resources (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzofelletti authored Jul 14, 2024
1 parent 4febb79 commit a6a57d7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
4 changes: 2 additions & 2 deletions minio/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func newProvider(envvarPrefixed ...string) *schema.Provider {
"minio_user": {
Type: schema.TypeString,
Optional: true,
Description: "Minio User",
Description: "Minio User (or access key)",
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
envVarPrefix + "MINIO_USER",
}, nil),
Expand All @@ -63,7 +63,7 @@ func newProvider(envvarPrefixed ...string) *schema.Provider {
"minio_password": {
Type: schema.TypeString,
Optional: true,
Description: "Minio Password",
Description: "Minio Password (or secret key)",
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
envVarPrefix + "MINIO_PASSWORD",
}, nil),
Expand Down
27 changes: 16 additions & 11 deletions minio/resource_minio_s3_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func resourceMinioBucket() *schema.Resource {
Schema: map[string]*schema.Schema{
"bucket": {
Type: schema.TypeString,
Description: "Name of the bucket",
Optional: true,
Computed: true,
ForceNew: true,
Expand All @@ -44,21 +45,24 @@ func resourceMinioBucket() *schema.Resource {
},
"bucket_prefix": {
Type: schema.TypeString,
Description: "Prefix of the bucket",
Optional: true,
ForceNew: true,
ConflictsWith: []string{"bucket"},
ValidateFunc: validation.StringLenBetween(0, 63-id.UniqueIDSuffixLength),
},
"force_destroy": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Type: schema.TypeBool,
Description: "Force destroy the bucket (default: false)",
Optional: true,
Default: false,
},
"acl": {
Type: schema.TypeString,
Optional: true,
Default: "private",
ForceNew: false,
Type: schema.TypeString,
Description: "Bucket's Access Control List (default: private)",
Optional: true,
Default: "private",
ForceNew: false,
},
"arn": {
Type: schema.TypeString,
Expand All @@ -73,10 +77,11 @@ func resourceMinioBucket() *schema.Resource {
Optional: true,
},
"object_locking": {
Type: schema.TypeBool,
Optional: true,
Default: false,
ForceNew: false,
Type: schema.TypeBool,
Description: "Enable object locking for the bucket (default: false)",
Optional: true,
Default: false,
ForceNew: false,
},
},
}
Expand Down
13 changes: 9 additions & 4 deletions minio/resource_minio_s3_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,39 @@ func resourceMinioObject() *schema.Resource {
Schema: map[string]*schema.Schema{
"bucket_name": {
Type: schema.TypeString,
Description: "Name of the bucket",
Required: true,
ForceNew: true,
ValidateFunc: validation.NoZeroValues,
},
"object_name": {
Type: schema.TypeString,
Description: "Name of the object",
Required: true,
ForceNew: true,
ValidateFunc: validation.NoZeroValues,
},
"content_type": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Type: schema.TypeString,
Description: "Content type of the object, in the form of a MIME type",
Optional: true,
Computed: true,
},
"source": {
Type: schema.TypeString,
Description: "Path to the file that will be uploaded. Use only one of content, content_base64, or source",
Optional: true,
ConflictsWith: []string{"content", "content_base64"},
},
"content": {
Type: schema.TypeString,
Description: "Content of the object as a string. Use only one of content, content_base64, or source",
Optional: true,
ConflictsWith: []string{"source", "content_base64"},
},
"content_base64": {
Type: schema.TypeString,
Description: "Base64-encoded content of the object. Use only one of content, content_base64, or source",
Optional: true,
ConflictsWith: []string{"source", "content"},
},
Expand All @@ -71,7 +77,6 @@ func resourceMinioObject() *schema.Resource {
Computed: true,
},
},
//CustomizeDiff: customDiff,
}
}

Expand Down

0 comments on commit a6a57d7

Please sign in to comment.