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

provider/aws: Fix cause error when re-apply specified together etag and kms_key_id #9168

Merged
merged 1 commit into from
Oct 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions builtin/providers/aws/resource_aws_s3_bucket_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ func resourceAwsS3BucketObject() *schema.Resource {
// This will conflict with SSE-C and SSE-KMS encryption and multi-part upload
// if/when it's actually implemented. The Etag then won't match raw-file MD5.
// See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html
Optional: true,
Computed: true,
Optional: true,
Computed: true,
ConflictsWith: []string{"kms_key_id"},
},

"version_id": &schema.Schema{
Expand Down Expand Up @@ -135,12 +136,6 @@ func resourceAwsS3BucketObjectPut(d *schema.ResourceData, meta interface{}) erro
return fmt.Errorf("Must specify \"source\" or \"content\" field")
}

if _, ok := d.GetOk("kms_key_id"); ok {
if _, ok := d.GetOk("etag"); ok {
return fmt.Errorf("Unable to specify 'kms_key_id' and 'etag' together because 'etag' wouldn't equal the MD5 digest of the raw object data")
}
}

bucket := d.Get("bucket").(string)
key := d.Get("key").(string)

Expand Down