Terraform aws_api_gateway_integration_response一直想更改selection_pattern属性。任何指导将不胜感激。
resource "aws_api_gateway_integration_response" "api_gateway_integration_response_e1_default" {
rest_api_id = "${aws_api_gateway_rest_api.api_gateway_rest_api.id}"
resource_id = "${aws_api_gateway_resource.e1_api_gateway_resource.id}"
http_method = "${aws_api_gateway_method.e1_api_gateway_method.http_method}"
status_code = "${aws_api_gateway_method_response.api_gateway_method_response_e1_202.status_code}"
selection_pattern = "-"
}
resource "aws_api_gateway_integration_response" "api_gateway_integration_response_e2_default" {
rest_api_id = "${aws_api_gateway_rest_api.api_gateway_rest_api.id}"
resource_id = "${aws_api_gateway_resource.e2_api_gateway_resource.id}"
http_method = "${aws_api_gateway_method.e2_api_gateway_method.http_method}"
status_code = "${aws_api_gateway_method_response.api_gateway_method_response_e2_202.status_code}"
selection_pattern = "-"
}
我的Terraform应用了一直想更新的输出。
terraform apply
...
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
~ module.gateway.aws_api_gateway_integration_response.api_gateway_integration_response_e1_default
selection_pattern: "" => "-"
~ module.gateway.aws_api_gateway_integration_response.api_gateway_integration_response_e2_default
selection_pattern: "" => "-"
Plan: 0 to add, 2 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
请参阅Terraform版本
$ terraform version
Terraform v0.11.14
+ provider.aws v2.32.0
...
答案 0 :(得分:1)
看起来像是个错误。在AWS控制台中,在扩展整合响应之前,选择模式的空值显示为单破折号-
。但是,在扩展积分响应后,该模式为空,并且显示文本default
。
在AWS API Documents for the Selection Pattern paramter中,没有提到能够通过-
将模式重置为默认值。
设置selection_pattern = ""
应该可以满足您的需求。我用Terraform 0.12.9进行了测试。我确认这也可以在Terraform 0.11.14上使用