trussworks/terraform-aws-s3-anti-virus

Notification creation race condition

Opened this issue · 1 comments

I seem to be running into a race condition where the 'scan' Lambda resource is just a second or two too slow being created, so when TF tries to add the Notification(s), the Lambda ARN doesn't exist yet. This leads me to have to run the apply twice, at which point it finishes successfully, but is particularly annoying when running in a CI/CD pipeline.
Could a simple 'depends_on = [aws_lambda_function.main_scan]' be added to the bucket notification resource definition please? I can raise a PR if that's easier.
Thanks!

@roger-ce Sorry for the slow comms. Please send a PR and we'll take a look!