我在本地运行 Terraform 0.12.24
我正在尝试部署与 Lambda 的 API Gateway 集成
我正在尝试使用 Terraform 启用 AWS API GW CORS。
对于 OPTIONS 方法响应,我有以下资源:
resource "aws_api_gateway_method_response" "options_200" {
rest_api_id = aws_api_gateway_rest_api.scout-approve-api-gateway.id
resource_id = aws_api_gateway_resource.proxy.id
http_method = aws_api_gateway_method.options_method.http_method
status_code = "200"
response_models {
"application/json" = "Empty"
}
response_parameters {
"method.response.header.Access-Control-Allow-Headers" = true,
"method.response.header.Access-Control-Allow-Methods" = true,
"method.response.header.Access-Control-Allow-Origin" = true
}
depends_on = [aws_api_gateway_method.options_method]
}
我得到:
Error: Invalid argument name
on main.tf line 48, in resource "aws_api_gateway_method_response" "options_200":
48: "application/json" = "Empty"
Argument names must not be quoted.
是什么赋予了?