@@ -13,6 +13,7 @@ These features of S3 bucket configurations are supported:
- object locking
- Cross-Region Replication (CRR)
- ELB log delivery bucket policy
- ALB/NLB log delivery bucket policy
## Usage
...
...
@@ -48,6 +49,22 @@ module "s3_bucket_for_logs" {
}
```
### Bucket with ALB/NLB access log delivery policy attached
```hcl
module"s3_bucket_for_logs"{
source="terraform-aws-modules/s3-bucket/aws"
bucket="my-s3-bucket-for-logs"
acl="log-delivery-write"
# Allow deletion of non-empty bucket
force_destroy=true
attach_lb_log_delivery_policy=true
}
```
## Conditional creation
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`.
...
...
@@ -113,6 +130,7 @@ No modules.
| [aws_iam_policy_document.combined](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.deny_insecure_transport](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.elb_log_delivery](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.lb_log_delivery](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
## Inputs
...
...
@@ -122,6 +140,7 @@ No modules.
| <aname="input_acl"></a>[acl](#input\_acl) | (Optional) The canned ACL to apply. Defaults to 'private'. Conflicts with `grant` | `string` | `"private"` | no |
| <aname="input_attach_deny_insecure_transport_policy"></a>[attach\_deny\_insecure\_transport\_policy](#input\_attach\_deny\_insecure\_transport\_policy) | Controls if S3 bucket should have deny non-SSL transport policy attached | `bool` | `false` | no |
| <aname="input_attach_elb_log_delivery_policy"></a>[attach\_elb\_log\_delivery\_policy](#input\_attach\_elb\_log\_delivery\_policy) | Controls if S3 bucket should have ELB log delivery policy attached | `bool` | `false` | no |
| <aname="input_attach_lb_log_delivery_policy"></a>[attach\_lb\_log\_delivery\_policy](#input\_attach\_lb\_log\_delivery\_policy) | Controls if S3 bucket should have ALB/NLB log delivery policy attached | `bool` | `false` | no |
| <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 |
| <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 |
| <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 |