-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_gateway.tf
More file actions
29 lines (26 loc) · 1 KB
/
api_gateway.tf
File metadata and controls
29 lines (26 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
resource "aws_apigatewayv2_api" "hackathon_api" {
name = "hackathon-api"
protocol_type = "HTTP"
tags = var.tags
}
resource "aws_apigatewayv2_integration" "ingress_backend" {
depends_on = [helm_release.nginx_ingress]
api_id = aws_apigatewayv2_api.hackathon_api.id
integration_type = "HTTP_PROXY"
integration_uri = "http://${data.kubernetes_service.nginx_ingress.status[0].load_balancer[0].ingress[0].hostname}"
integration_method = "ANY"
payload_format_version = "1.0"
request_parameters = {
"overwrite:path" = "/video2frames/$${request.path.proxy}"
}
}
resource "aws_apigatewayv2_route" "backend_routes" {
api_id = aws_apigatewayv2_api.hackathon_api.id
route_key = "ANY /video2frames/{proxy+}"
target = "integrations/${aws_apigatewayv2_integration.ingress_backend.id}"
}
resource "aws_apigatewayv2_stage" "default" {
api_id = aws_apigatewayv2_api.hackathon_api.id
name = "$default"
auto_deploy = true
}