Skip to content

Commit

Permalink
Make use of ComputedWhen in aws_s3_bucket_object
Browse files Browse the repository at this point in the history
  • Loading branch information
Radek Simko authored and radeksimko committed Mar 13, 2016
1 parent 71fca46 commit 341c294
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 0 additions & 6 deletions builtin/providers/aws/resource_aws_lambda_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,11 @@ func TestAccAWSLambdaFunction_s3Update(t *testing.T) {
),
},
resource.TestStep{
ExpectNonEmptyPlan: true,
PreConfig: func() {
// Upload 2nd version
testAccCreateZipFromFiles(map[string]string{"test-fixtures/lambda_func_modified.js": "lambda.js"}, zipFile)
},
Config: genAWSLambdaFunctionConfig_s3(bucketName, key, path),
},
// Extra step because of missing ComputedWhen
// See https://github.com/hashicorp/terraform/pull/4846 & https://github.com/hashicorp/terraform/pull/5330
resource.TestStep{
Config: genAWSLambdaFunctionConfig_s3(bucketName, key, path),
Check: resource.ComposeTestCheckFunc(
testAccCheckAwsLambdaFunctionExists("aws_lambda_function.lambda_function_s3", "tf_acc_lambda_name_s3", &conf),
testAccCheckAwsLambdaFunctionName(&conf, "tf_acc_lambda_name_s3"),
Expand Down
5 changes: 3 additions & 2 deletions builtin/providers/aws/resource_aws_s3_bucket_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ func resourceAwsS3BucketObject() *schema.Resource {
},

"version_id": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
ComputedWhen: []string{"etag", "source", "content"},
},
},
}
Expand Down

0 comments on commit 341c294

Please sign in to comment.