terraform-aws-modules/terraform-aws-lambda

triggers not creating

justinTM opened this issue · 3 comments

  1. add an s3 trigger
    module "lambda" {
        ...
        allowed_triggers = {
            // keys are user-defined and not specific options
            // service is prepended to ".amazonaws.com" internally
            AllowExecutionFromS3 = {
              service  = "s3"
              source_arn = data.aws_s3_bucket.this.arn
            }
        }
    }
  2. no trigger when viewing lambda in AWS Console after terraform Apply

Correct me if I'm wrong, but the "allowed_triggers" parameter is for triggers that have already been created separately, and only creates policies.
To create an s3-event trigger, you need the "aws_s3_bucket_notification" resource, which is not part of this module (I'm looking for that too)

Here is the module for notifications - https://github.com/terraform-aws-modules/terraform-aws-s3-bucket/tree/master/modules/notification , and here is the example -
https://github.com/terraform-aws-modules/terraform-aws-s3-bucket/tree/master/examples/notification

@rkostyantyn is correct. The Lambda module only creates policies to allow external triggers.