Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Descriptions storage bucket object #6638

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/3672.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
91 changes: 53 additions & 38 deletions google/resource_storage_bucket_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,46 +25,53 @@ func resourceStorageBucketObject() *schema.Resource {

Schema: map[string]*schema.Schema{
"bucket": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: `The name of the containing bucket.`,
},

"name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: `The name of the object. If you're interpolating the name of this object, see output_name instead.`,
},

"cache_control": {
Type: schema.TypeString,
ForceNew: true,
Optional: true,
Type: schema.TypeString,
ForceNew: true,
Optional: true,
Description: `Cache-Control directive to specify caching behavior of object data. If omitted and object is accessible to all anonymous users, the default will be public, max-age=3600`,
},

"content_disposition": {
Type: schema.TypeString,
ForceNew: true,
Optional: true,
Type: schema.TypeString,
ForceNew: true,
Optional: true,
Description: `Content-Disposition of the object data.`,
},

"content_encoding": {
Type: schema.TypeString,
ForceNew: true,
Optional: true,
Type: schema.TypeString,
ForceNew: true,
Optional: true,
Description: `Content-Encoding of the object data.`,
},

"content_language": {
Type: schema.TypeString,
ForceNew: true,
Optional: true,
Type: schema.TypeString,
ForceNew: true,
Optional: true,
Description: `Content-Language of the object data.`,
},

"content_type": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
Description: `Content-Type of the object data. Defaults to "application/octet-stream" or "text/plain; charset=utf-8".`,
},

"content": {
Expand All @@ -73,23 +80,27 @@ func resourceStorageBucketObject() *schema.Resource {
ForceNew: true,
ConflictsWith: []string{"source"},
Sensitive: true,
Description: `Data as string to be uploaded. Must be defined if source is not. Note: The content field is marked as sensitive. To view the raw contents of the object, please define an output.`,
},

"crc32c": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: `Base 64 CRC32 hash of the uploaded data.`,
},

"md5hash": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: `Base 64 MD5 hash of the uploaded data.`,
},

"source": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ConflictsWith: []string{"content"},
Description: `A path to the data you want to upload. Must be defined if content is not.`,
},

// Detect changes to local file or changes made outside of Terraform to the file stored on the server.
Expand Down Expand Up @@ -133,28 +144,32 @@ func resourceStorageBucketObject() *schema.Resource {
},

"storage_class": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
Description: `The StorageClass of the new bucket object. Supported values include: MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE. If not provided, this defaults to the bucket's default storage class or to a standard class.`,
},

"metadata": {
Type: schema.TypeMap,
Optional: true,
ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString},
Type: schema.TypeMap,
Optional: true,
ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString},
Description: `User-provided metadata, in key/value pairs.`,
},

"self_link": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: `A url reference to this object.`,
},

// https://github.com/hashicorp/terraform/issues/19052
"output_name": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: `The name of the object. Use this field in interpolations with google_storage_object_acl to recreate google_storage_object_acl resources when your google_storage_bucket_object is recreated.`,
},
},
}
Expand Down