terraform-aws-modules / terraform-aws-lambda

Terraform module, which takes care of a lot of AWS Lambda/serverless tasks (build dependencies, packages, updates, deployments) in countless combinations 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/lambda/aws
Apache License 2.0
909 stars 682 forks source link

Can't use python3.10 runtime #449

Closed half2me closed 1 year ago

half2me commented 1 year ago

Description

Please provide a clear and concise description of the issue you are encountering, and a reproduction of your configuration (see the examples/* directory for references that you can copy+paste and tailor to match your configs if you are unable to copy your exact configuration). The reproduction MUST be executable by running terraform init && terraform apply without any further changes.

If your request is for a new feature, please use the Feature request template.

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists

Versions

Yes

Yes

Create this lambda layer

Expected behavior

Lambda layer should have been created.

Actual behavior

Terminal Output Screenshot(s)

Screenshot 2023-04-19 at 18 20 16

Additional context

ghost commented 1 year ago

I am facing the same issue with the runtime variable. Investigating it I think it's not a limitation from the module itself, but from the AWS Terraform provider. You can find the enhacement request here and the good news are that the fix is already merged, so in the coming days, when the new AWS provider version is released we should be able to use it.

As a workaround, if you aren't using any specifig feature from 3.10, you can manually create the package and upload it to S3, or trigger the generation from terraform with the null_resource resource and use the python3.9 runtime in the meantime. I found some inspiration for that here and the instructions to generate the zip package are here.

ghost commented 1 year ago

Hi @half2me. I found terraform AWS provider 4.64.0 was released few minutes ago. I updated the provider version in my code (terraform init -upgrade) and the issue is solved to me. Now I am able to correctly deploy python3.10 lambda with this module. Can you please check if it's also your case?

half2me commented 1 year ago

@VidakovicTrendier works for me, closing the issue :) Thanks

github-actions[bot] commented 1 year ago

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.