File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -512,8 +512,16 @@ resource "aws_s3_bucket_replication_configuration" "this" {
512
512
resource "aws_s3_bucket_policy" "this" {
513
513
count = local. create_bucket && local. attach_policy ? 1 : 0
514
514
515
+ # Chain resources (s3_bucket -> s3_bucket_public_access_block -> s3_bucket_policy )
516
+ # to prevent "A conflicting conditional operation is currently in progress against this resource."
517
+ # Ref: https://github.com/hashicorp/terraform-provider-aws/issues/7628
518
+
515
519
bucket = aws_s3_bucket. this [0 ]. id
516
520
policy = data. aws_iam_policy_document . combined [0 ]. json
521
+
522
+ depends_on = [
523
+ aws_s3_bucket_public_access_block . this
524
+ ]
517
525
}
518
526
519
527
data "aws_iam_policy_document" "combined" {
@@ -789,11 +797,7 @@ data "aws_iam_policy_document" "require_latest_tls" {
789
797
resource "aws_s3_bucket_public_access_block" "this" {
790
798
count = local. create_bucket && var. attach_public_policy ? 1 : 0
791
799
792
- # Chain resources (s3_bucket -> s3_bucket_policy -> s3_bucket_public_access_block)
793
- # to prevent "A conflicting conditional operation is currently in progress against this resource."
794
- # Ref: https://github.com/hashicorp/terraform-provider-aws/issues/7628
795
-
796
- bucket = local. attach_policy ? aws_s3_bucket_policy. this [0 ]. id : aws_s3_bucket. this [0 ]. id
800
+ bucket = aws_s3_bucket. this [0 ]. id
797
801
798
802
block_public_acls = var. block_public_acls
799
803
block_public_policy = var. block_public_policy
You can’t perform that action at this time.
0 commit comments