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
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ These features of S3 bucket configurations are supported:
16
16
- Cross-Region Replication (CRR)
17
17
- ELB log delivery bucket policy
18
18
- ALB/NLB log delivery bucket policy
19
+
- WAF log delivery bucket policy
19
20
- Account-level Public Access Block
20
21
- S3 Directory Bucket
21
22
- S3 Table Bucket
@@ -78,6 +79,24 @@ module "s3_bucket_for_logs" {
78
79
}
79
80
```
80
81
82
+
### Bucket with WAF log delivery policy attached
83
+
84
+
```hcl
85
+
module "s3_bucket_for_waf_logs" {
86
+
source = "terraform-aws-modules/s3-bucket/aws"
87
+
88
+
bucket = "my-s3-bucket-for-waf-logs"
89
+
90
+
# Allow deletion of non-empty bucket
91
+
force_destroy = true
92
+
93
+
control_object_ownership = true
94
+
object_ownership = "ObjectWriter"
95
+
96
+
attach_waf_log_delivery_policy = true # Required for WAF logs
97
+
}
98
+
```
99
+
81
100
## Conditional creation
82
101
83
102
Sometimes you need to have a way to create S3 resources conditionally but Terraform does not allow to use `count` inside `module` block, so the solution is to specify argument `create_bucket`.
@@ -182,6 +201,7 @@ No modules.
182
201
|[aws_iam_policy_document.inventory_and_analytics_destination_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
183
202
|[aws_iam_policy_document.lb_log_delivery](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
184
203
|[aws_iam_policy_document.require_latest_tls](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
204
+
|[aws_iam_policy_document.waf_log_delivery](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
185
205
|[aws_partition.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition)| data source |
186
206
|[aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region)| data source |
187
207
@@ -212,6 +232,7 @@ No modules.
212
232
| <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 |
213
233
| <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 |
214
234
| <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 |
235
+
| <aname="input_attach_waf_log_delivery_policy"></a> [attach\_waf\_log\_delivery\_policy](#input\_attach\_waf\_log\_delivery\_policy)| Controls if S3 bucket should have WAF log delivery policy attached |`bool`|`false`| no |
215
236
| <aname="input_availability_zone_id"></a> [availability\_zone\_id](#input\_availability\_zone\_id)| Availability Zone ID or Local Zone ID |`string`|`null`| no |
216
237
| <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 |
217
238
| <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 |
0 commit comments