Terraform aws_api_gateway_integration_response 一直想改变属性

seb*_*ian 6 terraform

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 = "-"
}
Run Code Online (Sandbox Code Playgroud)

我的 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.
Run Code Online (Sandbox Code Playgroud)

查看地形版本

$ terraform version
Terraform v0.11.14
+ provider.aws v2.32.0
...
Run Code Online (Sandbox Code Playgroud)

Car*_*lli 5

看起来这可能是一个错误。在 AWS 控制台中,在展开集成响应之前,选择模式的空值显示为单个破折号-。但是,在扩展积分响应后,模式为空并default显示文本。

选择模式参数AWS API 文档中,没有提到能够传入 a-以将模式重置为默认值。

设置selection_pattern = ""应该得到你所需要的。我用 Terraform 0.12.9 对其进行了测试。我确认这也适用于 Terraform 0.11.14