From 92f4bbafead6f30f4c452eaf4a7dac4bdaa181e4 Mon Sep 17 00:00:00 2001 From: Aniket Rao Date: Wed, 15 Dec 2021 13:26:53 +0530 Subject: [PATCH 1/4] refactor and version aws cloudwatch modules --- .gitignore | 1 + modules/aws/{ => alb/1.0}/alb_cloudwatch.hcl | 0 modules/aws/{ => apigw/1.0}/apigateway_cloudwatch.hcl | 0 modules/aws/{ => aurora/1.0}/aurora_cloudwatch.hcl | 0 modules/aws/{ => cloudfront/1.0}/cloudfront_cloudwatch.hcl | 0 modules/aws/{ => dax/1.0}/dax_cloudwatch.hcl | 0 modules/aws/{ => dynamodb/1.0}/dynamodb_cloudwatch.hcl | 0 modules/aws/{ => ec2/1.0}/ec2_cloudwatch.hcl | 0 modules/aws/{ => eks/1.0}/eks_ci_k8s_deployment_cloudwatch.hcl | 0 modules/aws/{ => eks/1.0}/eks_ci_k8s_service_cloudwatch.hcl | 0 modules/aws/{ => eks/1.0}/eks_containerinsights_cloudwatch.hcl | 0 modules/aws/{ => elasticache/1.0}/elasticache_cloudwatch.hcl | 0 modules/aws/{ => elasticsearch/1.0}/elasticsearch_cloudwatch.hcl | 0 modules/aws/{ => elb/1.0}/elb_cloudwatch.hcl | 0 modules/aws/{ => lambda/1.0}/lambda_cloudwatch.hcl | 0 modules/aws/{ => msk/1.0}/msk_cloudwatch.hcl | 0 modules/aws/{ => msk/1.0}/msk_with_tags_cloudwatch.hcl | 0 modules/aws/{ => nlb/1.0}/nlb_cloudwatch.hcl | 0 modules/aws/{ => rds/1.0}/rds_cloudwatch.hcl | 0 modules/aws/{ => sqs/1.0}/sqs_cloudwatch.hcl | 0 20 files changed, 1 insertion(+) create mode 100644 .gitignore rename modules/aws/{ => alb/1.0}/alb_cloudwatch.hcl (100%) rename modules/aws/{ => apigw/1.0}/apigateway_cloudwatch.hcl (100%) rename modules/aws/{ => aurora/1.0}/aurora_cloudwatch.hcl (100%) rename modules/aws/{ => cloudfront/1.0}/cloudfront_cloudwatch.hcl (100%) rename modules/aws/{ => dax/1.0}/dax_cloudwatch.hcl (100%) rename modules/aws/{ => dynamodb/1.0}/dynamodb_cloudwatch.hcl (100%) rename modules/aws/{ => ec2/1.0}/ec2_cloudwatch.hcl (100%) rename modules/aws/{ => eks/1.0}/eks_ci_k8s_deployment_cloudwatch.hcl (100%) rename modules/aws/{ => eks/1.0}/eks_ci_k8s_service_cloudwatch.hcl (100%) rename modules/aws/{ => eks/1.0}/eks_containerinsights_cloudwatch.hcl (100%) rename modules/aws/{ => elasticache/1.0}/elasticache_cloudwatch.hcl (100%) rename modules/aws/{ => elasticsearch/1.0}/elasticsearch_cloudwatch.hcl (100%) rename modules/aws/{ => elb/1.0}/elb_cloudwatch.hcl (100%) rename modules/aws/{ => lambda/1.0}/lambda_cloudwatch.hcl (100%) rename modules/aws/{ => msk/1.0}/msk_cloudwatch.hcl (100%) rename modules/aws/{ => msk/1.0}/msk_with_tags_cloudwatch.hcl (100%) rename modules/aws/{ => nlb/1.0}/nlb_cloudwatch.hcl (100%) rename modules/aws/{ => rds/1.0}/rds_cloudwatch.hcl (100%) rename modules/aws/{ => sqs/1.0}/sqs_cloudwatch.hcl (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/modules/aws/alb_cloudwatch.hcl b/modules/aws/alb/1.0/alb_cloudwatch.hcl similarity index 100% rename from modules/aws/alb_cloudwatch.hcl rename to modules/aws/alb/1.0/alb_cloudwatch.hcl diff --git a/modules/aws/apigateway_cloudwatch.hcl b/modules/aws/apigw/1.0/apigateway_cloudwatch.hcl similarity index 100% rename from modules/aws/apigateway_cloudwatch.hcl rename to modules/aws/apigw/1.0/apigateway_cloudwatch.hcl diff --git a/modules/aws/aurora_cloudwatch.hcl b/modules/aws/aurora/1.0/aurora_cloudwatch.hcl similarity index 100% rename from modules/aws/aurora_cloudwatch.hcl rename to modules/aws/aurora/1.0/aurora_cloudwatch.hcl diff --git a/modules/aws/cloudfront_cloudwatch.hcl b/modules/aws/cloudfront/1.0/cloudfront_cloudwatch.hcl similarity index 100% rename from modules/aws/cloudfront_cloudwatch.hcl rename to modules/aws/cloudfront/1.0/cloudfront_cloudwatch.hcl diff --git a/modules/aws/dax_cloudwatch.hcl b/modules/aws/dax/1.0/dax_cloudwatch.hcl similarity index 100% rename from modules/aws/dax_cloudwatch.hcl rename to modules/aws/dax/1.0/dax_cloudwatch.hcl diff --git a/modules/aws/dynamodb_cloudwatch.hcl b/modules/aws/dynamodb/1.0/dynamodb_cloudwatch.hcl similarity index 100% rename from modules/aws/dynamodb_cloudwatch.hcl rename to modules/aws/dynamodb/1.0/dynamodb_cloudwatch.hcl diff --git a/modules/aws/ec2_cloudwatch.hcl b/modules/aws/ec2/1.0/ec2_cloudwatch.hcl similarity index 100% rename from modules/aws/ec2_cloudwatch.hcl rename to modules/aws/ec2/1.0/ec2_cloudwatch.hcl diff --git a/modules/aws/eks_ci_k8s_deployment_cloudwatch.hcl b/modules/aws/eks/1.0/eks_ci_k8s_deployment_cloudwatch.hcl similarity index 100% rename from modules/aws/eks_ci_k8s_deployment_cloudwatch.hcl rename to modules/aws/eks/1.0/eks_ci_k8s_deployment_cloudwatch.hcl diff --git a/modules/aws/eks_ci_k8s_service_cloudwatch.hcl b/modules/aws/eks/1.0/eks_ci_k8s_service_cloudwatch.hcl similarity index 100% rename from modules/aws/eks_ci_k8s_service_cloudwatch.hcl rename to modules/aws/eks/1.0/eks_ci_k8s_service_cloudwatch.hcl diff --git a/modules/aws/eks_containerinsights_cloudwatch.hcl b/modules/aws/eks/1.0/eks_containerinsights_cloudwatch.hcl similarity index 100% rename from modules/aws/eks_containerinsights_cloudwatch.hcl rename to modules/aws/eks/1.0/eks_containerinsights_cloudwatch.hcl diff --git a/modules/aws/elasticache_cloudwatch.hcl b/modules/aws/elasticache/1.0/elasticache_cloudwatch.hcl similarity index 100% rename from modules/aws/elasticache_cloudwatch.hcl rename to modules/aws/elasticache/1.0/elasticache_cloudwatch.hcl diff --git a/modules/aws/elasticsearch_cloudwatch.hcl b/modules/aws/elasticsearch/1.0/elasticsearch_cloudwatch.hcl similarity index 100% rename from modules/aws/elasticsearch_cloudwatch.hcl rename to modules/aws/elasticsearch/1.0/elasticsearch_cloudwatch.hcl diff --git a/modules/aws/elb_cloudwatch.hcl b/modules/aws/elb/1.0/elb_cloudwatch.hcl similarity index 100% rename from modules/aws/elb_cloudwatch.hcl rename to modules/aws/elb/1.0/elb_cloudwatch.hcl diff --git a/modules/aws/lambda_cloudwatch.hcl b/modules/aws/lambda/1.0/lambda_cloudwatch.hcl similarity index 100% rename from modules/aws/lambda_cloudwatch.hcl rename to modules/aws/lambda/1.0/lambda_cloudwatch.hcl diff --git a/modules/aws/msk_cloudwatch.hcl b/modules/aws/msk/1.0/msk_cloudwatch.hcl similarity index 100% rename from modules/aws/msk_cloudwatch.hcl rename to modules/aws/msk/1.0/msk_cloudwatch.hcl diff --git a/modules/aws/msk_with_tags_cloudwatch.hcl b/modules/aws/msk/1.0/msk_with_tags_cloudwatch.hcl similarity index 100% rename from modules/aws/msk_with_tags_cloudwatch.hcl rename to modules/aws/msk/1.0/msk_with_tags_cloudwatch.hcl diff --git a/modules/aws/nlb_cloudwatch.hcl b/modules/aws/nlb/1.0/nlb_cloudwatch.hcl similarity index 100% rename from modules/aws/nlb_cloudwatch.hcl rename to modules/aws/nlb/1.0/nlb_cloudwatch.hcl diff --git a/modules/aws/rds_cloudwatch.hcl b/modules/aws/rds/1.0/rds_cloudwatch.hcl similarity index 100% rename from modules/aws/rds_cloudwatch.hcl rename to modules/aws/rds/1.0/rds_cloudwatch.hcl diff --git a/modules/aws/sqs_cloudwatch.hcl b/modules/aws/sqs/1.0/sqs_cloudwatch.hcl similarity index 100% rename from modules/aws/sqs_cloudwatch.hcl rename to modules/aws/sqs/1.0/sqs_cloudwatch.hcl From 1b703fee0861f727c9488f78a9d0e1715af3f08b Mon Sep 17 00:00:00 2001 From: Aniket Rao Date: Wed, 15 Dec 2021 13:31:24 +0530 Subject: [PATCH 2/4] refactor and version cloudflare gcp and managed datadog modules --- modules/{cloudflare => aws/nlb/1.0}/cdn.hcl | 0 modules/gcp/{ => cloudsql/1.0}/cloudsql.hcl | 0 modules/managed/{ => datadog/1.0}/aerospike_datadog.hcl | 0 modules/managed/{ => datadog/1.0}/kong_datadog.hcl | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename modules/{cloudflare => aws/nlb/1.0}/cdn.hcl (100%) rename modules/gcp/{ => cloudsql/1.0}/cloudsql.hcl (100%) rename modules/managed/{ => datadog/1.0}/aerospike_datadog.hcl (100%) rename modules/managed/{ => datadog/1.0}/kong_datadog.hcl (100%) diff --git a/modules/cloudflare/cdn.hcl b/modules/aws/nlb/1.0/cdn.hcl similarity index 100% rename from modules/cloudflare/cdn.hcl rename to modules/aws/nlb/1.0/cdn.hcl diff --git a/modules/gcp/cloudsql.hcl b/modules/gcp/cloudsql/1.0/cloudsql.hcl similarity index 100% rename from modules/gcp/cloudsql.hcl rename to modules/gcp/cloudsql/1.0/cloudsql.hcl diff --git a/modules/managed/aerospike_datadog.hcl b/modules/managed/datadog/1.0/aerospike_datadog.hcl similarity index 100% rename from modules/managed/aerospike_datadog.hcl rename to modules/managed/datadog/1.0/aerospike_datadog.hcl diff --git a/modules/managed/kong_datadog.hcl b/modules/managed/datadog/1.0/kong_datadog.hcl similarity index 100% rename from modules/managed/kong_datadog.hcl rename to modules/managed/datadog/1.0/kong_datadog.hcl From 1fb9713f3faff51ca9833d5c1ca686cb6eb8223f Mon Sep 17 00:00:00 2001 From: Aniket Rao Date: Wed, 15 Dec 2021 13:38:39 +0530 Subject: [PATCH 3/4] refactor and version prometheus modules --- modules/prometheus/{ => istio/1.0}/istio_aws_tcp_services.hcl | 0 modules/prometheus/{ => istio/1.0}/istio_multi_cluster.hcl | 0 modules/prometheus/{ => istio/1.0}/istio_tcp_services.hcl | 0 .../{ => istio/1.0}/istio_tcp_services_without_label_set.hcl | 0 .../prometheus/{ => istio/1.0}/istio_with_single_cluster.hcl | 2 +- modules/prometheus/{ => k8s/1.0}/k8s_via_kube_state.hcl | 0 .../{ => k8s/1.0}/k8s_via_kube_state_without_label_set.hcl | 0 modules/prometheus/{ => linkerd/1.0}/linkerd.hcl | 0 modules/prometheus/{ => linkerd/1.0}/linkerd_path_based.hcl | 0 modules/prometheus/{ => remote_write/1.0}/remote_write.hcl | 0 .../{ => remote_write/1.0}/remote_write_pre_v2_30.hcl | 0 .../{ => remote_write/1.0}/remote_write_without_label_set.hcl | 0 12 files changed, 1 insertion(+), 1 deletion(-) rename modules/prometheus/{ => istio/1.0}/istio_aws_tcp_services.hcl (100%) rename modules/prometheus/{ => istio/1.0}/istio_multi_cluster.hcl (100%) rename modules/prometheus/{ => istio/1.0}/istio_tcp_services.hcl (100%) rename modules/prometheus/{ => istio/1.0}/istio_tcp_services_without_label_set.hcl (100%) rename modules/prometheus/{ => istio/1.0}/istio_with_single_cluster.hcl (99%) rename modules/prometheus/{ => k8s/1.0}/k8s_via_kube_state.hcl (100%) rename modules/prometheus/{ => k8s/1.0}/k8s_via_kube_state_without_label_set.hcl (100%) rename modules/prometheus/{ => linkerd/1.0}/linkerd.hcl (100%) rename modules/prometheus/{ => linkerd/1.0}/linkerd_path_based.hcl (100%) rename modules/prometheus/{ => remote_write/1.0}/remote_write.hcl (100%) rename modules/prometheus/{ => remote_write/1.0}/remote_write_pre_v2_30.hcl (100%) rename modules/prometheus/{ => remote_write/1.0}/remote_write_without_label_set.hcl (100%) diff --git a/modules/prometheus/istio_aws_tcp_services.hcl b/modules/prometheus/istio/1.0/istio_aws_tcp_services.hcl similarity index 100% rename from modules/prometheus/istio_aws_tcp_services.hcl rename to modules/prometheus/istio/1.0/istio_aws_tcp_services.hcl diff --git a/modules/prometheus/istio_multi_cluster.hcl b/modules/prometheus/istio/1.0/istio_multi_cluster.hcl similarity index 100% rename from modules/prometheus/istio_multi_cluster.hcl rename to modules/prometheus/istio/1.0/istio_multi_cluster.hcl diff --git a/modules/prometheus/istio_tcp_services.hcl b/modules/prometheus/istio/1.0/istio_tcp_services.hcl similarity index 100% rename from modules/prometheus/istio_tcp_services.hcl rename to modules/prometheus/istio/1.0/istio_tcp_services.hcl diff --git a/modules/prometheus/istio_tcp_services_without_label_set.hcl b/modules/prometheus/istio/1.0/istio_tcp_services_without_label_set.hcl similarity index 100% rename from modules/prometheus/istio_tcp_services_without_label_set.hcl rename to modules/prometheus/istio/1.0/istio_tcp_services_without_label_set.hcl diff --git a/modules/prometheus/istio_with_single_cluster.hcl b/modules/prometheus/istio/1.0/istio_with_single_cluster.hcl similarity index 99% rename from modules/prometheus/istio_with_single_cluster.hcl rename to modules/prometheus/istio/1.0/istio_with_single_cluster.hcl index 878402e..0d4661e 100644 --- a/modules/prometheus/istio_with_single_cluster.hcl +++ b/modules/prometheus/istio/1.0/istio_with_single_cluster.hcl @@ -11,7 +11,7 @@ ingester prometheus_istio_workload module { label { type = "service" name = "$output{destination_canonical_service}" - } + }` label { type = "namespace" diff --git a/modules/prometheus/k8s_via_kube_state.hcl b/modules/prometheus/k8s/1.0/k8s_via_kube_state.hcl similarity index 100% rename from modules/prometheus/k8s_via_kube_state.hcl rename to modules/prometheus/k8s/1.0/k8s_via_kube_state.hcl diff --git a/modules/prometheus/k8s_via_kube_state_without_label_set.hcl b/modules/prometheus/k8s/1.0/k8s_via_kube_state_without_label_set.hcl similarity index 100% rename from modules/prometheus/k8s_via_kube_state_without_label_set.hcl rename to modules/prometheus/k8s/1.0/k8s_via_kube_state_without_label_set.hcl diff --git a/modules/prometheus/linkerd.hcl b/modules/prometheus/linkerd/1.0/linkerd.hcl similarity index 100% rename from modules/prometheus/linkerd.hcl rename to modules/prometheus/linkerd/1.0/linkerd.hcl diff --git a/modules/prometheus/linkerd_path_based.hcl b/modules/prometheus/linkerd/1.0/linkerd_path_based.hcl similarity index 100% rename from modules/prometheus/linkerd_path_based.hcl rename to modules/prometheus/linkerd/1.0/linkerd_path_based.hcl diff --git a/modules/prometheus/remote_write.hcl b/modules/prometheus/remote_write/1.0/remote_write.hcl similarity index 100% rename from modules/prometheus/remote_write.hcl rename to modules/prometheus/remote_write/1.0/remote_write.hcl diff --git a/modules/prometheus/remote_write_pre_v2_30.hcl b/modules/prometheus/remote_write/1.0/remote_write_pre_v2_30.hcl similarity index 100% rename from modules/prometheus/remote_write_pre_v2_30.hcl rename to modules/prometheus/remote_write/1.0/remote_write_pre_v2_30.hcl diff --git a/modules/prometheus/remote_write_without_label_set.hcl b/modules/prometheus/remote_write/1.0/remote_write_without_label_set.hcl similarity index 100% rename from modules/prometheus/remote_write_without_label_set.hcl rename to modules/prometheus/remote_write/1.0/remote_write_without_label_set.hcl From d399f172544cdbd635cbd15b0a2257018bd762e7 Mon Sep 17 00:00:00 2001 From: Aniket Rao Date: Wed, 15 Dec 2021 13:48:00 +0530 Subject: [PATCH 4/4] fix linting --- modules/prometheus/istio/1.0/istio_tcp_services.hcl | 1 - modules/prometheus/istio/1.0/istio_with_single_cluster.hcl | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/prometheus/istio/1.0/istio_tcp_services.hcl b/modules/prometheus/istio/1.0/istio_tcp_services.hcl index 04079a0..499208e 100644 --- a/modules/prometheus/istio/1.0/istio_tcp_services.hcl +++ b/modules/prometheus/istio/1.0/istio_tcp_services.hcl @@ -98,7 +98,6 @@ ingester prometheus_istio_tcp_workload module { } } - ingester prometheus_istio_tcp_cluster module { frequency = 120 lookback = 600 diff --git a/modules/prometheus/istio/1.0/istio_with_single_cluster.hcl b/modules/prometheus/istio/1.0/istio_with_single_cluster.hcl index 0d4661e..878402e 100644 --- a/modules/prometheus/istio/1.0/istio_with_single_cluster.hcl +++ b/modules/prometheus/istio/1.0/istio_with_single_cluster.hcl @@ -11,7 +11,7 @@ ingester prometheus_istio_workload module { label { type = "service" name = "$output{destination_canonical_service}" - }` + } label { type = "namespace"