我需要将我的 aws lambda 函数运行时设置为特定运行时,我设法从日志中获取所需的 ARN,但它不起作用, 我尝试了以下 cli 命令:
aws lambda update-function-configuration --function-name function_name_xxxx --runtime arn:aws:lambda:us-east-1::runtime:b475b23763329123d9e6f79f51886d0e1054f727f5b90ec945fcb2a3ec09afdd
我遇到以下错误:
An error occurred (InvalidParameterValueException) when calling the UpdateFunctionConfiguration operation: Value arn:aws:lambda:us-east-1::runtime:b475b23763329123d9e6f79f51886d0e1054f727f5b90ec945fcb2a3ec09afdd at 'runtime' failed to satisfy constraint: Member must satisfy enum value set: [nodejs20.x, provided.al2023, python3.12, java17, nodejs16.x, dotnet8, python3.10, java11, python3.11, dotnet6, java21, nodejs18.x, provided.al2, ruby3.3, java8.al2, ruby3.2, python3.8, python3.9] or be a valid ARN
我尝试将 aws 帐户 ID 添加到 ARN,尽管它最初不在记录的 ARN 中,但仍然存在同样的问题
aws lambda update-function-configuration --function-name function_name_xxxx --runtime arn:aws:lambda:us-east-1:account_id_xxxxxx:runtime:b475b23763329123d9e6f79f51886d0e1054f727f5b90ec945fcb2a3ec09afdd
同样的错误结果如下
An error occurred (InvalidParameterValueException) when calling the UpdateFunctionConfiguration operation: Value arn:aws:lambda:us-east-1:account_id_xxxxxx:runtime:b475b23763329123d9e6f79f51886d0e1054f727f5b90ec945fcb2a3ec09afdd at 'runtime' failed to satisfy constraint: Member must satisfy enum value set: [nodejs20.x, provided.al2023, python3.12, java17, nodejs16.x, dotnet8, python3.10, java11, python3.11, dotnet6, java21, nodejs18.x, provided.al2, ruby3.3, java8.al2, ruby3.2, python3.8, python3.9] or be a valid ARN
注意,我还尝试了通过
get-function-configuration
下的
RuntimeVersionConfig.RuntimeVersionArn
cli 命令实现的 ARN
答案是从 luk2302
共享的文档中提取的以下命令aws lambda put-runtime-management-config --function-name arn:aws:lambda:us-east-1:xxx_acount_id_xxx:function:xxx_my_function_name --update-runtime-on Manual --runtime-version-arn arn:aws:lambda:us-east-1::runtime:0cdcfbdefbc5e7d3343f73c2e2dd3cba17d61dea0686b404502a0c9ce83931b9