This repository provides Terraform code that can be used to create a demonstration environment for the article Transforming Amazon API Gateway Access Log Into Prometheus Metrics. The code provisions the necessary resources using Terraform to set up the environment for the demo.
Grafana dashboard: Amazon API Gateway
Name | Version |
---|---|
terraform | ~> 1.5.0 |
aws | ~> 5.5.0 |
Name | Version |
---|---|
aws | 5.5.0 |
Name | Source | Version |
---|---|---|
alb_sg | terraform-aws-modules/security-group/aws | 5.1.0 |
apigw_access_log_function | terraform-aws-modules/lambda/aws | 5.0.0 |
grafana_sg | terraform-aws-modules/security-group/aws | 5.1.0 |
mirror_http_server_sg | terraform-aws-modules/security-group/aws | 5.1.0 |
prometheus_sg | terraform-aws-modules/security-group/aws | 5.1.0 |
vector_sg | terraform-aws-modules/security-group/aws | 5.1.0 |
vpc_link_sg | terraform-aws-modules/security-group/aws | 5.1.0 |
Name | Type |
---|---|
aws_api_gateway_account.this | resource |
aws_api_gateway_deployment.prod | resource |
aws_api_gateway_integration.this | resource |
aws_api_gateway_method.any | resource |
aws_api_gateway_resource.proxy | resource |
aws_api_gateway_rest_api.rest_apigw | resource |
aws_api_gateway_stage.prod | resource |
aws_api_gateway_vpc_link.rest_apigw_vpc_link | resource |
aws_apigatewayv2_api.http_apigw | resource |
aws_apigatewayv2_integration.private_alb_integration | resource |
aws_apigatewayv2_route.root_proxy | resource |
aws_apigatewayv2_stage.default | resource |
aws_apigatewayv2_vpc_link.http_apigw_vpc_link | resource |
aws_cloudwatch_log_group.apigw_access_log | resource |
aws_cloudwatch_log_group.ecs_log | resource |
aws_cloudwatch_log_subscription_filter.eu_apigw_access_log | resource |
aws_ecs_cluster.this | resource |
aws_ecs_service.grafana | resource |
aws_ecs_service.mirror_http_server | resource |
aws_ecs_service.prometheus | resource |
aws_ecs_service.vector | resource |
aws_ecs_task_definition.grafana | resource |
aws_ecs_task_definition.mirror_http_server | resource |
aws_ecs_task_definition.prometheus | resource |
aws_ecs_task_definition.vector | resource |
aws_iam_role.cloudwatch | resource |
aws_iam_role.ecs_task_role | resource |
aws_iam_role.vector_ecs_task_role | resource |
aws_iam_role_policy.cloudwatch | resource |
aws_iam_role_policy.vector_sqs | resource |
aws_iam_role_policy_attachment.ecs_task_role_policy | resource |
aws_iam_role_policy_attachment.vector_ecs_task_role_policy | resource |
aws_lambda_permission.cloudwatch_logs | resource |
aws_lb.external | resource |
aws_lb.internal_nlb | resource |
aws_lb_listener.grafana | resource |
aws_lb_listener.mirror_http_server | resource |
aws_lb_listener.prometheus | resource |
aws_lb_listener.vector | resource |
aws_lb_target_group.grafana | resource |
aws_lb_target_group.mirror_http_server | resource |
aws_lb_target_group.prometheus | resource |
aws_lb_target_group.vector | resource |
aws_sqs_queue.apigw_access_log | resource |
aws_caller_identity.current | data source |
aws_iam_policy_document.assume_role | data source |
aws_iam_policy_document.cloudwatch | data source |
aws_iam_policy_document.vector_sqs | data source |
aws_region.current | data source |
aws_vpc.selected | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
aws_region | The AWS region where resources created | string |
"us-east-1" |
no |
private_subnet_ids | Subnet IDs where resources created | list(string) |
n/a | yes |
public_subnet_ids | Subnet IDs where resources created | list(string) |
n/a | yes |
vpc_id | VPC ID | string |
n/a | yes |
Name | Description |
---|---|
http_api_gateway_url | HTTP API Gateway URL |
rest_api_gateway_url | REST API Gateway URL |