diff --git a/README.md b/README.md
index e342fd7..3550a72 100644
--- a/README.md
+++ b/README.md
@@ -154,8 +154,8 @@ Available targets:
| Name | Source | Version |
|------|--------|---------|
| [access\_log\_label](#module\_access\_log\_label) | cloudposse/label/null | 0.25.0 |
-| [s3\_access\_log\_bucket](#module\_s3\_access\_log\_bucket) | cloudposse/s3-log-storage/aws | 0.24.1 |
-| [s3\_bucket](#module\_s3\_bucket) | cloudposse/s3-log-storage/aws | 0.24.1 |
+| [s3\_access\_log\_bucket](#module\_s3\_access\_log\_bucket) | cloudposse/s3-log-storage/aws | 0.25.0 |
+| [s3\_bucket](#module\_s3\_bucket) | cloudposse/s3-log-storage/aws | 0.25.0 |
| [this](#module\_this) | cloudposse/label/null | 0.25.0 |
## Resources
@@ -177,6 +177,9 @@ Available targets:
| [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,
in the order they appear in the list. New attributes are appended to the
end of the list. The elements of the list are joined by the `delimiter`
and treated as a single ID element. | `list(string)` | `[]` | no |
| [block\_public\_acls](#input\_block\_public\_acls) | Set to `false` to disable the blocking of new public access lists on the bucket | `bool` | `true` | no |
| [block\_public\_policy](#input\_block\_public\_policy) | Set to `false` to disable the blocking of new public policies on the bucket | `bool` | `true` | no |
+| [bucket\_notifications\_enabled](#input\_bucket\_notifications\_enabled) | Send notifications for the object created events. Used for 3rd-party log collection from a bucket. This does not affect access log bucket created by this module. To enable bucket notifications on the access log bucket, create it separately using the cloudposse/s3-log-storage/aws | `bool` | `false` | no |
+| [bucket\_notifications\_prefix](#input\_bucket\_notifications\_prefix) | Prefix filter. Used to manage object notifications | `string` | `""` | no |
+| [bucket\_notifications\_type](#input\_bucket\_notifications\_type) | Type of the notification configuration. Only SQS is supported. | `string` | `"SQS"` | no |
| [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. | `any` |
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
}
| no |
| [create\_access\_log\_bucket](#input\_create\_access\_log\_bucket) | A flag to indicate if a bucket for s3 access logs should be created | `bool` | `false` | no |
| [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
@@ -218,6 +221,7 @@ Available targets:
| [bucket\_arn](#output\_bucket\_arn) | Bucket ARN |
| [bucket\_domain\_name](#output\_bucket\_domain\_name) | FQDN of bucket |
| [bucket\_id](#output\_bucket\_id) | Bucket ID |
+| [bucket\_notifications\_sqs\_queue\_arn](#output\_bucket\_notifications\_sqs\_queue\_arn) | Notifications SQS queue ARN |
| [prefix](#output\_prefix) | Prefix configured for lifecycle rules |
diff --git a/docs/terraform.md b/docs/terraform.md
index c639099..d48ca39 100644
--- a/docs/terraform.md
+++ b/docs/terraform.md
@@ -19,8 +19,8 @@
| Name | Source | Version |
|------|--------|---------|
| [access\_log\_label](#module\_access\_log\_label) | cloudposse/label/null | 0.25.0 |
-| [s3\_access\_log\_bucket](#module\_s3\_access\_log\_bucket) | cloudposse/s3-log-storage/aws | 0.24.1 |
-| [s3\_bucket](#module\_s3\_bucket) | cloudposse/s3-log-storage/aws | 0.24.1 |
+| [s3\_access\_log\_bucket](#module\_s3\_access\_log\_bucket) | cloudposse/s3-log-storage/aws | 0.25.0 |
+| [s3\_bucket](#module\_s3\_bucket) | cloudposse/s3-log-storage/aws | 0.25.0 |
| [this](#module\_this) | cloudposse/label/null | 0.25.0 |
## Resources
@@ -42,6 +42,9 @@
| [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,
in the order they appear in the list. New attributes are appended to the
end of the list. The elements of the list are joined by the `delimiter`
and treated as a single ID element. | `list(string)` | `[]` | no |
| [block\_public\_acls](#input\_block\_public\_acls) | Set to `false` to disable the blocking of new public access lists on the bucket | `bool` | `true` | no |
| [block\_public\_policy](#input\_block\_public\_policy) | Set to `false` to disable the blocking of new public policies on the bucket | `bool` | `true` | no |
+| [bucket\_notifications\_enabled](#input\_bucket\_notifications\_enabled) | Send notifications for the object created events. Used for 3rd-party log collection from a bucket. This does not affect access log bucket created by this module. To enable bucket notifications on the access log bucket, create it separately using the cloudposse/s3-log-storage/aws | `bool` | `false` | no |
+| [bucket\_notifications\_prefix](#input\_bucket\_notifications\_prefix) | Prefix filter. Used to manage object notifications | `string` | `""` | no |
+| [bucket\_notifications\_type](#input\_bucket\_notifications\_type) | Type of the notification configuration. Only SQS is supported. | `string` | `"SQS"` | no |
| [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | {
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
}
| no |
| [create\_access\_log\_bucket](#input\_create\_access\_log\_bucket) | A flag to indicate if a bucket for s3 access logs should be created | `bool` | `false` | no |
| [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
@@ -83,5 +86,6 @@
| [bucket\_arn](#output\_bucket\_arn) | Bucket ARN |
| [bucket\_domain\_name](#output\_bucket\_domain\_name) | FQDN of bucket |
| [bucket\_id](#output\_bucket\_id) | Bucket ID |
+| [bucket\_notifications\_sqs\_queue\_arn](#output\_bucket\_notifications\_sqs\_queue\_arn) | Notifications SQS queue ARN |
| [prefix](#output\_prefix) | Prefix configured for lifecycle rules |
diff --git a/main.tf b/main.tf
index 4b4d96b..91157ce 100644
--- a/main.tf
+++ b/main.tf
@@ -10,7 +10,7 @@ module "access_log_label" {
module "s3_bucket" {
source = "cloudposse/s3-log-storage/aws"
- version = "0.24.1"
+ version = "0.25.0"
enabled = module.this.enabled
acl = var.acl
@@ -35,13 +35,16 @@ module "s3_bucket" {
restrict_public_buckets = var.restrict_public_buckets
access_log_bucket_name = local.access_log_bucket_name
allow_ssl_requests_only = var.allow_ssl_requests_only
+ bucket_notifications_enabled = var.bucket_notifications_enabled
+ bucket_notifications_type = var.bucket_notifications_type
+ bucket_notifications_prefix = var.bucket_notifications_prefix
context = module.this.context
}
module "s3_access_log_bucket" {
source = "cloudposse/s3-log-storage/aws"
- version = "0.24.1"
+ version = "0.25.0"
enabled = module.this.enabled && var.create_access_log_bucket
acl = var.acl
diff --git a/outputs.tf b/outputs.tf
index 161e815..dad425c 100644
--- a/outputs.tf
+++ b/outputs.tf
@@ -17,3 +17,8 @@ output "prefix" {
value = module.s3_bucket.prefix
description = "Prefix configured for lifecycle rules"
}
+
+output "bucket_notifications_sqs_queue_arn" {
+ value = module.s3_bucket.bucket_notifications_sqs_queue_arn
+ description = "Notifications SQS queue ARN"
+}
\ No newline at end of file
diff --git a/variables.tf b/variables.tf
index 43981b5..3ba67e0 100644
--- a/variables.tf
+++ b/variables.tf
@@ -130,3 +130,21 @@ variable "allow_ssl_requests_only" {
default = false
description = "Set to `true` to require requests to use Secure Socket Layer (HTTPS/SSL). This will explicitly deny access to HTTP requests"
}
+
+variable "bucket_notifications_enabled" {
+ type = bool
+ description = "Send notifications for the object created events. Used for 3rd-party log collection from a bucket. This does not affect access log bucket created by this module. To enable bucket notifications on the access log bucket, create it separately using the cloudposse/s3-log-storage/aws"
+ default = false
+}
+
+variable "bucket_notifications_type" {
+ type = string
+ description = "Type of the notification configuration. Only SQS is supported."
+ default = "SQS"
+}
+
+variable "bucket_notifications_prefix" {
+ type = string
+ description = "Prefix filter. Used to manage object notifications"
+ default = ""
+}
\ No newline at end of file