AWS Classic

v4.30.0 published on Tuesday, Nov 30, 2021 by Pulumi

Detector

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 to false to instead “suspend” monitoring and feedback reporting while keeping existing data. See the Suspending or Disabling Amazon GuardDuty documentation for more information.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var myDetector = new Aws.GuardDuty.Detector("myDetector", new Aws.GuardDuty.DetectorArgs
        {
            Datasources = new Aws.GuardDuty.Inputs.DetectorDatasourcesArgs
            {
                S3Logs = new Aws.GuardDuty.Inputs.DetectorDatasourcesS3LogsArgs
                {
                    Enable = true,
                },
            },
            Enable = true,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/guardduty"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := guardduty.NewDetector(ctx, "myDetector", &guardduty.DetectorArgs{
			Datasources: &guardduty.DetectorDatasourcesArgs{
				S3Logs: &guardduty.DetectorDatasourcesS3LogsArgs{
					Enable: pulumi.Bool(true),
				},
			},
			Enable: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

my_detector = aws.guardduty.Detector("myDetector",
    datasources=aws.guardduty.DetectorDatasourcesArgs(
        s3_logs=aws.guardduty.DetectorDatasourcesS3LogsArgs(
            enable=True,
        ),
    ),
    enable=True)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const myDetector = new aws.guardduty.Detector("MyDetector", {
    datasources: {
        s3Logs: {
            enable: true,
        },
    },
    enable: true,
});

Create a Detector Resource

new Detector(name: string, args?: DetectorArgs, opts?: CustomResourceOptions);
@overload
def Detector(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             datasources: Optional[DetectorDatasourcesArgs] = None,
             enable: Optional[bool] = None,
             finding_publishing_frequency: Optional[str] = None,
             tags: Optional[Mapping[str, str]] = None)
@overload
def Detector(resource_name: str,
             args: Optional[DetectorArgs] = None,
             opts: Optional[ResourceOptions] = None)
func NewDetector(ctx *Context, name string, args *DetectorArgs, opts ...ResourceOption) (*Detector, error)
public Detector(string name, DetectorArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args DetectorArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args DetectorArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DetectorArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DetectorArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Detector Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Detector resource accepts the following input properties:

Datasources DetectorDatasourcesArgs
Describes which data sources will be enabled for the detector. See Data Sources below for more details.
Enable bool
If true, enables S3 Protection. Defaults to true.
FindingPublishingFrequency string
Specifies the frequency of notifications sent for subsequent finding occurrences. If the detector is a GuardDuty member account, the value is determined by the GuardDuty primary account and cannot be modified, otherwise defaults to SIX_HOURS. For standalone and GuardDuty primary accounts, it must be configured in this provider to enable drift detection. Valid values for standalone and primary accounts: FIFTEEN_MINUTES, ONE_HOUR, SIX_HOURS. See AWS Documentation for more information.
Tags Dictionary<string, string>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Datasources DetectorDatasourcesArgs
Describes which data sources will be enabled for the detector. See Data Sources below for more details.
Enable bool
If true, enables S3 Protection. Defaults to true.
FindingPublishingFrequency string
Specifies the frequency of notifications sent for subsequent finding occurrences. If the detector is a GuardDuty member account, the value is determined by the GuardDuty primary account and cannot be modified, otherwise defaults to SIX_HOURS. For standalone and GuardDuty primary accounts, it must be configured in this provider to enable drift detection. Valid values for standalone and primary accounts: FIFTEEN_MINUTES, ONE_HOUR, SIX_HOURS. See AWS Documentation for more information.
Tags map[string]string
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
datasources DetectorDatasourcesArgs
Describes which data sources will be enabled for the detector. See Data Sources below for more details.
enable boolean
If true, enables S3 Protection. Defaults to true.
findingPublishingFrequency string
Specifies the frequency of notifications sent for subsequent finding occurrences. If the detector is a GuardDuty member account, the value is determined by the GuardDuty primary account and cannot be modified, otherwise defaults to SIX_HOURS. For standalone and GuardDuty primary accounts, it must be configured in this provider to enable drift detection. Valid values for standalone and primary accounts: FIFTEEN_MINUTES, ONE_HOUR, SIX_HOURS. See AWS Documentation for more information.
tags {[key: string]: string}
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
datasources DetectorDatasourcesArgs
Describes which data sources will be enabled for the detector. See Data Sources below for more details.
enable bool
If true, enables S3 Protection. Defaults to true.
finding_publishing_frequency str
Specifies the frequency of notifications sent for subsequent finding occurrences. If the detector is a GuardDuty member account, the value is determined by the GuardDuty primary account and cannot be modified, otherwise defaults to SIX_HOURS. For standalone and GuardDuty primary accounts, it must be configured in this provider to enable drift detection. Valid values for standalone and primary accounts: FIFTEEN_MINUTES, ONE_HOUR, SIX_HOURS. See AWS Documentation for more information.
tags Mapping[str, str]
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Outputs

All input properties are implicitly available as output properties. Additionally, the Detector resource produces the following output properties:

AccountId string
The AWS account ID of the GuardDuty detector
Arn string
Amazon Resource Name (ARN) of the GuardDuty detector
Id string
The provider-assigned unique ID for this managed resource.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider .
AccountId string
The AWS account ID of the GuardDuty detector
Arn string
Amazon Resource Name (ARN) of the GuardDuty detector
Id string
The provider-assigned unique ID for this managed resource.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider .
accountId string
The AWS account ID of the GuardDuty detector
arn string
Amazon Resource Name (ARN) of the GuardDuty detector
id string
The provider-assigned unique ID for this managed resource.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider .
account_id str
The AWS account ID of the GuardDuty detector
arn str
Amazon Resource Name (ARN) of the GuardDuty detector
id str
The provider-assigned unique ID for this managed resource.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider .

Look up an Existing Detector Resource

Get an existing Detector resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DetectorState, opts?: CustomResourceOptions): Detector
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        arn: Optional[str] = None,
        datasources: Optional[DetectorDatasourcesArgs] = None,
        enable: Optional[bool] = None,
        finding_publishing_frequency: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> Detector
func GetDetector(ctx *Context, name string, id IDInput, state *DetectorState, opts ...ResourceOption) (*Detector, error)
public static Detector Get(string name, Input<string> id, DetectorState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

AccountId string
The AWS account ID of the GuardDuty detector
Arn string
Amazon Resource Name (ARN) of the GuardDuty detector
Datasources DetectorDatasourcesArgs
Describes which data sources will be enabled for the detector. See Data Sources below for more details.
Enable bool
If true, enables S3 Protection. Defaults to true.
FindingPublishingFrequency string
Specifies the frequency of notifications sent for subsequent finding occurrences. If the detector is a GuardDuty member account, the value is determined by the GuardDuty primary account and cannot be modified, otherwise defaults to SIX_HOURS. For standalone and GuardDuty primary accounts, it must be configured in this provider to enable drift detection. Valid values for standalone and primary accounts: FIFTEEN_MINUTES, ONE_HOUR, SIX_HOURS. See AWS Documentation for more information.
Tags Dictionary<string, string>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider .
AccountId string
The AWS account ID of the GuardDuty detector
Arn string
Amazon Resource Name (ARN) of the GuardDuty detector
Datasources DetectorDatasourcesArgs
Describes which data sources will be enabled for the detector. See Data Sources below for more details.
Enable bool
If true, enables S3 Protection. Defaults to true.
FindingPublishingFrequency string
Specifies the frequency of notifications sent for subsequent finding occurrences. If the detector is a GuardDuty member account, the value is determined by the GuardDuty primary account and cannot be modified, otherwise defaults to SIX_HOURS. For standalone and GuardDuty primary accounts, it must be configured in this provider to enable drift detection. Valid values for standalone and primary accounts: FIFTEEN_MINUTES, ONE_HOUR, SIX_HOURS. See AWS Documentation for more information.
Tags map[string]string
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider .
accountId string
The AWS account ID of the GuardDuty detector
arn string
Amazon Resource Name (ARN) of the GuardDuty detector
datasources DetectorDatasourcesArgs
Describes which data sources will be enabled for the detector. See Data Sources below for more details.
enable boolean
If true, enables S3 Protection. Defaults to true.
findingPublishingFrequency string
Specifies the frequency of notifications sent for subsequent finding occurrences. If the detector is a GuardDuty member account, the value is determined by the GuardDuty primary account and cannot be modified, otherwise defaults to SIX_HOURS. For standalone and GuardDuty primary accounts, it must be configured in this provider to enable drift detection. Valid values for standalone and primary accounts: FIFTEEN_MINUTES, ONE_HOUR, SIX_HOURS. See AWS Documentation for more information.
tags {[key: string]: string}
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider .
account_id str
The AWS account ID of the GuardDuty detector
arn str
Amazon Resource Name (ARN) of the GuardDuty detector
datasources DetectorDatasourcesArgs
Describes which data sources will be enabled for the detector. See Data Sources below for more details.
enable bool
If true, enables S3 Protection. Defaults to true.
finding_publishing_frequency str
Specifies the frequency of notifications sent for subsequent finding occurrences. If the detector is a GuardDuty member account, the value is determined by the GuardDuty primary account and cannot be modified, otherwise defaults to SIX_HOURS. For standalone and GuardDuty primary accounts, it must be configured in this provider to enable drift detection. Valid values for standalone and primary accounts: FIFTEEN_MINUTES, ONE_HOUR, SIX_HOURS. See AWS Documentation for more information.
tags Mapping[str, str]
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider .

Supporting Types

DetectorDatasources

S3Logs DetectorDatasourcesS3Logs
Describes whether S3 data event logs are enabled as a data source. See S3 Logs below for more details.
S3Logs DetectorDatasourcesS3Logs
Describes whether S3 data event logs are enabled as a data source. See S3 Logs below for more details.
s3Logs DetectorDatasourcesS3Logs
Describes whether S3 data event logs are enabled as a data source. See S3 Logs below for more details.
s3_logs DetectorDatasourcesS3Logs
Describes whether S3 data event logs are enabled as a data source. See S3 Logs below for more details.

DetectorDatasourcesS3Logs

Enable bool
If true, enables S3 Protection. Defaults to true.
Enable bool
If true, enables S3 Protection. Defaults to true.
enable boolean
If true, enables S3 Protection. Defaults to true.
enable bool
If true, enables S3 Protection. Defaults to true.

Import

GuardDuty detectors can be imported using the detector ID, e.g.,

 $ pulumi import aws:guardduty/detector:Detector MyDetector 00b00fd5aecc0ab60a708659477e9617

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.