diff --git a/builtin/providers/aws/resource_aws_s3_bucket_object.go b/builtin/providers/aws/resource_aws_s3_bucket_object.go index 8a2e8370b07f..3a4cc4df25e9 100644 --- a/builtin/providers/aws/resource_aws_s3_bucket_object.go +++ b/builtin/providers/aws/resource_aws_s3_bucket_object.go @@ -1,11 +1,11 @@ package aws import ( + "bytes" "fmt" + "io" "log" "os" - "io" - "bytes" "github.com/hashicorp/terraform/helper/schema" @@ -35,18 +35,18 @@ func resourceAwsS3BucketObject() *schema.Resource { }, "source": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + ForceNew: true, ConflictsWith: []string{"content"}, }, - "content": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, + "content": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, ConflictsWith: []string{"source"}, - }, + }, "etag": &schema.Schema{ Type: schema.TypeString, @@ -138,3 +138,4 @@ func resourceAwsS3BucketObjectDelete(d *schema.ResourceData, meta interface{}) e } return nil } + diff --git a/builtin/providers/aws/resource_aws_s3_bucket_object_test.go b/builtin/providers/aws/resource_aws_s3_bucket_object_test.go index 6311dd7c328a..0e0651ad00b9 100644 --- a/builtin/providers/aws/resource_aws_s3_bucket_object_test.go +++ b/builtin/providers/aws/resource_aws_s3_bucket_object_test.go @@ -107,22 +107,19 @@ func testAccCheckAWSS3BucketObjectExists(n string) resource.TestCheckFunc { var randomBucket = randInt var testAccAWSS3BucketObjectConfigSource = fmt.Sprintf(` resource "aws_s3_bucket" "object_bucket" { - bucket = "tf-object-test-bucket-%d" + bucket = "tf-object-test-bucket-%d" } - resource "aws_s3_bucket_object" "object" { - bucket = "${aws_s3_bucket.object_bucket.bucket}" - key = "test-key" - source = "%s" + bucket = "${aws_s3_bucket.object_bucket.bucket}" + key = "test-key" + source = "%s" } `, randomBucket, tf.Name()) - var testAccAWSS3BucketObjectConfigContent = fmt.Sprintf(` resource "aws_s3_bucket" "object_bucket" { bucket = "tf-object-test-bucket-%d" } - resource "aws_s3_bucket_object" "object" { bucket = "${aws_s3_bucket.object_bucket.bucket}" key = "test-key"