我在 Terraform 中有以下配置:
// ...
resource "aws_api_gateway_integration_response" "post_pet_200_integration" {
rest_api_id = "${aws_api_gateway_rest_api.my_pets_api.id}"
resource_id = "${aws_api_gateway_resource.pets_resource.id}"
http_method = "${aws_api_gateway_method.post_pet_method.http_method}"
status_code = "${aws_api_gateway_method_response.post_pet_200.status_code}"
response_parameters = "foo"
}
运行时terraform apply
,我得到:
错误:
- aws_api_gateway_integration_response.post_pet_200_integration::无效或未知键:response_parameters
关于aws_api_gateway_integration_response的文档说:
response_parameters <- (可选)表示可以发回给调用者的响应参数
为什么我不能使用这个变量?
我尝试了以下方法:camelcase,带/不带 s,放入aws_api_gateway_method_response
oraws_api_gateway_deployment
块,放入 terraformmap
变量类型而不是字符串。但我每次都有同样的错误。我也试图从这个配置中获得灵感:https ://github.com/awslabs/aws-apigateway-importer ,但我仍然遇到了同样的错误。
编辑: terraform 的版本是 0.6.14。