-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update module to use the new container insights with CW for EKS (#252)
* Adding Module and Example for ECS cluster monitoring with ecs_observer * Adding Module and Example for ECS cluster monitoring with ecs_observer * Incorporating PR comments * Restructuring Examples and modules folder for ECS, Added content in main Readme * Fixing path as per PR comments * Parameterzing the config files, incorporated PR review comments * Adding condition for AMP WS and fixing AMP endpoint * Adding Document for ECS Monitoring and parameterized some variables * Added sample dashboard * Adding Document for ECS Monitoring and parameterized some variables * Fixing failures detected by pre-commit * Fixing failures detected by pre-commit * Fixing failures detected by pre-commit * Pre-commit fixes * Fixing failures detected by pre-commit * Fixing failures detected by pre-commit * Pre-commit * Fixing HIGH security alerts detected by pre-commit * Fixing HIGH security alerts detected by pre-commit * Fixing HIGH security alerts detected by pre-commit, 31stOct * Add links after merge * 2ndNov - Added condiotnal creation for Grafana WS and module versions for AMG, AMP * Module to use the new container insights with CW for EKS * Module to use the new container insights with CW for EKS * Fixing precommit error * Updating EKS container insights to replace deamonset with tf resource * Updating EKS container insights to replace deamonset with tf resource * Updating EKS container insights to replace deamonset with tf resource * Updating EKS container insights to replace deamonset with tf resource * Updating EKS container insights- Adding doc and fixing pre-commit errors * Update Images in the doc * Update data.tf pre-commit error * Apply suggestions from code review * fixing broken hyperlink * EKS Container Insights - updating docs and few varibaleable names, definitions
- Loading branch information
Showing
14 changed files
with
190 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
data "aws_partition" "current" {} | ||
data "aws_caller_identity" "current" {} | ||
data "aws_region" "current" {} | ||
|
||
data "aws_eks_cluster" "eks_cluster" { | ||
name = var.eks_cluster_id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
data "aws_partition" "current" {} | ||
locals { | ||
name = "amazon-cloudwatch-observability" | ||
eks_oidc_issuer_url = replace(data.aws_eks_cluster.eks_cluster.identity[0].oidc[0].issuer, "https://", "") | ||
|
||
data "aws_caller_identity" "current" {} | ||
addon_context = { | ||
aws_caller_identity_account_id = data.aws_caller_identity.current.account_id | ||
aws_caller_identity_arn = data.aws_caller_identity.current.arn | ||
aws_partition_id = data.aws_partition.current.partition | ||
aws_region_name = data.aws_region.current.name | ||
eks_oidc_provider_arn = "arn:${data.aws_partition.current.partition}:iam::${data.aws_caller_identity.current.account_id}:oidc-provider/${local.eks_oidc_issuer_url}" | ||
eks_cluster_id = data.aws_eks_cluster.eks_cluster.id | ||
tags = var.tags | ||
} | ||
|
||
data "aws_region" "current" {} | ||
|
||
data "aws_eks_cluster" "eks_cluster" { | ||
name = var.eks_cluster_id | ||
addon_config = { | ||
kubernetes_version = var.eks_cluster_version | ||
most_recent = true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,8 @@ | ||
provider "aws" { | ||
region = var.aws_region | ||
} | ||
|
||
provider "kubernetes" { | ||
host = local.eks_cluster_endpoint | ||
cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks_cluster.certificate_authority[0].data) | ||
exec { | ||
api_version = "client.authentication.k8s.io/v1beta1" | ||
args = ["eks", "get-token", "--cluster-name", var.eks_cluster_id] | ||
command = "aws" | ||
} | ||
} | ||
|
||
provider "helm" { | ||
kubernetes { | ||
host = local.eks_cluster_endpoint | ||
cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks_cluster.certificate_authority[0].data) | ||
exec { | ||
api_version = "client.authentication.k8s.io/v1beta1" | ||
args = ["eks", "get-token", "--cluster-name", var.eks_cluster_id] | ||
command = "aws" | ||
} | ||
} | ||
} | ||
|
||
|
||
# Deploy the ADOT Container Insights | ||
|
||
module "eks_container_insights" { | ||
source = "../../modules/eks-container-insights" | ||
# source = "github.com/aws-observability/terraform-aws-observability-accelerator//modules/eks-container-insights?ref=v2.5.4" | ||
eks_cluster_id = var.eks_cluster_id | ||
source = "../../modules/eks-container-insights" | ||
eks_cluster_id = var.eks_cluster_id | ||
enable_amazon_eks_cw_observability = true | ||
create_cloudwatch_observability_irsa_role = true | ||
eks_oidc_provider_arn = local.addon_context.eks_oidc_provider_arn | ||
create_cloudwatch_application_signals_role = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
data "aws_partition" "current" {} | ||
data "aws_caller_identity" "current" {} | ||
data "aws_region" "current" {} | ||
|
||
data "aws_eks_cluster" "eks_cluster" { | ||
name = var.eks_cluster_id | ||
} |
Oops, something went wrong.