-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
aws_s3_bucket cross-region-replication and versioning sub-resources don't seem to execute in order #828
Comments
I get this issue intermittently as well. However, rerunning the terraform does fix it. Still very annoying though. Would be really nice if the replication setting would just would wait for the versioning to be turned on. |
I just hit this while testing #6095: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSS3Bucket_ReplicationSchemaV2'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAWSS3Bucket_ReplicationSchemaV2 -timeout 120m
=== RUN TestAccAWSS3Bucket_ReplicationSchemaV2
--- FAIL: TestAccAWSS3Bucket_ReplicationSchemaV2 (32.31s)
testing.go:527: Step 0 error: Error applying: 1 error occurred:
* aws_s3_bucket.bucket: 1 error occurred:
* aws_s3_bucket.bucket: Error putting S3 replication configuration: InvalidRequest: Versioning must be 'Enabled' on the bucket to apply a replication configuration
status code: 400, request id: 8CF0FE0EEAFE0E05, host id: pQai/yi7xYb/qyD1h0OJ2m3d/BX7xjsoNdROYb2VaBTVVokD1UjUUtQVZjTJY9STTjF9VNpRzYI=
FAIL
FAIL github.com/terraform-providers/terraform-provider-aws/aws 32.329s
GNUmakefile:20: recipe for target 'testacc' failed
make: *** [testacc] Error 1 I can change the call to |
The above mentioned fix has been merged and will release with version 1.42.0 of the AWS provider, likely later today. 👍 |
👍 |
This has been released in version 1.42.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
This issue was originally opened by @silvermy as hashicorp/terraform#15093. It was migrated here as part of the provider split. The original body of the issue is below.
Terraform version: 0.9.6
When a
aws_s3_bucket
resource containing bothversioning=true
and cross-region-replication, one would expect versioning to be turned on first, as that is a requirement for cross-region-replication.But, it seems there is a "race condition" of some sort that occasionally leads to the opposite happening, in which case an error is generated saying that cross-region-replication cannot be turned on due to lack of versioning.
Re-running terraform apply does not seem to fix things. Also, the state file seems to believe that the cross-region-replication part has already been completed. The only way we could get things to work was to turn on versioning manually in the console, then remove the
replication.*
attributes from the bucket resource in the state file, then rerunapply
.The text was updated successfully, but these errors were encountered: