Skip to content

chasezheng/terraform-aws-eks-monitoring

 
 

Repository files navigation

terraform-aws-eks-monitoring

Deploys the "Grafana + Prometheus + Loki" monitoring stack via Helm on AWS EKS.

Usage

Example:

module "monitoring" {
  source = "github.com/andreswebs/terraform-aws-eks-monitoring"

  cluster_oidc_provider = var.eks_cluster_oidc_provider

  loki_iam_role_name           = "loki-${var.eks_cluster_id}"
  loki_compactor_iam_role_name = "loki-compactor-${var.eks_cluster_id}"
  grafana_iam_role_name        = "grafana-${var.eks_cluster_id}"

  loki_storage_s3_bucket_name = var.loki_storage_s3_bucket_name

  chart_version_loki_distributed = var.chart_version_loki_distributed
  chart_version_promtail         = var.chart_version_promtail
  chart_version_prometheus       = var.chart_version_prometheus

  grafana_enabled = true

}

Inputs

Name Description Type Default Required
chart_version_fluent_bit Chart version string null no
chart_version_grafana Chart version string null no
chart_version_loki Chart version string null no
chart_version_loki_distributed Chart version string null no
chart_version_metrics_server Chart version string null no
chart_version_prometheus Chart version string null no
chart_version_promtail Chart version string null no
cluster_oidc_provider OpenID Connect (OIDC) Identity Provider associated with the Kubernetes cluster string "" no
create_loki_storage Create S3 bucket for Loki storage? bool false no
create_loki_storage_id_suffix Append a random identifier string suffix to the Loki storage S3 bucket name? bool false no
create_loki_storage_kms_key Create KMS key? bool true no
grafana_enabled Enable Grafana? bool false no
grafana_k8s_sa_name Name of the Kubernetes service account for Grafana string "grafana" no
k8s_namespace Name of the Kubernetes namespace to which resources will be deployed string "monitoring" no
loki_aggregator Loki aggregator to install, must be either promtail or fluent-bit string "promtail" no
loki_compactor_k8s_sa_name Name of the Kubernetes service account for the Loki compactor string "loki-compactor" no
loki_enabled Enable Loki? bool true no
loki_k8s_sa_name Name of the Kubernetes service account for Loki components string "loki" no
loki_mode Loki mode, must be either single or distributed string "distributed" no
loki_storage_expiration_days Number of days to retain objects; 0 means never expire number 0 no
loki_storage_kms_key_arn (Optional) ARN of KMS key used to encrypt bucket objects; ignored if create_kms_key is set to true string null no
loki_storage_kms_key_deletion_window_in_days KMS key deletion window in days number 30 no
loki_storage_kms_key_enable_rotation Enable KMS key rotation? bool true no
loki_storage_s3_bucket_name Name of S3 bucket used for Loki storage string "" no
loki_storage_s3_force_destroy Force destroy bucket when running terraform destroy? bool false no
metrics_server_enabled Enable Metrics Server? bool true no
prometheus_enabled Enable Prometheus? bool true no

Modules

Name Source Version
iam ./modules/iam n/a
log_storage ./modules/storage n/a
resources ./modules/resources n/a

Outputs

Name Description
namespace The name (metadata.name) of the namespace

Providers

Name Version
random >= 3.1.0

Requirements

Name Version
terraform >= 1.0.0
aws >= 3.48.0
helm >= 2.2.0
random >= 3.1.0

Resources

Name Type
random_id.id resource

Authors

Andre Silva - @andreswebs

License

This project is licensed under the Unlicense.

About

Deploys Prometheus, Grafana, Loki and Promtail on AWS EKS via Helm

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 86.3%
  • Smarty 13.7%