Using the old resource “aws_api_gateway_rest_api”, you could link to a private vpc endpoint using a configuration similar to the following.
resource "aws_api_gateway_rest_api" "example" {
// The bulk of this resource's body was omitted for brevity
endpoint_configuration {
types = ["PRIVATE"]
vpc_endpoint_ids = [aws_vpc_endpoint.example[0].id]
}
}
Similarly in the AWS console you can select “Rest API Private” when creating a new API Gateway resource:
Using the new API Gateway V2 resources, how do I configure my API Gateway in a similar way?
All the documentation I could find is referencing the old (non V2 resources), or non-terraform infrastructure management (AWS CLI, AWS Console, etc.)