Closed willkara closed 1 year ago
I ran into same problem and the root cause is that lambda module will look for python3.9.exe
in your PATH when runtime = "python3.9"
is set. Copying/linking to python.exe
fixed this problem for me.
I'm going to lock this issue because it has been closed for 30 days β³. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Description
I am trying to use the
terraform-aws-modules/lambda/aws
module for a basic lambda function build. I've confirmed Python 3.9 is on my system path, but the module keeps failing.So, as you can see, I clearly have Python 3.9.0 on the path. The module isn't finding it for some reason.
β οΈ Note
Before you submit an issue, please perform the following first:
Versions
Module version [Required]:
Terraform version: v1.3.1 on windows_amd64
Provider version(s):
Reproduction Code [Required]
Steps to reproduce the behavior:
Expected behavior
Lambda function builds
Actual behavior
Program: C:\Users\e349068\AppData\Local\Programs\Python\Python39\python.exe
β Error Message: Traceback (most recent call last): β File "C:\Users\e349068\source\repos\terraform-aws-lambda\examples\build-package.terraform\modules\lambda_function\package.py", line 1632, in
β main()
β File "C:\Users\e349068\source\repos\terraform-aws-lambda\examples\build-package.terraform\modules\lambda_function\package.py", line 1628, in main
β exit(args.command(args))
β File "C:\Users\e349068\source\repos\terraform-aws-lambda\examples\build-package.terraform\modules\lambda_function\package.py", line 1427, in prepare_command
β build_plan = bpm.plan(source_path, query)
β File "C:\Users\e349068\source\repos\terraform-aws-lambda\examples\build-package.terraform\modules\lambda_function\package.py", line 773, in plan
β pip_requirements_step(
β File "C:\Users\e349068\source\repos\terraform-aws-lambda\examples\build-package.terraform\modules\lambda_function\package.py", line 675, in pip_requirements_step
β raise RuntimeError(
β RuntimeError: Python interpreter version equal to defined lambda runtime (python3.9) should be available in system PATH
β
β State: exit status 1
PS C:\Users\e349068\source\repos\terraform-aws-lambda\examples\build-package> python --version
Python 3.9.0