title: How do I create an API Proxy using Terraform and AWS API Gateway
body: <p>I am trying to use Terraform to be able to stand up a simple API Proxy in API Gateway on AWS.  Basically, I want to wrap root and proxy the requests back to another end point.  Its probably the simplest setup and I can't seem to get it to work in Terraform.  </p>
  
  <p>Below you will find the script.  At this point I am able to create the REST API, define a Resource, create a method but there doesn't seem to be any way to define it the end-point.</p>
  
  <pre><code>provider "aws" {
      region = "us-east-1"
  }
  resource "aws_api_gateway_rest_api" "TerraTest" {
    name = "TerraTest"
    description = "This is my API for demonstration purposes"
  }
  
  resource "aws_api_gateway_resource" "TerraProxyResource" {
    rest_api_id = "${aws_api_gateway_rest_api.TerraTest.id}"
    parent_id = "${aws_api_gateway_rest_api.TerraTest.root_resource_id}"
    path_part = "{proxy+}"
  }
  
  resource "aws_api_gateway_integration" "integration" {
      rest_api_id = "${aws_api_gateway_rest_api.TerraTest.id}"
      resource_id = "${aws_api_gateway_resource.TerraProxyResource.id}"
      http_method = "${aws_api_gateway_method.mymethod.http_method}"
  
      type = "HTTP_PROXY"
      uri = "http://api.endpoint.com/{proxy+}"
  }
  </code></pre>
  
  <p>Here I set the type to proxy, but I don't think URI is the right property for setting the endpoint.</p>
  
  <pre><code>resource "aws_api_gateway_method" "mymethod" {
    rest_api_id = "${aws_api_gateway_rest_api.TerraTest.id}"
    resource_id = "${aws_api_gateway_resource.TerraProxyResource.id}"
    http_method = "ANY"
    authorization = "NONE"
  }
  </code></pre>
  
  <p>I expect somewhere here to be able to create that mapping to some other endpoint, but there doesn't appear to be any properties for that. (<a href="https://github.com/hashicorp/terraform/blob/master/builtin/providers/aws/resource_aws_api_gateway_method.go" rel="noreferrer">https://github.com/hashicorp/terraform/blob/master/builtin/providers/aws/resource_aws_api_gateway_method.go</a>)    </p>
  
  <pre><code>resource "aws_api_gateway_api_key" "TerraTestKey" {
    name = "Terra_Test_Key"
  
    stage_key {
      rest_api_id = "${aws_api_gateway_rest_api.TerraTest.id}"
      stage_name = "${aws_api_gateway_deployment.TerraTestDeployment.stage_name}"
    }
  }
  
  
  resource "aws_api_gateway_deployment" "TerraTestDeployment" {
    rest_api_id = "${aws_api_gateway_rest_api.TerraTest.id}"
    stage_name = "dev"
  }
  </code></pre>
  
  <p>I scanned the source code and I didn't see any properties that I can set.  </p>
  
  <p>Can anyone share any advice/snipets?</p>
  
  <p>Tim</p>
  
  <p>Ps. If you want to try to run the script yourself, I put it here:  <a href="http://textuploader.com/d14sx" rel="noreferrer">http://textuploader.com/d14sx</a></p>