-2

I have a Lambda function which runs currently on Python 3.9.
Now I'm trying to upgrade the runtime to python 3.11.
So I updated my aws cli and python to the newest version.

aws --version` is `aws-cli/2.13.17 Python/3.11.5 Windows/10 exe/AMD64 prompt/of

But I'm getting this error here:

Configuration error at 'provider.runtime': must be equal to one of the allowed values [dotnet6, go1.x, java17, java11, java8, java8.al2, nodejs14.x, nodejs16.x, nodejs18.x, provided, provided.al2, python3.7, python3.8, python3.9, python3.10, ruby2.7]

I'm searching for a solution but I always geet this error when trying to change dependencies or anything else.
Maybe someone can help, thanks in advance :)

I'm deploying my Lambda via Serverless, this is my serverless.yaml:

service: name

frameworkVersion: '3'
configValidationMode: error

custom:
  pythonRequirements:
    dockerizePip: true
  stage: ${opt:stage, self:provider.stage}
  profile:
    dev: dev
    prod: prod 
  deploymentBucket:
    dev: bucket-dev
    prod: bucket-prod
  environment: ${self:custom.environments.${self:custom.stage}, self:custom.environments.dev}
  environments: ${file(environment-definition.yaml)}

provider:
  name: aws
  runtime: python3.11
  region: eu-central-1
  stage: dev
  profile: ${self:custom.profile.${self:custom.stage}}
  deploymentMethod: direct
  deploymentBucket:
    name: ${self:custom.deploymentBucket.${self:custom.stage}}

functions:
  lambda_handler:
    handler: handler.lambda_handler
    timeout: 300
    environment: ${self:custom.environment.envVars}
    events:
      - eventBridge:
          schedule: cron(0 0 ? * 4#1 *) 

          
package:
  exclude:
    - node_modules/**
    - __pycache__

plugins:
  - serverless-python-requirements
  - serverless-better-credentials
7
  • it is not in the list of supported version, so you can update it
    – nbk
    Commented Sep 11, 2023 at 12:22
  • But python 3.11 should be possible docs.aws.amazon.com/lambda/latest/dg/lambda-python.html Commented Sep 11, 2023 at 12:23
  • paper is very patient, you need to wait till it is supported
    – nbk
    Commented Sep 11, 2023 at 12:25
  • But it is already supported! Look at the aws documentation link I added. In the aws console I can select this runtime, but in my local serverless lambda I can just select the runtime until 3.10 Commented Sep 11, 2023 at 12:31
  • Amazon lag with the implementation, even when it is written on a webpage, that was here shown multiple times already
    – nbk
    Commented Sep 11, 2023 at 12:58

1 Answer 1

1

I had to update my serverless local version. After that python 3.11 was available. Thanks for your time :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.