Issues with lambda module

I fund an issue with python3 program in lambda module for HashiCorp Cloud Platform (Terraform Cloud)

Error: External Program Lookup Failed

  on .terraform/modules/lambda_run_job/package.tf line 10, in data "external" "archive_prepare":
  10:   program = [local.python, "${path.module}/package.py", "prepare"]

The data source received an unexpected error while attempting to find the
program.

The program must be accessible according to the platform where Terraform is
running.

If the expected program should be automatically found on the platform where
Terraform is running, ensure that the program is in an expected directory. On
Unix-based platforms, these directories are typically searched based on the
'$PATH' environment variable. On Windows-based platforms, these directories
are typically searched based on the '%PATH%' environment variable.

If the expected program is relative to the Terraform configuration, it is
recommended that the program name includes the interpolated value of
'path.module' before the program name to ensure that it is compatible with
varying module usage. For example: "${path.module}/my-program"

The program must also be executable according to the platform where Terraform
is running. On Unix-based platforms, the file on the filesystem must have the
executable bit set. On Windows-based platforms, no action is typically
necessary.

Platform: linux
Program: python3
Error: exec: "python3": executable file not found in $PATH

Operation failed: failed running terraform plan (exit 1)

Hi @kozharsky,

A Terraform configuration intended for use in Terraform Cloud remote operations should not use any Terraform features that rely on external software, because Terraform Cloud’s execution environment is single-use VMs with only just enough supported software to run Terraform itself.

Given that, I think unfortunately this particular module is not compatible with Terraform Cloud. If you wish you use it then you would need to disable remote operations on this workspace and apply changes instead on a local system where you can make sure a suitable version of Python is installed.

Alternatively, you could run this packaging step outside if Terraform (e.g. in a CI system) and make it publish the generated artifact to somewhere the Terraform configuration would be able to refer to it, such as an Amazon S3 bucket in the case of Lambda (because Lambda natively supports fetching Lambda function packages from S3).

@apparentlymart i guess python3 is expected to be in linux based workers .