CloudSearch integration via API Gateway

Hi,

I am trying to configure TF to support an API Gateway integration to CloudSearch. Here is my configuration

resource "aws_api_gateway_method" "v1_cloudsearch_get" {
  rest_api_id = var.rest_api_id
  resource_id = aws_api_gateway_resource.v1_cloudsearch.id
  http_method = "GET"
  authorization = "NONE"
  request_validator_id = aws_api_gateway_request_validator.v1_cloudsearch_get.id
  request_parameters = {
    "method.request.querystring.q": true
  }
}

resource "aws_api_gateway_integration" "v1_cloudsearch_get" {
  rest_api_id = var.rest_api_id
  resource_id = aws_api_gateway_resource.v1_cloudsearch.id
  http_method = aws_api_gateway_method.v1_cloudsearch_get.http_method
  type = "AWS"
  integration_http_method = "GET"
  request_parameters = {
    "integration.request.querystring.q": "method.request.querystring.q"
  }
  uri = "arn:aws:apigateway:us-east-1:search-tags-INFO TAKEN OUT:path/2013-01-01/search"
  credentials = "arn:aws:apigateway:us-east-1::ACCOUNT TAKEN OUT:role/INFO REMOVED-cloudsearch"
}

resource "aws_api_gateway_method_response" "v1_cloudsearch_get" {
  rest_api_id = var.rest_api_id
  resource_id = aws_api_gateway_resource.v1_cloudsearch.id
  http_method = aws_api_gateway_method.v1_cloudsearch_get.http_method
  status_code = "200"
  response_parameters = {
    "method.response.header.Access-Control-Allow-Origin" = true
  }
}

resource "aws_api_gateway_request_validator" "v1_cloudsearch_get" {
  name                        = "search_validator"
  rest_api_id                 = var.rest_api_id
  validate_request_body       = true
  validate_request_parameters = true
}
```​
I get this error which is related to the URI and cannot figure out what is expected.

Error: Error creating API Gateway Deployment: BadRequestException: AWS Service of type search-tags-<INFO REMOVED> not supported

Any idea what the proper URI should be?

Please see Welcome to the forum - please reformat your message

Also please post the full multi-line error message that Terraform prints, without clipping off the useful surrounding context.

I discovered the problem by accident. The proper uri formatting is:

uri = "arn:aws:apigateway:us-east-1:search-INFO REMOVED.cloudsearch:path/2013-01-01/search"

the service name must be cloudsearch and not CloudSearch