terraform-aws-modules / terraform-aws-lambda

Terraform module, which takes care of a lot of AWS Lambda/serverless tasks (build dependencies, packages, updates, deployments) in countless combinations πŸ‡ΊπŸ‡¦
https://registry.terraform.io/modules/terraform-aws-modules/lambda/aws
Apache License 2.0
886 stars 657 forks source link

"Missing required argument" error with version 4.12.0 #433

Closed petur closed 1 year ago

petur commented 1 year ago

Description

After upgrading to version 4.12.0, using this module fails with the error "Missing required argument".

Versions

Reproduction Code [Required]

module "sns_slack_lambda" {
  source = "terraform-aws-modules/lambda/aws"

  function_name = "sns-slack"
  description   = "Forwards SES notifications to Slack"
  handler       = "sns_slack.lambda_handler"
  runtime       = "python3.8"

  attach_policy_json = true
  policy_json        = data.aws_iam_policy_document.sns_slack_lambda.json

  source_path = "${path.module}/src/sns_slack.py"

  environment_variables = {
    WEBHOOK_URL_SECRET_ARN = var.slack_webhook_url_secret_arn
  }
}

Steps to reproduce the behavior:

terraform apply

Expected behavior

Module should be applied.

Actual behavior

Terraform fails with the error shown below.

Terminal Output Screenshot(s)

β”‚ Error: Missing required argument
β”‚ 
β”‚   with module.sns_slack_lambda.aws_lambda_function.this[0],
β”‚   on .terraform/modules/sns_slack_lambda/main.tf line 43, in resource "aws_lambda_function" "this":
β”‚   43:   replacement_security_group_ids     = var.replacement_security_group_ids
β”‚ 
β”‚ "replacement_security_group_ids": all of
β”‚ `replace_security_groups_on_destroy,replacement_security_group_ids` must be
β”‚ specified

Additional context

This works fine with version 4.11.0.

bhelgs commented 1 year ago

same. For now I just hardcoded to the prior version.

antonbabenko commented 1 year ago

This issue has been resolved in version 4.12.1 :tada:

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.