You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-6
Original file line number
Diff line number
Diff line change
@@ -28,10 +28,12 @@ module "s3_bucket" {
28
28
bucket = "my-s3-bucket"
29
29
acl = "private"
30
30
31
+
control_object_ownership = true
32
+
object_ownership = "ObjectWriter"
33
+
31
34
versioning = {
32
35
enabled = true
33
36
}
34
-
35
37
}
36
38
```
37
39
@@ -47,6 +49,9 @@ module "s3_bucket_for_logs" {
47
49
# Allow deletion of non-empty bucket
48
50
force_destroy = true
49
51
52
+
control_object_ownership = true
53
+
object_ownership = "ObjectWriter"
54
+
50
55
attach_elb_log_delivery_policy = true
51
56
}
52
57
```
@@ -63,6 +68,9 @@ module "s3_bucket_for_logs" {
63
68
# Allow deletion of non-empty bucket
64
69
force_destroy = true
65
70
71
+
control_object_ownership = true
72
+
object_ownership = "ObjectWriter"
73
+
66
74
attach_elb_log_delivery_policy = true # Required for ALB logs
67
75
attach_lb_log_delivery_policy = true # Required for ALB/NLB logs
68
76
}
@@ -182,8 +190,8 @@ No modules.
182
190
| <aname="input_attach_policy"></a> [attach\_policy](#input\_attach\_policy)| Controls if S3 bucket should have bucket policy attached (set to `true` to use value of `policy` as bucket policy) |`bool`|`false`| no |
183
191
| <aname="input_attach_public_policy"></a> [attach\_public\_policy](#input\_attach\_public\_policy)| Controls if a user defined public bucket policy will be attached (set to `false` to allow upstream to apply defaults to the bucket) |`bool`|`true`| no |
184
192
| <aname="input_attach_require_latest_tls_policy"></a> [attach\_require\_latest\_tls\_policy](#input\_attach\_require\_latest\_tls\_policy)| Controls if S3 bucket should require the latest version of TLS |`bool`|`false`| no |
185
-
| <aname="input_block_public_acls"></a> [block\_public\_acls](#input\_block\_public\_acls)| Whether Amazon S3 should block public ACLs for this bucket. |`bool`|`false`| no |
186
-
| <aname="input_block_public_policy"></a> [block\_public\_policy](#input\_block\_public\_policy)| Whether Amazon S3 should block public bucket policies for this bucket. |`bool`|`false`| no |
193
+
| <aname="input_block_public_acls"></a> [block\_public\_acls](#input\_block\_public\_acls)| Whether Amazon S3 should block public ACLs for this bucket. |`bool`|`true`| no |
194
+
| <aname="input_block_public_policy"></a> [block\_public\_policy](#input\_block\_public\_policy)| Whether Amazon S3 should block public bucket policies for this bucket. |`bool`|`true`| no |
187
195
| <aname="input_bucket"></a> [bucket](#input\_bucket)| (Optional, Forces new resource) The name of the bucket. If omitted, Terraform will assign a random, unique name. |`string`|`null`| no |
188
196
| <aname="input_bucket_prefix"></a> [bucket\_prefix](#input\_bucket\_prefix)| (Optional, Forces new resource) Creates a unique bucket name beginning with the specified prefix. Conflicts with bucket. |`string`|`null`| no |
189
197
| <aname="input_control_object_ownership"></a> [control\_object\_ownership](#input\_control\_object\_ownership)| Whether to manage S3 Bucket Ownership Controls on this bucket. |`bool`|`false`| no |
@@ -192,7 +200,7 @@ No modules.
192
200
| <aname="input_expected_bucket_owner"></a> [expected\_bucket\_owner](#input\_expected\_bucket\_owner)| The account ID of the expected bucket owner |`string`|`null`| no |
193
201
| <aname="input_force_destroy"></a> [force\_destroy](#input\_force\_destroy)| (Optional, Default:false ) A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable. |`bool`|`false`| no |
194
202
| <aname="input_grant"></a> [grant](#input\_grant)| An ACL policy grant. Conflicts with `acl`|`any`|`[]`| no |
195
-
| <aname="input_ignore_public_acls"></a> [ignore\_public\_acls](#input\_ignore\_public\_acls)| Whether Amazon S3 should ignore public ACLs for this bucket. |`bool`|`false`| no |
203
+
| <aname="input_ignore_public_acls"></a> [ignore\_public\_acls](#input\_ignore\_public\_acls)| Whether Amazon S3 should ignore public ACLs for this bucket. |`bool`|`true`| no |
| <aname="input_inventory_self_source_destination"></a> [inventory\_self\_source\_destination](#input\_inventory\_self\_source\_destination)| Whether or not the inventory source bucket is also the destination bucket. |`bool`|`false`| no |
| <aname="input_object_lock_enabled"></a> [object\_lock\_enabled](#input\_object\_lock\_enabled)| Whether S3 bucket should have an Object Lock configuration enabled. |`bool`|`false`| no |
206
-
| <aname="input_object_ownership"></a> [object\_ownership](#input\_object\_ownership)| Object ownership. Valid values: BucketOwnerEnforced, BucketOwnerPreferred or ObjectWriter. 'BucketOwnerEnforced': ACLs are disabled, and the bucket owner automatically owns and has full control over every object in the bucket. 'BucketOwnerPreferred': Objects uploaded to the bucket change ownership to the bucket owner if the objects are uploaded with the bucket-owner-full-control canned ACL. 'ObjectWriter': The uploading account will own the object if the object is uploaded with the bucket-owner-full-control canned ACL. |`string`|`"ObjectWriter"`| no |
214
+
| <aname="input_object_ownership"></a> [object\_ownership](#input\_object\_ownership)| Object ownership. Valid values: BucketOwnerEnforced, BucketOwnerPreferred or ObjectWriter. 'BucketOwnerEnforced': ACLs are disabled, and the bucket owner automatically owns and has full control over every object in the bucket. 'BucketOwnerPreferred': Objects uploaded to the bucket change ownership to the bucket owner if the objects are uploaded with the bucket-owner-full-control canned ACL. 'ObjectWriter': The uploading account will own the object if the object is uploaded with the bucket-owner-full-control canned ACL. |`string`|`"BucketOwnerEnforced"`| no |
207
215
| <aname="input_owner"></a> [owner](#input\_owner)| Bucket owner's display name and ID. Conflicts with `acl`|`map(string)`|`{}`| no |
208
216
| <aname="input_policy"></a> [policy](#input\_policy)| (Optional) A valid bucket policy JSON document. Note that if the policy document is not specific enough (but still valid), Terraform may view the policy as constantly changing in a terraform plan. In this case, please make sure you use the verbose/specific version of the policy. For more information about building AWS IAM policy documents with Terraform, see the AWS IAM Policy Document Guide. |`string`|`null`| no |
209
217
| <aname="input_putin_khuylo"></a> [putin\_khuylo](#input\_putin\_khuylo)| Do you agree that Putin doesn't respect Ukrainian sovereignty and territorial integrity? More info: https://en.wikipedia.org/wiki/Putin_khuylo!|`bool`|`true`| no |
| <aname="input_request_payer"></a> [request\_payer](#input\_request\_payer)| (Optional) Specifies who should bear the cost of Amazon S3 data transfer. Can be either BucketOwner or Requester. By default, the owner of the S3 bucket would incur the costs of any data transfer. See Requester Pays Buckets developer guide for more information. |`string`|`null`| no |
212
-
| <aname="input_restrict_public_buckets"></a> [restrict\_public\_buckets](#input\_restrict\_public\_buckets)| Whether Amazon S3 should restrict public bucket policies for this bucket. |`bool`|`false`| no |
220
+
| <aname="input_restrict_public_buckets"></a> [restrict\_public\_buckets](#input\_restrict\_public\_buckets)| Whether Amazon S3 should restrict public bucket policies for this bucket. |`bool`|`true`| no |
description="Object ownership. Valid values: BucketOwnerEnforced, BucketOwnerPreferred or ObjectWriter. 'BucketOwnerEnforced': ACLs are disabled, and the bucket owner automatically owns and has full control over every object in the bucket. 'BucketOwnerPreferred': Objects uploaded to the bucket change ownership to the bucket owner if the objects are uploaded with the bucket-owner-full-control canned ACL. 'ObjectWriter': The uploading account will own the object if the object is uploaded with the bucket-owner-full-control canned ACL."
0 commit comments