@@ -93,6 +93,9 @@ resource "aws_s3_bucket" "this" {
93
93
resource "aws_s3_bucket_acl" "this" {
94
94
bucket = aws_s3_bucket. this . id
95
95
acl = " private"
96
+ depends_on = [
97
+ aws_s3_bucket . this
98
+ ]
96
99
}
97
100
98
101
resource "aws_s3_bucket_ownership_controls" "this" {
@@ -101,6 +104,10 @@ resource "aws_s3_bucket_ownership_controls" "this" {
101
104
rule {
102
105
object_ownership = " BucketOwnerEnforced"
103
106
}
107
+ depends_on = [
108
+ aws_s3_bucket . this ,
109
+ aws_s3_bucket_acl . this
110
+ ]
104
111
}
105
112
106
113
resource "aws_s3_bucket_server_side_encryption_configuration" "this" {
@@ -111,6 +118,11 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "this" {
111
118
sse_algorithm = " AES256"
112
119
}
113
120
}
121
+ depends_on = [
122
+ aws_s3_bucket . this ,
123
+ aws_s3_bucket_acl . this ,
124
+ aws_s3_bucket_ownership_controls . this
125
+ ]
114
126
}
115
127
116
128
resource "aws_s3_bucket_website_configuration" "this" {
@@ -121,15 +133,25 @@ resource "aws_s3_bucket_website_configuration" "this" {
121
133
error_document {
122
134
key = " error.html"
123
135
}
136
+ depends_on = [
137
+ aws_s3_bucket . this ,
138
+ aws_s3_bucket_acl . this ,
139
+ aws_s3_bucket_ownership_controls . this ,
140
+ aws_s3_bucket_server_side_encryption_configuration . this
141
+ ]
124
142
125
143
}
126
144
127
145
resource "aws_s3_bucket_policy" "this" {
128
146
bucket = aws_s3_bucket. this . id
129
147
policy = data. aws_iam_policy_document . s3_this . json
130
-
148
+
131
149
depends_on = [
132
- aws_s3_bucket . this
150
+ aws_s3_bucket . this ,
151
+ aws_s3_bucket_acl . this ,
152
+ aws_s3_bucket_ownership_controls . this ,
153
+ aws_s3_bucket_server_side_encryption_configuration . this ,
154
+ aws_s3_bucket_website_configuration . this
133
155
]
134
156
}
135
157
@@ -139,10 +161,14 @@ resource "aws_s3_bucket_public_access_block" "this" {
139
161
block_public_policy = true
140
162
ignore_public_acls = true
141
163
restrict_public_buckets = true
142
-
164
+
143
165
depends_on = [
144
- aws_s3_bucket_policy . this ,
166
+ aws_s3_bucket . this ,
145
167
aws_s3_bucket_acl . this ,
168
+ aws_s3_bucket_ownership_controls . this ,
169
+ aws_s3_bucket_server_side_encryption_configuration . this ,
170
+ aws_s3_bucket_website_configuration . this ,
171
+ aws_s3_bucket_policy . this
146
172
]
147
173
}
148
174
0 commit comments