mirror of
https://github.com/projecthorus/sondehub-infra.git
synced 2025-02-20 17:12:50 +00:00
fix listener stats
This commit is contained in:
parent
d358655a93
commit
3bdb6b5ac9
26
cdn.tf
26
cdn.tf
@ -570,6 +570,32 @@ resource "aws_cloudfront_distribution" "api" {
|
||||
target_origin_id = "Custom-api.${local.domain_name}"
|
||||
viewer_protocol_policy = "redirect-to-https"
|
||||
}
|
||||
ordered_cache_behavior {
|
||||
allowed_methods = ["GET", "HEAD", "OPTIONS"]
|
||||
cached_methods = [
|
||||
"HEAD",
|
||||
"GET"
|
||||
]
|
||||
compress = true
|
||||
default_ttl = 300
|
||||
forwarded_values {
|
||||
cookies {
|
||||
forward = "none"
|
||||
}
|
||||
headers = [
|
||||
"Origin",
|
||||
"Access-Control-Request-Method",
|
||||
"Access-Control-Request-Headers"
|
||||
]
|
||||
query_string = false
|
||||
}
|
||||
max_ttl = 300
|
||||
min_ttl = 300
|
||||
path_pattern = "listeners/stats"
|
||||
smooth_streaming = false
|
||||
target_origin_id = "Custom-api.${local.domain_name}"
|
||||
viewer_protocol_policy = "redirect-to-https"
|
||||
}
|
||||
comment = ""
|
||||
price_class = "PriceClass_100"
|
||||
enabled = true
|
||||
|
17
query.tf
17
query.tf
@ -132,6 +132,13 @@ resource "aws_lambda_permission" "get_sites" {
|
||||
source_arn = "arn:aws:execute-api:us-east-1:${data.aws_caller_identity.current.account_id}:${aws_apigatewayv2_api.main.id}/*/*/sites"
|
||||
}
|
||||
|
||||
resource "aws_lambda_permission" "get_listeners_stats" {
|
||||
action = "lambda:InvokeFunction"
|
||||
function_name = aws_lambda_function.get_listener_stats.arn
|
||||
principal = "apigateway.amazonaws.com"
|
||||
source_arn = "arn:aws:execute-api:us-east-1:${data.aws_caller_identity.current.account_id}:${aws_apigatewayv2_api.main.id}/*/*/listeners/stats"
|
||||
}
|
||||
|
||||
resource "aws_lambda_permission" "get_listener_stats" {
|
||||
action = "lambda:InvokeFunction"
|
||||
function_name = aws_lambda_function.get_listener_stats.arn
|
||||
@ -141,6 +148,7 @@ resource "aws_lambda_permission" "get_listener_stats" {
|
||||
|
||||
|
||||
|
||||
|
||||
resource "aws_lambda_permission" "get_telem" {
|
||||
action = "lambda:InvokeFunction"
|
||||
function_name = aws_lambda_function.get_telem.arn
|
||||
@ -171,6 +179,14 @@ resource "aws_apigatewayv2_route" "get_sites" {
|
||||
}
|
||||
|
||||
|
||||
resource "aws_apigatewayv2_route" "get_listeners_stats" {
|
||||
api_id = aws_apigatewayv2_api.main.id
|
||||
api_key_required = false
|
||||
authorization_type = "NONE"
|
||||
route_key = "GET /listeners/stats"
|
||||
target = "integrations/${aws_apigatewayv2_integration.get_listener_stats.id}"
|
||||
}
|
||||
|
||||
resource "aws_apigatewayv2_route" "get_listener_stats" {
|
||||
api_id = aws_apigatewayv2_api.main.id
|
||||
api_key_required = false
|
||||
@ -181,7 +197,6 @@ resource "aws_apigatewayv2_route" "get_listener_stats" {
|
||||
|
||||
|
||||
|
||||
|
||||
resource "aws_apigatewayv2_route" "get_telem" {
|
||||
api_id = aws_apigatewayv2_api.main.id
|
||||
api_key_required = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user