TF Make deploy Lambda fails
Version information
Describe the bug
Running make deploy from dce-master folder
- aws s3 cp artifacts/lambda/account_pool_metrics.zip s3://-dce-artifacts-dce2/lambda/account_pool_metrics.zip --sse upload: artifacts/lambda/account_pool_metrics.zip to s3://-dce-artifacts-dce2/lambda/account_pool_metrics.zip
- aws lambda update-function-code --function-name account_pool_metrics-dce2 --s3-bucket -dce-artifacts-dce2 --s3-key lambda/account_pool_metrics.zip { "FunctionName": "account_pool_metrics-dce2", "FunctionArn": "arn:aws:lambda:us-east-1::function:account_pool_metrics-dce2", "Runtime": "go1.x", "Role": "arn:aws:iam:::role/dce-lambda-dce220220224191211019900000002", "Handler": "account_pool_metrics", "CodeSize": 12951978, "Description": "Handles API requests to the /accounts endpoint", "Timeout": 300, "MemorySize": 128, "LastModified": "2022-02-24T19:19:58.000+0000", "CodeSha256": "Qswk1GQtCqVAldGPLwas1re8PdmA/2ZenIbC2Oj0Hcg=", "Version": "$LATEST", "Environment": { "Variables": { "NAMESPACE": "dce2", "ACCOUNT_ID": "", "ACCOUNT_DB": "AccountsDce2", "AWS_CURRENT_REGION": "us-east-1", "DEBUG": "false" } }, "TracingConfig": { "Mode": "PassThrough" }, "RevisionId": "4809607e-f7cd-47e0-8e24-c8364c7e8529", "State": "Active", "LastUpdateStatus": "InProgress", "LastUpdateStatusReason": "The function is being created.", "LastUpdateStatusReasonCode": "Creating" }
- aws lambda publish-version --function-name account_pool_metrics-dce2
An error occurred (ResourceConflictException) when calling the PublishVersion operation: The operation cannot be performed at this time. An update is in progress for resource: arn:aws:lambda:us-east-1::function:account_pool_metrics-dce2 make: *** [Makefile:40: deploy] Error 255
To Reproduce terraform apply to make sure its clean, Try again same error. TF Destroy start over, try new name same issue
I waited 24 hours also to make sure it was not issue. I have read the need to add a Wait to lambda
I’ve stumbled upon this issue as well. I’ve solved by adding a sleep 5 before running the publish API call and it worked.
I think we added a lamba wait but sleep might be better