如何通过云形成部署java17lambda函数

dtcbnfnu  于 2023-05-05  发布在  Java
关注(0)|答案(4)|浏览(127)

我计划将Java 17函数部署到AWS lambda。但是根据文档,AWS没有为Java 17提供基础映像。
https://docs.aws.amazon.com/lambda/latest/dg/lambda-java.html
因此,我对cloudformation模板Runtime字段中应该使用什么值有问题

"AMIIDLookup": {
    "Type": "AWS::Lambda::Function",
    "Properties": {
        "Handler": "index.handler",
        "Role": {
            "Fn::GetAtt": [
                "LambdaExecutionRole",
                "Arn"
            ]
        },
        "Code": {
            "S3Bucket": "lambda-functions",
            "S3Key": "amilookup.zip"
        },
        "Runtime": "Java11",  # what is the alternative for this
        "Timeout": 25,
        "TracingConfig": {
            "Mode": "Active"
        }
    }
}
jxct1oxe

jxct1oxe2#

Robert是对的,要么创建一个自定义运行时,要么使用docker镜像来启动AWS lambda函数https://cloud.netapp.com/blog/aws-cvo-blg-aws-lambda-images-how-to-use-container-images-to-deploy-lambda

watbbzwu

watbbzwu4#

从2023-05-29开始,将有一个官方管理的Java 17运行时。参见github:https://github.com/aws/aws-lambda-base-images/issues/29#issuecomment-1472890683
编辑:Java 17已经可用:https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

相关问题