AWS GuardDuty Detector
This page shows how to write Terraform and CloudFormation for GuardDuty Detector and write them securely.
aws_guardduty_detector (Terraform)
The Detector in GuardDuty can be configured in Terraform with the resource name aws_guardduty_detector
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_guardduty_detector" "eu_west_1" {
enable = true
provider = aws.eu-west-1
}
resource "aws_guardduty_detector" "eu_west_2" {
resource "aws_guardduty_detector" "eu_west_1" {
enable = true
provider = aws.eu-west-1
finding_publishing_frequency = var.publishing_frequency
}
resource "aws_guardduty_detector" "us-east-1" {
count = contains(var.regions, "us-east-1") ? 1 : 0
provider = aws.us-east-1
enable = true
}
resource "aws_guardduty_detector" "ok" {
enable = true
}
resource "aws_guardduty_detector" "not_ok" {
enable = true
resource "aws_guardduty_detector" "primary" {
enable = true
}
resource "aws_guardduty_detector" "member" {
count = var.guardduty ? 1 : 0
Parameters
-
account_id
optional computed - string -
arn
optional computed - string -
enable
optional - bool -
finding_publishing_frequency
optional computed - string -
id
optional computed - string -
tags
optional - map from string to string
Explanation in Terraform Registry
Provides a resource to manage a GuardDuty detector.
NOTE: Deleting this resource is equivalent to "disabling" GuardDuty for an AWS region, which removes all existing findings. You can set the
enable
attribute tofalse
to instead "suspend" monitoring and feedback reporting while keeping existing data. See the Suspending or Disabling Amazon GuardDuty documentation for more information.
AWS::GuardDuty::Detector (CloudFormation)
The Detector in GuardDuty can be configured in CloudFormation with the resource name AWS::GuardDuty::Detector
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
FindingPublishingFrequency
optional - String -
DataSources
optional - CFNDataSourceConfigurations -
Enable
required - Boolean
Explanation in CloudFormation Registry
The
AWS::GuardDuty::Detector
resource specifies a new Amazon GuardDuty detector. A detector is an object that represents the Amazon GuardDuty service. A detector is required for Amazon GuardDuty to become operational.
Frequently asked questions
What is AWS GuardDuty Detector?
AWS GuardDuty Detector is a resource for GuardDuty of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS GuardDuty Detector?
For Terraform, the UKHomeOffice/acp-guardduty-detector-tf, UKHomeOffice/acp-tf-GuardDuty-Masteraccount and ArtiomL/aws-sec-controls source code examples are useful. See the Terraform Example section for further details.