Skip to content

pbs-common/terraform-aws-bucket-notification-module

Repository files navigation

PBS TF Bucket Notification Module

Installation

Using the Repo Source

Use this URL for the source of the module. See the usage examples below for more details.

github.com/pbs/terraform-aws-bucket-notification-module?ref=1.0.24

Alternative Installation Methods

More information can be found on these install methods and more in the documentation here.

Usage

Provisions a bucket notification trigger to invoke a Lambda function when an event is triggered on an S3 bucket.

By default, only runs when the event s3:ObjectCreated:*" is triggered. Update events to change this.

Optionally, use filter_prefix or filter_suffix to filter the objects that trigger the notification.

Integrate this module like so:

module "bucket_notification" {
  source = "github.com/pbs/terraform-aws-bucket-notification-module?ref=1.0.24"

  # Required Parameters
  bucket     = module.s3.name
  lambda_arn = module.lambda.arn

  # Tagging Parameters
  organization = var.organization
  environment  = var.environment
  product      = var.product
  repo         = var.repo

  # Optional Parameters
}

Adding This Version of the Module

If this repo is added as a subtree, then the version of the module should be close to the version shown here:

1.0.24

Note, however that subtrees can be altered as desired within repositories.

Further documentation on usage can be found here.

Below is automatically generated documentation on this Terraform module using terraform-docs


Requirements

Name Version
terraform >= 1.3.2
aws >= 4.5.0

Providers

Name Version
aws 5.24.0

Modules

No modules.

Resources

Name Type
aws_s3_bucket_notification.bucket_notification resource

Inputs

Name Description Type Default Required
bucket Bucket to attach notifications to string n/a yes
lambda_function_configurations List of lambda function configurations
list(object({
id = optional(string)
lambda_arn = string
events = list(string)
filter_prefix = optional(string)
filter_suffix = optional(string)
}))
n/a yes

Outputs

Name Description
bucket Bucket sending notifications
lambda_function_arn ARN of the lambda function invoked by the notification

About

Standard PBS TF S3 Bucket Notification Module

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •