Skip to content

Commit caa7c80

Browse files
Guardduty only on delegated admin
1 parent 7c6a9b8 commit caa7c80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/guardduty/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ resource "aws_guardduty_organization_admin_account" "self" {
5656
# aws guardduty get-detector --detector-id
5757
# aws guardduty list-detectors
5858

59-
# Add detector only on master, member is administered by master
59+
# Add detector only on delegated admin
6060
resource "aws_guardduty_detector" "self" {
61-
count = var.enable && var.account_type == "master" ? 1 : 0
61+
count = var.enable && data.aws_caller_identity.current.account_id == var.security_administrator_account_id ? 1 : 0
6262
enable = true
6363
finding_publishing_frequency = var.finding_publishing_frequency
6464
datasources {

0 commit comments

Comments
 (0)