mineiros-io / terraform-aws-lambda-function

A Terraform module for deploying and managing Lambda functions on Amazon Web Services (AWS). https://aws.amazon.com/lambda/
Apache License 2.0
42 stars 24 forks source link

Add source_code_hash and S3 test #10

Closed soerenmartius closed 4 years ago

soerenmartius commented 4 years ago

@mariux removing module_depends_on = [aws_s3_bucket_object.function] will break the test: https://mineiros.semaphoreci.com/jobs/df12e175-d00e-4bac-9d53-b9477e5713e5

Seems like a race condition which means that Terraform tries to create the lambda function and the s3 object in parallel.


Error: Error creating Lambda function: InvalidParameterValueException: Error occurred while GetObject. S3 Error Code: NoSuchKey. S3 Error Message: The specified key does not exist.
--
344 | {
346 | RespMetadata: {
346 | StatusCode: 400,
347 | RequestID: "79900397-01ba-493b-9a1c-a0a73100ec76"
348 | },
350 | Message_: "Error occurred while GetObject. S3 Error Code: NoSuchKey. S3 Error Message: The specified key does not exist.",
350 | Type: "User"
351 | }

Will reintroduce the module_depends_on line in order to get it working.

soerenmartius commented 4 years ago

applied a minor format-patch, please re-approve @mariux