我正在尝试编写要使用 S3 触发的 lambda 函数。Lambda 函数的创建成功,但“aws_s3_bucket_notification”资源失败并terraform:apply显示以下MethodNotAllowed错误status code 405:
Error: Error applying plan:
20-Sep-2018 15:23:53 1 error(s) occurred:
20-Sep-2018 15:23:53 * aws_s3_bucket_notification.my-trigger: 1 error(s) occurred:
20-Sep-2018 15:23:53 * aws_s3_bucket_notification.my-trigger: Error putting S3 notification configuration: MethodNotAllowed: The specified method is not allowed against this resource.
20-Sep-2018 15:23:53 status code: 405, request id:<hidden>, host id:<hidden>
Run Code Online (Sandbox Code Playgroud)
这是我设置通知触发器的代码:
resource "aws_s3_bucket_notification" "my-trigger" {
bucket = "my-bucket"
lambda_function {
lambda_function_arn = "${aws_lambda_function.my-function.arn}"
events = ["s3:ObjectCreated:*"]
filter_prefix = "file-prefix"
filter_suffix = "file-extension" …Run Code Online (Sandbox Code Playgroud)