Skip to content

Commit 60ab8b1

Browse files
committed
Update docs
1 parent 74c302e commit 60ab8b1

File tree

7 files changed

+1198
-1134
lines changed

7 files changed

+1198
-1134
lines changed

examples/existing-cluster-with-base-and-infra/README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
1-
# Existing Cluster
1+
# Existing Cluster with the AWS Observability accelerator base module and Infrastructure monitoring
22

33
---
44

5+
This example demonstrates how to use the AWS Observability Accelerator Terraform
6+
module with Infrastructure monitoring enabled.
7+
The current example deploys the [AWS Distro for OpenTelemetry Operator](https://docs.aws.amazon.com/eks/latest/userguide/opentelemetry.html) for Amazon EKS with its requirements and make use of existing
8+
Managed Service for Prometheus and Amazon Managed Grafana workspaces.
9+
10+
It also uses the `infrastructure monitoring`, one of our [workloads modules](../../modules/workloads/)
11+
to provide an existing EKS cluster with an OpenTelemetry collector,
12+
curated Grafana dashboards, Prometheus alerting and recording rules with multiple
13+
configuration options.
14+
15+
#### ⚠️ Grafana API Key
16+
17+
18+
## Prerequisites
19+
20+
1. EKS cluster
21+
2. Prometheus
22+
3. Grafana
23+
24+
## Deploy
25+
26+
```sh
27+
terraform apply
28+
```
29+
530
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
631
## Requirements
732

examples/existing-cluster-with-base-and-infra/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ module "workloads_infra" {
102102
managed_prometheus_workspace_endpoint = module.eks_observability_accelerator.managed_prometheus_workspace_endpoint
103103
managed_prometheus_workspace_region = module.eks_observability_accelerator.managed_prometheus_workspace_region
104104

105+
enable_alerting_rules = false
105106
# module custom configuration, check module documentation
106107
# config = {}
107108

modules/workloads/infra/README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,27 @@ It provides the following resources:
3535
| [aws_prometheus_rule_group_namespace.api-availability](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
3636
| [aws_prometheus_rule_group_namespace.apibr](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
3737
| [aws_prometheus_rule_group_namespace.apihg](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
38+
| [aws_prometheus_rule_group_namespace.apislos](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
39+
| [aws_prometheus_rule_group_namespace.etcd](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
40+
| [aws_prometheus_rule_group_namespace.generic](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
41+
| [aws_prometheus_rule_group_namespace.kubeapps](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
3842
| [aws_prometheus_rule_group_namespace.kubelet](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
3943
| [aws_prometheus_rule_group_namespace.kubeprom-recording](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
4044
| [aws_prometheus_rule_group_namespace.kubepromnr](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
45+
| [aws_prometheus_rule_group_namespace.kuberesources](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
4146
| [aws_prometheus_rule_group_namespace.kubescheduler](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
47+
| [aws_prometheus_rule_group_namespace.kubestm](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
48+
| [aws_prometheus_rule_group_namespace.kubestorage](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
49+
| [aws_prometheus_rule_group_namespace.kubesys](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
50+
| [aws_prometheus_rule_group_namespace.kubesysapi](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
51+
| [aws_prometheus_rule_group_namespace.kubesyschdlr](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
52+
| [aws_prometheus_rule_group_namespace.kubesyscm](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
53+
| [aws_prometheus_rule_group_namespace.kubesyskblt](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
54+
| [aws_prometheus_rule_group_namespace.kubesyskbpxy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
4255
| [aws_prometheus_rule_group_namespace.kubprom](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
4356
| [aws_prometheus_rule_group_namespace.ne](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
57+
| [aws_prometheus_rule_group_namespace.nodeexporter](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
58+
| [aws_prometheus_rule_group_namespace.nodenw](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
4459
| [aws_prometheus_rule_group_namespace.noderules](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/prometheus_rule_group_namespace) | resource |
4560
| [grafana_dashboard.alertmanager](https://registry.terraform.io/providers/grafana/grafana/1.25.0/docs/resources/dashboard) | resource |
4661
| [grafana_dashboard.apis](https://registry.terraform.io/providers/grafana/grafana/1.25.0/docs/resources/dashboard) | resource |
@@ -79,9 +94,14 @@ It provides the following resources:
7994

8095
| Name | Description | Type | Default | Required |
8196
|------|-------------|------|---------|:--------:|
82-
| <a name="input_config"></a> [config](#input\_config) | n/a | <pre>object({<br> helm_config = map(any)<br><br> enable_kube_state_metrics = bool<br> kms_create_namespace = bool<br> ksm_k8s_namespace = string<br> ksm_helm_chart_name = string<br> ksm_helm_chart_version = string<br> ksm_helm_release_name = string<br> ksm_helm_repo_url = string<br> ksm_helm_settings = map(string)<br> ksm_helm_values = map(any)<br><br> enable_node_exporter = bool<br> ne_create_namespace = bool<br> ne_k8s_namespace = string<br> ne_helm_chart_name = string<br> ne_helm_chart_version = string<br> ne_helm_release_name = string<br> ne_helm_repo_url = string<br> ne_helm_settings = map(string)<br> ne_helm_values = map(any)<br><br> enable_dashboards = bool<br><br> enable_recording_rules = bool<br> })</pre> | <pre>{<br> "enable_dashboards": true,<br> "enable_kube_state_metrics": true,<br> "enable_node_exporter": true,<br> "enable_recording_rules": true,<br> "helm_config": {},<br> "kms_create_namespace": true,<br> "ksm_helm_chart_name": "kube-state-metrics",<br> "ksm_helm_chart_version": "4.9.2",<br> "ksm_helm_release_name": "kube-state-metrics",<br> "ksm_helm_repo_url": "https://prometheus-community.github.io/helm-charts",<br> "ksm_helm_settings": {},<br> "ksm_helm_values": {},<br> "ksm_k8s_namespace": "kube-system",<br> "ne_create_namespace": true,<br> "ne_helm_chart_name": "prometheus-node-exporter",<br> "ne_helm_chart_version": "2.0.3",<br> "ne_helm_release_name": "prometheus-node-exporter",<br> "ne_helm_repo_url": "https://prometheus-community.github.io/helm-charts",<br> "ne_helm_settings": {},<br> "ne_helm_values": {},<br> "ne_k8s_namespace": "prometheus-node-exporter"<br>}</pre> | no |
97+
| <a name="input_config"></a> [config](#input\_config) | n/a | <pre>object({<br> helm_config = map(any)<br><br> kms_create_namespace = bool<br> ksm_k8s_namespace = string<br> ksm_helm_chart_name = string<br> ksm_helm_chart_version = string<br> ksm_helm_release_name = string<br> ksm_helm_repo_url = string<br> ksm_helm_settings = map(string)<br> ksm_helm_values = map(any)<br><br> ne_create_namespace = bool<br> ne_k8s_namespace = string<br> ne_helm_chart_name = string<br> ne_helm_chart_version = string<br> ne_helm_release_name = string<br> ne_helm_repo_url = string<br> ne_helm_settings = map(string)<br> ne_helm_values = map(any)<br><br> })</pre> | <pre>{<br> "enable_kube_state_metrics": true,<br> "enable_node_exporter": true,<br> "helm_config": {},<br> "kms_create_namespace": true,<br> "ksm_helm_chart_name": "kube-state-metrics",<br> "ksm_helm_chart_version": "4.9.2",<br> "ksm_helm_release_name": "kube-state-metrics",<br> "ksm_helm_repo_url": "https://prometheus-community.github.io/helm-charts",<br> "ksm_helm_settings": {},<br> "ksm_helm_values": {},<br> "ksm_k8s_namespace": "kube-system",<br> "ne_create_namespace": true,<br> "ne_helm_chart_name": "prometheus-node-exporter",<br> "ne_helm_chart_version": "2.0.3",<br> "ne_helm_release_name": "prometheus-node-exporter",<br> "ne_helm_repo_url": "https://prometheus-community.github.io/helm-charts",<br> "ne_helm_settings": {},<br> "ne_helm_values": {},<br> "ne_k8s_namespace": "prometheus-node-exporter"<br>}</pre> | no |
8398
| <a name="input_dashboards_folder_id"></a> [dashboards\_folder\_id](#input\_dashboards\_folder\_id) | n/a | `string` | n/a | yes |
8499
| <a name="input_eks_cluster_id"></a> [eks\_cluster\_id](#input\_eks\_cluster\_id) | EKS Cluster Id | `string` | n/a | yes |
100+
| <a name="input_enable_alerting_rules"></a> [enable\_alerting\_rules](#input\_enable\_alerting\_rules) | n/a | `bool` | `true` | no |
101+
| <a name="input_enable_dashboards"></a> [enable\_dashboards](#input\_enable\_dashboards) | n/a | `bool` | `true` | no |
102+
| <a name="input_enable_kube_state_metrics"></a> [enable\_kube\_state\_metrics](#input\_enable\_kube\_state\_metrics) | n/a | `bool` | `true` | no |
103+
| <a name="input_enable_node_exporter"></a> [enable\_node\_exporter](#input\_enable\_node\_exporter) | n/a | `bool` | `true` | no |
104+
| <a name="input_enable_recording_rules"></a> [enable\_recording\_rules](#input\_enable\_recording\_rules) | n/a | `bool` | `true` | no |
85105
| <a name="input_helm_config"></a> [helm\_config](#input\_helm\_config) | Helm Config for Prometheus | `any` | `{}` | no |
86106
| <a name="input_irsa_iam_permissions_boundary"></a> [irsa\_iam\_permissions\_boundary](#input\_irsa\_iam\_permissions\_boundary) | IAM permissions boundary for IRSA roles | `string` | `""` | no |
87107
| <a name="input_irsa_iam_role_path"></a> [irsa\_iam\_role\_path](#input\_irsa\_iam\_role\_path) | IAM role path for IRSA roles | `string` | `"/"` | no |

modules/workloads/infra/dashboards.tf

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,155 +1,155 @@
11
resource "grafana_dashboard" "alertmanager" {
2-
count = var.config.enable_dashboards ? 1 : 0
2+
count = var.enable_dashboards ? 1 : 0
33
folder = var.dashboards_folder_id
44
config_json = file("${path.module}/dashboards/alertmanager.json")
55
}
66

77
resource "grafana_dashboard" "workloads" {
8-
count = var.config.enable_dashboards ? 1 : 0
8+
count = var.enable_dashboards ? 1 : 0
99
folder = var.dashboards_folder_id
1010
config_json = file("${path.module}/dashboards/workloads.json")
1111
}
1212

1313
resource "grafana_dashboard" "scheduler" {
14-
count = var.config.enable_dashboards ? 1 : 0
14+
count = var.enable_dashboards ? 1 : 0
1515
folder = var.dashboards_folder_id
1616
config_json = file("${path.module}/dashboards/scheduler.json")
1717
}
1818

1919
resource "grafana_dashboard" "proxy" {
20-
count = var.config.enable_dashboards ? 1 : 0
20+
count = var.enable_dashboards ? 1 : 0
2121
folder = var.dashboards_folder_id
2222
config_json = file("${path.module}/dashboards/proxy.json")
2323
}
2424

2525
resource "grafana_dashboard" "prometheus" {
26-
count = var.config.enable_dashboards ? 1 : 0
26+
count = var.enable_dashboards ? 1 : 0
2727
folder = var.dashboards_folder_id
2828
config_json = file("${path.module}/dashboards/prometheus.json")
2929
}
3030

3131
resource "grafana_dashboard" "podnetwork" {
32-
count = var.config.enable_dashboards ? 1 : 0
32+
count = var.enable_dashboards ? 1 : 0
3333
folder = var.dashboards_folder_id
3434
config_json = file("${path.module}/dashboards/pods-networking.json")
3535
}
3636

3737
resource "grafana_dashboard" "pods" {
38-
count = var.config.enable_dashboards ? 1 : 0
38+
count = var.enable_dashboards ? 1 : 0
3939
folder = var.dashboards_folder_id
4040
config_json = file("${path.module}/dashboards/pods.json")
4141
}
4242

4343
resource "grafana_dashboard" "pv" {
44-
count = var.config.enable_dashboards ? 1 : 0
44+
count = var.enable_dashboards ? 1 : 0
4545
folder = var.dashboards_folder_id
4646
config_json = file("${path.module}/dashboards/pesistentvolumes.json")
4747
}
4848

4949
resource "grafana_dashboard" "nodes" {
50-
count = var.config.enable_dashboards ? 1 : 0
50+
count = var.enable_dashboards ? 1 : 0
5151
folder = var.dashboards_folder_id
5252
config_json = file("${path.module}/dashboards/nodes.json")
5353
}
5454

5555
resource "grafana_dashboard" "necluster" {
56-
count = var.config.enable_dashboards ? 1 : 0
56+
count = var.enable_dashboards ? 1 : 0
5757
folder = var.dashboards_folder_id
5858
config_json = file("${path.module}/dashboards/nodeexpoter-use-cluster.json")
5959
}
6060

6161
resource "grafana_dashboard" "nenodeuse" {
62-
count = var.config.enable_dashboards ? 1 : 0
62+
count = var.enable_dashboards ? 1 : 0
6363
folder = var.dashboards_folder_id
6464
config_json = file("${path.module}/dashboards/nodeexporter-use-node.json")
6565
}
6666

6767
resource "grafana_dashboard" "nenode" {
68-
count = var.config.enable_dashboards ? 1 : 0
68+
count = var.enable_dashboards ? 1 : 0
6969
folder = var.dashboards_folder_id
7070
config_json = file("${path.module}/dashboards/nodeexporter-nodes.json")
7171
}
7272

7373
resource "grafana_dashboard" "nwworload" {
74-
count = var.config.enable_dashboards ? 1 : 0
74+
count = var.enable_dashboards ? 1 : 0
7575
folder = var.dashboards_folder_id
7676
config_json = file("${path.module}/dashboards/networking-workloads.json")
7777
}
7878

7979
resource "grafana_dashboard" "nsworkload" {
80-
count = var.config.enable_dashboards ? 1 : 0
80+
count = var.enable_dashboards ? 1 : 0
8181
folder = var.dashboards_folder_id
8282
config_json = file("${path.module}/dashboards/namespace-workloads.json")
8383
}
8484

8585
resource "grafana_dashboard" "nspods" {
86-
count = var.config.enable_dashboards ? 1 : 0
86+
count = var.enable_dashboards ? 1 : 0
8787
folder = var.dashboards_folder_id
8888
config_json = file("${path.module}/dashboards/namespace-pods.json")
8989
}
9090

9191
resource "grafana_dashboard" "nsnwworkload" {
92-
count = var.config.enable_dashboards ? 1 : 0
92+
count = var.enable_dashboards ? 1 : 0
9393
folder = var.dashboards_folder_id
9494
config_json = file("${path.module}/dashboards/namespace-nw-workloads.json")
9595
}
9696

9797
resource "grafana_dashboard" "nsnw" {
98-
count = var.config.enable_dashboards ? 1 : 0
98+
count = var.enable_dashboards ? 1 : 0
9999
folder = var.dashboards_folder_id
100100
config_json = file("${path.module}/dashboards/namespace-networking.json")
101101
}
102102

103103
resource "grafana_dashboard" "macos" {
104-
count = var.config.enable_dashboards ? 1 : 0
104+
count = var.enable_dashboards ? 1 : 0
105105
folder = var.dashboards_folder_id
106106
config_json = file("${path.module}/dashboards/macos.json")
107107
}
108108

109109
resource "grafana_dashboard" "kubelet" {
110-
count = var.config.enable_dashboards ? 1 : 0
110+
count = var.enable_dashboards ? 1 : 0
111111
folder = var.dashboards_folder_id
112112
config_json = file("${path.module}/dashboards/kubelet.json")
113113
}
114114

115115
resource "grafana_dashboard" "grafana" {
116-
count = var.config.enable_dashboards ? 1 : 0
116+
count = var.enable_dashboards ? 1 : 0
117117
folder = var.dashboards_folder_id
118118
config_json = file("${path.module}/dashboards/grafana.json")
119119
}
120120

121121
resource "grafana_dashboard" "etcd" {
122-
count = var.config.enable_dashboards ? 1 : 0
122+
count = var.enable_dashboards ? 1 : 0
123123
folder = var.dashboards_folder_id
124124
config_json = file("${path.module}/dashboards/etcd.json")
125125
}
126126

127127
resource "grafana_dashboard" "coredns" {
128-
count = var.config.enable_dashboards ? 1 : 0
128+
count = var.enable_dashboards ? 1 : 0
129129
folder = var.dashboards_folder_id
130130
config_json = file("${path.module}/dashboards/coredns.json")
131131
}
132132

133133
resource "grafana_dashboard" "controller" {
134-
count = var.config.enable_dashboards ? 1 : 0
134+
count = var.enable_dashboards ? 1 : 0
135135
folder = var.dashboards_folder_id
136136
config_json = file("${path.module}/dashboards/controller.json")
137137
}
138138

139139
resource "grafana_dashboard" "clusternw" {
140-
count = var.config.enable_dashboards ? 1 : 0
140+
count = var.enable_dashboards ? 1 : 0
141141
folder = var.dashboards_folder_id
142142
config_json = file("${path.module}/dashboards/cluster-networking.json")
143143
}
144144

145145
resource "grafana_dashboard" "cluster" {
146-
count = var.config.enable_dashboards ? 1 : 0
146+
count = var.enable_dashboards ? 1 : 0
147147
folder = var.dashboards_folder_id
148148
config_json = file("${path.module}/dashboards/cluster.json")
149149
}
150150

151151
resource "grafana_dashboard" "apis" {
152-
count = var.config.enable_dashboards ? 1 : 0
152+
count = var.enable_dashboards ? 1 : 0
153153
folder = var.dashboards_folder_id
154154
config_json = file("${path.module}/dashboards/apiserver.json")
155155
}

modules/workloads/infra/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ terraform {
88
}
99

1010
resource "helm_release" "kube_state_metrics" {
11-
count = var.config.enable_kube_state_metrics ? 1 : 0
11+
count = var.enable_kube_state_metrics ? 1 : 0
1212
chart = var.config.ksm_helm_chart_name
1313
create_namespace = var.config.kms_create_namespace
1414
namespace = var.config.ksm_k8s_namespace
@@ -26,7 +26,7 @@ resource "helm_release" "kube_state_metrics" {
2626
}
2727

2828
resource "helm_release" "prometheus_node_exporter" {
29-
count = var.config.enable_node_exporter ? 1 : 0
29+
count = var.enable_node_exporter ? 1 : 0
3030
chart = var.config.ne_helm_chart_name
3131
create_namespace = var.config.ne_create_namespace
3232
namespace = var.config.ne_k8s_namespace

0 commit comments

Comments
 (0)