Skip to content

Commit

Permalink
Fix scraper's output
Browse files Browse the repository at this point in the history
  • Loading branch information
bonclay7 committed Feb 5, 2024
1 parent 1e1b90f commit 235a22f
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 5 deletions.
6 changes: 2 additions & 4 deletions examples/eks-cross-account-with-central-amp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ module "eks_monitoring_one" {
enable_managed_prometheus = false

managed_prometheus_workspace_id = module.managed_service_prometheus.workspace_id
managed_prometheus_workspace_endpoint = module.managed_service_prometheus.workspace_prometheus_endpoint
managed_prometheus_workspace_region = var.cluster_one.region
managed_prometheus_cross_account_role = aws_iam_role.cross_account_amp_role.arn
irsa_iam_additional_policies = [aws_iam_policy.irsa_assume_role_policy_one.arn]
Expand Down Expand Up @@ -96,9 +95,8 @@ module "eks_monitoring_two" {
# prevents the module to create a workspace
enable_managed_prometheus = false

managed_prometheus_workspace_id = module.managed_service_prometheus.workspace_id
managed_prometheus_workspace_endpoint = module.managed_service_prometheus.workspace_prometheus_endpoint
managed_prometheus_workspace_region = var.cluster_two.region
managed_prometheus_workspace_id = module.managed_service_prometheus.workspace_id
managed_prometheus_workspace_region = var.cluster_two.region

managed_prometheus_cross_account_role = aws_iam_role.cross_account_amp_role.arn
irsa_iam_additional_policies = [aws_iam_policy.irsa_assume_role_policy_two.arn]
Expand Down
1 change: 1 addition & 0 deletions examples/eks-istio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ View the full documentation for this example [here](https://aws-observability.gi
| <a name="output_managed_prometheus_workspace_endpoint"></a> [managed\_prometheus\_workspace\_endpoint](#output\_managed\_prometheus\_workspace\_endpoint) | Amazon Managed Prometheus workspace endpoint |
| <a name="output_managed_prometheus_workspace_id"></a> [managed\_prometheus\_workspace\_id](#output\_managed\_prometheus\_workspace\_id) | Amazon Managed Prometheus workspace ID |
| <a name="output_managed_prometheus_workspace_region"></a> [managed\_prometheus\_workspace\_region](#output\_managed\_prometheus\_workspace\_region) | AWS Region |
| <a name="output_scraper_aws_auth"></a> [scraper\_aws\_auth](#output\_scraper\_aws\_auth) | Execute this command to grand access to the managed scrapers to gain permissions on your cluster. Mandatory for the first use |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
5 changes: 5 additions & 0 deletions examples/eks-istio/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ output "eks_cluster_id" {
description = "EKS Cluster Id"
value = module.eks_monitoring.eks_cluster_id
}

output "scraper_aws_auth" {
description = "Execute this command to grand access to the managed scrapers to gain permissions on your cluster. Mandatory for the first use"
value = module.eks_monitoring.scraper_aws_auth
}
1 change: 1 addition & 0 deletions examples/existing-cluster-java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,5 @@ terraform destroy -var-file=terraform.tfvars
| <a name="output_managed_prometheus_workspace_endpoint"></a> [managed\_prometheus\_workspace\_endpoint](#output\_managed\_prometheus\_workspace\_endpoint) | Amazon Managed Prometheus workspace endpoint |
| <a name="output_managed_prometheus_workspace_id"></a> [managed\_prometheus\_workspace\_id](#output\_managed\_prometheus\_workspace\_id) | Amazon Managed Prometheus workspace ID |
| <a name="output_managed_prometheus_workspace_region"></a> [managed\_prometheus\_workspace\_region](#output\_managed\_prometheus\_workspace\_region) | AWS Region |
| <a name="output_scraper_aws_auth"></a> [scraper\_aws\_auth](#output\_scraper\_aws\_auth) | Execute this command to grand access to the managed scrapers to gain permissions on your cluster. Mandatory for the first use |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
5 changes: 5 additions & 0 deletions examples/existing-cluster-java/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ output "eks_cluster_id" {
description = "EKS Cluster Id"
value = module.eks_monitoring.eks_cluster_id
}

output "scraper_aws_auth" {
description = "Execute this command to grand access to the managed scrapers to gain permissions on your cluster. Mandatory for the first use"
value = module.eks_monitoring.scraper_aws_auth
}
1 change: 1 addition & 0 deletions examples/existing-cluster-nginx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,5 @@ add this `managed_prometheus_region=xxx` and `managed_prometheus_workspace_id=ws
| <a name="output_managed_prometheus_workspace_endpoint"></a> [managed\_prometheus\_workspace\_endpoint](#output\_managed\_prometheus\_workspace\_endpoint) | Amazon Managed Prometheus workspace endpoint |
| <a name="output_managed_prometheus_workspace_id"></a> [managed\_prometheus\_workspace\_id](#output\_managed\_prometheus\_workspace\_id) | Amazon Managed Prometheus workspace ID |
| <a name="output_managed_prometheus_workspace_region"></a> [managed\_prometheus\_workspace\_region](#output\_managed\_prometheus\_workspace\_region) | AWS Region |
| <a name="output_scraper_aws_auth"></a> [scraper\_aws\_auth](#output\_scraper\_aws\_auth) | Execute this command to grand access to the managed scrapers to gain permissions on your cluster. Mandatory for the first use |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
5 changes: 5 additions & 0 deletions examples/existing-cluster-nginx/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ output "eks_cluster_id" {
description = "EKS Cluster Id"
value = module.eks_monitoring.eks_cluster_id
}

output "scraper_aws_auth" {
description = "Execute this command to grand access to the managed scrapers to gain permissions on your cluster. Mandatory for the first use"
value = module.eks_monitoring.scraper_aws_auth
}
1 change: 1 addition & 0 deletions examples/existing-cluster-with-base-and-infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ View the full documentation for this example [here](https://aws-observability.gi
| <a name="output_managed_prometheus_workspace_endpoint"></a> [managed\_prometheus\_workspace\_endpoint](#output\_managed\_prometheus\_workspace\_endpoint) | Amazon Managed Prometheus workspace endpoint |
| <a name="output_managed_prometheus_workspace_id"></a> [managed\_prometheus\_workspace\_id](#output\_managed\_prometheus\_workspace\_id) | Amazon Managed Prometheus workspace ID |
| <a name="output_managed_prometheus_workspace_region"></a> [managed\_prometheus\_workspace\_region](#output\_managed\_prometheus\_workspace\_region) | AWS Region |
| <a name="output_scraper_aws_auth"></a> [scraper\_aws\_auth](#output\_scraper\_aws\_auth) | Execute this command to grand access to the managed scrapers to gain permissions on your cluster. Mandatory for the first use |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
5 changes: 5 additions & 0 deletions examples/existing-cluster-with-base-and-infra/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ output "eks_cluster_id" {
description = "EKS Cluster Id"
value = module.eks_monitoring.eks_cluster_id
}

output "scraper_aws_auth" {
description = "Execute this command to grand access to the managed scrapers to gain permissions on your cluster. Mandatory for the first use"
value = module.eks_monitoring.scraper_aws_auth
}
2 changes: 1 addition & 1 deletion modules/eks-monitoring/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ output "managed_prometheus_workspace_region" {

output "scraper_aws_auth" {
description = "Execute this command to grand access to the managed scrapers to gain permissions on your cluster. Mandatory for the first use"
value = "eksctl create iamidentitymapping --cluster ${var.eks_cluster_id} --region ${local.managed_prometheus_workspace_region} --arn ${aws_prometheus_scraper.this.role_arn} --username aps-collector-user"
value = "eksctl create iamidentitymapping --cluster ${var.eks_cluster_id} --region ${local.managed_prometheus_workspace_region} --arn ${replace(aws_prometheus_scraper.this.role_arn, "aws-service-role/scraper.aps.amazonaws.com/", "")} --username aps-collector-user"
}

0 comments on commit 235a22f

Please sign in to comment.