Finally, we need to trigger the function with API Gateway:
- Create a movies resource on the REST API and expose a GET method on it. If the incoming requests match the resource defined, it will call the Lambda function defined earlier:
resource "aws_api_gateway_rest_api" "api" { name = "MoviesAPI"}resource "aws_api_gateway_resource" "proxy" { rest_api_id = "${aws_api_gateway_rest_api.api.id}" parent_id = "${aws_api_gateway_rest_api.api.root_resource_id}" path_part = "movies"}resource "aws_api_gateway_method" "proxy" { rest_api_id = "${aws_api_gateway_rest_api.api.id}" resource_id = "${aws_api_gateway_resource.proxy.id}" http_method = "GET" authorization = "NONE"}resource "aws_api_gateway_integration" "lambda" { rest_api_id ...