coralogix / terraform-coralogix-aws

Coralogix AWS Integrations modules for Terraform.
https://registry.terraform.io/modules/coralogix/aws/coralogix
Apache License 2.0
6 stars 28 forks source link

Error: error putting Lambda Function Event Invoke Config #14

Open fstr opened 1 year ago

fstr commented 1 year ago

When using the Coralogix S3 module and applying it for the first time, there is a concurrency issue. This requires several terraform apply runs until all the resources are finally applied.

Error: error putting Lambda Function Event Invoke Config (Coralogix-S3-XYZ): ResourceConflictException: The EventInvokeConfig for function arn:aws:lambda:<region>:<account_id>:function:Coralogix-S3-XYZ:$LATEST could not be updated due to a concurrent update operation.

This is due to an issue in the used terraform-aws-lambda module and/or how the AWS provider applies these changes.

You can find more information about this (still?) unfixed issue here: https://github.com/terraform-aws-modules/terraform-aws-lambda/issues/263 and an example implementation of the workaround by someone here: https://github.com/chanzuckerberg/napari-hub/pull/577

You can try bumping the version of terraform-aws-lambda to the latest 4.6.1 and see if it still happens or implement the liked workaround.

academ1c commented 1 year ago

I confirmed this error too. Please check and fix module.lambda.aws_lambda_function_event_invoke_config.this["current_version"] with next code maximum_retry_attempts = 2 -> maximum_retry_attempts = 5 It is possible solution. Because now I should run terraform apply twice