【发布时间】:2020-09-07 15:55:48
【问题描述】:
我正在尝试在 AWS Lambda 层上运行 python 函数,我没有找到任何关于 terraform 的文档来使用 AWS 提供的 lambda 层。如何使用 AWS 提供的 lambda 层 AWSLambda-Python27-SciPy1x 和运行时 Python 2.7?
#----compute/lambda.tf----
data "archive_file" "lambda_zip" {
type = "zip"
source_file = "index.py"
output_path = "check_foo.zip"
}
resource "aws_lambda_function" "check_foo" {
filename = "check_foo.zip"
function_name = "checkFoo"
role = "${aws_iam_role.iam_for_lambda_tf.arn}"
handler = "index.handler"
source_code_hash = "${data.archive_file.lambda_zip.output_base64sha256}"
# i want to use lambda layer - AWSLambda-Python27-SciPy1x and run this function on it
runtime = "python2.7"
}
【问题讨论】:
标签: amazon-web-services aws-lambda terraform terraform-provider-aws