Error waiting for lambda provisioned concurrency Config(student-poc) to be ready: status reason: FUNCTION_ERROR_INIT_FAILURE)

Viewed 172

Does anyone know how to resolve the above error? I'm trying to create an aws lambda, an alias on it and a provisioned concurrency for same. But on terraform apply it gives the error. I checked the forums which suggested to change into version, but I need to work on alias only. Here's my code-

module "student-poc"{
source = 
publish = true
// General settings
}

resource "aws_lambda_alias" "live"{
name = "live"
function_name = module.student-poc.function_name
function_version= module.student-poc.version
}

resource "aws_lambda_provisoned_concurreny_config" "live"{
function_name = aws_lambda_alias.live.function_name
provisioned_concurrent_executions = 1
qualifier = aws_lambda_alias.live.name
}
1 Answers

I was finally able to understand, it was because my zipped lambda code had issues, it wasn't running, hence deploying it via terraform couldn't initialise it as well. I had to redeploy with correct zipped files and it worked. Also a tip- add a depends on clause so that it creates an alias first nd then goes for provisioned concurrency.

Related