Skip to content

lamda value has not been declared in event_notification_details #252

@mpajuelofernandez

Description

@mpajuelofernandez

Describe the Bug

when creating a s3 bucket notification, the plan shows the following error:

Error: Reference to undeclared resource
│ 
│   on .terraform/modules/my_bucket.s3_bucket/main.tf line 592, in resource "aws_s3_bucket_notification" "bucket_notification":
│  592:       events              = lambda.value.events
│ 
│ A managed resource "lambda" "value" has not been declared in module.my_bucket.module.s3_bucket.

Expected Behavior

The resource should be created when the event_notifcation_list is enabled

    enabled = true
    lambda_list = [
      {
        lambda_function_arn = "arn:aws:lambda:"
        events = ["s3:ObjectRemoved:*"]
        filter_prefix = ""
        filter_suffix = ""
      },
    ]
    queue_list = []
    topic_list = []
  }

Steps to Reproduce

Just do a call to the module, trying to create a event notification

module "my_bucket" {
  source  = "cloudposse/s3-bucket/aws"
  version = "4.7.0"
  bucket_name = "mybucket"
  event_notification_details = {
    enabled = true
    lambda_list = [
      {
        lambda_function_arn = "arn:aws:lambd"
        events = ["s3:ObjectRemoved:*"]
        filter_prefix = ""
        filter_suffix = ""
      },
    ]
    queue_list = []
    topic_list = []
  }

Screenshots

No response

Environment

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions