-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: Adding some other simple S3 Bucket Object (Optional) Inputs #3265
Conversation
@catsby while you are on a merging spree, this one should be a pretty simple addition :) It just adds support for some more pieces of the S3 puzzle |
* `content_disposition` - (Optional) Specifies presentational information for the object. | ||
* `content_encoding` - (Optional) Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. | ||
* `content_language` - (Optional) The language the content is in. | ||
* `content_type` - (Optional) A standard MIME type describing the format of the object data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we throw in a few examples of these? e.g. for cache_control
, two examples would be no-cache
, or max-age=3000
? Is the max-age=3000
even valid? Some guidance would help people (like myself...) on how to use it correctly
…ecking for an empty string in the new S3 bucket object params
@catsby thanks for reviewing this. I have added links to the correct sections of w3c docs for some of the more complex documentation (e.g. cache_control and content_disposition) and then added some samples for content_type and content_language Also changed the PutObject input to check for empty strings before adding to the struct |
…er but seems to be broken in my branch
…en changing the params
@catsby ok, I have added some explanations here and changed to support the empty string checks FYI, master had removed the Update method and 'Forced New' on everything. So I was getting this error:
By making the same changes to my code, the world was a better place :) I think this may be ready for you now |
"content_type": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Optional: true, | ||
ForceNew: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like at least this one needs to be computed
as well, I'm getting a plan loop with this config:
provider "aws" {
region = "us-west-2"
}
resource "aws_s3_bucket" "object_bucket" {
bucket = "tf-object-test-bucket-1234"
}
resource "aws_s3_bucket_object" "object" {
bucket = "${aws_s3_bucket.object_bucket.bucket}"
key = "test-key"
source = "terraform.tfstate"
}
~ aws_s3_bucket_object.object
content_type: "binary/octet-stream" => ""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@catsby can a param be both Optional and Computed?
One final bit and we're good to go |
…f whether you set a content-type, AWS will always set a content-type
@catsby we are good with this now :) |
…ther PR had been merged
Thanks @stack72 ! |
provider/aws: Adding some other simple S3 Bucket Object (Optional) Inputs
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Added the following to the S3 Bucket Object:
Tests pass as expected: