diff --git a/modules/core/elb.tf b/modules/core/elb.tf index d1b32ff4..a0e2b6c1 100644 --- a/modules/core/elb.tf +++ b/modules/core/elb.tf @@ -110,8 +110,9 @@ resource "aws_lb_listener_rule" "nomad_server" { } condition { - field = "host-header" - values = [var.nomad_api_domain] + host-header { + values = [var.nomad_api_domain] + } } } @@ -209,8 +210,9 @@ resource "aws_lb_listener_rule" "consul_server" { } condition { - field = "host-header" - values = [var.consul_api_domain] + host-header { + values = [var.consul_api_domain] + } } } @@ -307,8 +309,9 @@ resource "aws_lb_listener_rule" "vault" { } condition { - field = "host-header" - values = [var.vault_api_domain] + host-header { + values = [var.vault_api_domain] + } } } diff --git a/modules/ecr/route53.tf b/modules/ecr/route53.tf index d0ac36c6..eba9050d 100644 --- a/modules/ecr/route53.tf +++ b/modules/ecr/route53.tf @@ -29,7 +29,8 @@ resource "aws_lb_listener_rule" "redirect" { } condition { - field = "host-header" - values = [aws_route53_record.redirect[0].fqdn] + host-header { + values = [aws_route53_record.redirect[0].fqdn] + } } } diff --git a/modules/elasticsearch_post/redirect.tf b/modules/elasticsearch_post/redirect.tf index a7282214..65a8ef7f 100644 --- a/modules/elasticsearch_post/redirect.tf +++ b/modules/elasticsearch_post/redirect.tf @@ -32,7 +32,8 @@ resource "aws_lb_listener_rule" "redirect" { } condition { - field = "host-header" - values = [aws_route53_record.redirect[0].fqdn] + host-header { + values = [aws_route53_record.redirect[0].fqdn] + } } } diff --git a/modules/lambda-api-gateway/api-gateway.tf b/modules/lambda-api-gateway/api-gateway.tf index aaf326f5..8ee34bd6 100644 --- a/modules/lambda-api-gateway/api-gateway.tf +++ b/modules/lambda-api-gateway/api-gateway.tf @@ -1,9 +1,13 @@ resource "aws_api_gateway_api_key" "ApiKey" { name = var.api_key_name +} + +resource "aws_api_gateway_usage_plan" "ApiKey" { + name = var.api_key_name - stage_key { - rest_api_id = aws_api_gateway_rest_api.api-gateway.id - stage_name = aws_api_gateway_deployment.api-gateway-deployment.stage_name + api_stages { + api_id = aws_api_gateway_rest_api.api-gateway.id + stage = aws_api_gateway_deployment.api-gateway-deployment.stage_name } } diff --git a/modules/traefik/main.tf b/modules/traefik/main.tf index b9ba5614..adbebe53 100644 --- a/modules/traefik/main.tf +++ b/modules/traefik/main.tf @@ -94,7 +94,8 @@ resource "aws_lb_listener_rule" "traefik_ui" { } condition { - field = "host-header" - values = [var.traefik_ui_domain] + host-header { + values = [var.traefik_ui_domain] + } } }