我正在尝试使用 Terraform 创建一个 AWS lambda 函数,如下所示:
\nresource "aws_lambda_function" "dev" {\n role = aws_iam_role.dev.arn\n handler = var.handler\n runtime = var.runtime\n filename = "lambda.zip"\n function_name = var.function_name\n source_code_hash = filebase64sha256(file("lambda.zip"))\n}\nRun Code Online (Sandbox Code Playgroud)\n但它会抛出一个错误:
\nCall to function "file" failed: contents of lambda.zip are not valid UTF-8; use the filebase64 function to obtain the Base64 encoded contents or the other file\n\xe2\x94\x82 functions (e.g. filemd5, filesha256) to obtain file hashing results instead.\nRun Code Online (Sandbox Code Playgroud)\n我也尝试过"${base64sha256(file("lambda.zip"))}",但仍然遇到同样的错误。
我在 terraform apply 期间遇到以下错误。
Error: timeout while waiting for plugin to start
Debug LOG:
2020-07-09T13:15:46.551-0400 [DEBUG] plugin: plugin process exited: path=/.terraform/plugins/darwin_amd64/terraform-provider-kubernetes_v1.11.3_x4 pid=48631
2020-07-09T13:15:46.551-0400 [DEBUG] plugin: plugin exited
2020-07-09T13:15:46.555-0400 [WARN] plugin: plugin failed to exit gracefully
2020-07-09T13:15:46.558-0400 [DEBUG] plugin: plugin process exited: path=/.terraform/plugins/darwin_amd64/terraform-provider-null_v2.1.2_x4 pid=48389
2020-07-09T13:15:46.558-0400 [DEBUG] plugin: plugin exited
Run Code Online (Sandbox Code Playgroud) iaas kubernetes terraform terraform-provider-aws terraform0.12+