This template sets up a GuardDuty member and sends an invitation to join GuardDuty.

Terraform Template

resource "aws_guardduty_detector" "member" {
  enable = true
  provider = "aws.dev"
}

resource "aws_guardduty_detector" "primary" {
  enable = true
}

resource "aws_guardduty_member" "member" {
  account_id = aws_guardduty_detector.member.account_id
  detector_id = aws_guardduty_detector.primary.id
  email = "required@example.com"
  invitation_message = "please accept guardduty invitation"
  invite = true
}