title: Terraform - what is the URI to invoke lambda via alias?
body: <h1>Question</h1>
  
  <p>To invoke a Lambda from API GW, <a href="https://www.terraform.io/docs/providers/aws/d/lambda_function.html#invoke_arn" rel="nofollow noreferrer">invoke_arn</a> can be used for aws_lambda_function resources.</p>
  
  <blockquote>
    <p>invoke_arn - The ARN to be used for invoking Lambda Function from API Gateway.</p>
  </blockquote>
  
  <pre><code>resource "aws_api_gateway_integration" "videos" {
    rest_api_id = "${aws_api_gateway_rest_api.24_hour_video.id}"
    resource_id = "${aws_api_gateway_method.videos_get.resource_id}"
    http_method = "${aws_api_gateway_method.videos_get.http_method}"
  
    integration_http_method = "GET"
    type                    = "AWS_PROXY"  # Lambda Proxy
    uri                     = "${aws_lambda_function.list_videos.invoke_arn}"
  }
  </code></pre>
  
  <p>What is to set in <strong>uri</strong> to invoke the same lambda via an alias? </p>
  
  <pre><code>resource "aws_lambda_alias" "lambda_alias_list_videos" {
    name             = "get_video_list"
    description      = "Alias to lambda_list_videos"
    function_name    = "${aws_lambda_function.list_videos.arn}"
    function_version = "$LATEST"
  }
  </code></pre>