Skip to content

Commit

Permalink
Minor adjustments to GuardDuty for EKS
Browse files Browse the repository at this point in the history
  • Loading branch information
LOUKASSS committed Jul 3, 2023
1 parent ef9b944 commit d96d693
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ module "eks" {
aws_region_secret_name = var.aws_region_secret_name
aws_secret_access_key_secret_name = var.aws_secret_access_key_secret_name
aws_session_token_secret_name = var.aws_session_token_secret_name
aws_account_id = var.aws_account_id
}

module "GuardDuty" {
Expand Down
6 changes: 5 additions & 1 deletion modules/eks/guardduty.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ data "aws_iam_policy_document" "eks_vpc_guardduty" {
test = "StringNotEquals"
variable = "aws:PrincipalAccount"

values = ["058322885590"]
values = [var.aws_account_id]
}
}
}
Expand All @@ -92,4 +92,8 @@ resource "aws_eks_addon" "guardduty" {
tags = {
"eks_addon" = "guardduty"
}
depends_on = [
aws_eks_node_group.eks-cluster,
helm_release.cluster_autoscaler
]
}
4 changes: 4 additions & 0 deletions modules/eks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,7 @@ variable "aws_session_token_secret_name" {
type = string
}

variable "aws_account_id" {
description = "AWS account id"
type = string
}
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -302,3 +302,8 @@ variable "aws_session_token_secret_name" {
description = "Name of the secret in GitHub for the AWS session token"
type = string
}

variable "aws_account_id" {
description = "AWS account id"
type = string
}

0 comments on commit d96d693

Please sign in to comment.