Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions modules/s3_bucket_subscription/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ module "observe_lambda_s3_subscription" {
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.68 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.68 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0 |

## Modules

Expand All @@ -60,6 +60,7 @@ No modules.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_bucket_arns"></a> [bucket\_arns](#input\_bucket\_arns) | S3 bucket ARNs to subscribe to Observe Lambda | `list(string)` | `[]` | no |
| <a name="input_enable_eventbridge"></a> [enable\_eventbridge](#input\_enable\_eventbridge) | Enable sending bucket notifications to EventBridge | `bool` | `false` | no |
| <a name="input_filter_prefix"></a> [filter\_prefix](#input\_filter\_prefix) | Specifies object key name prefix on S3 bucket notifications. | `string` | `""` | no |
| <a name="input_filter_suffix"></a> [filter\_suffix](#input\_filter\_suffix) | Specifies object key name suffix on S3 bucket notifications. | `string` | `""` | no |
| <a name="input_iam_name_prefix"></a> [iam\_name\_prefix](#input\_iam\_name\_prefix) | Prefix used for all created IAM roles and policies | `string` | `"observe-lambda-"` | no |
Expand Down
6 changes: 4 additions & 2 deletions modules/s3_bucket_subscription/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ resource "aws_lambda_permission" "allow_bucket" {
}

resource "aws_s3_bucket_notification" "notification" {
count = length(aws_lambda_permission.allow_bucket)
bucket = data.aws_arn.bucket[count.index].resource
count = length(aws_lambda_permission.allow_bucket)
bucket = data.aws_arn.bucket[count.index].resource
eventbridge = var.enable_eventbridge

lambda_function {
lambda_function_arn = aws_lambda_permission.allow_bucket[count.index].function_name
events = ["s3:ObjectCreated:*"]
Expand Down
7 changes: 7 additions & 0 deletions modules/s3_bucket_subscription/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,10 @@ variable "statement_id_prefix" {
nullable = false
default = ""
}

variable "enable_eventbridge" {
description = "Enable sending bucket notifications to EventBridge"
type = bool
nullable = false
default = false
}
2 changes: 1 addition & 1 deletion modules/s3_bucket_subscription/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 2.68"
version = ">= 4.0"
}
}
}