AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.9.2 published on Friday, Jun 24, 2022 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
            {
                Kubernetes = new Aws.GuardDuty.Inputs.DetectorDatasourcesKubernetesArgs
                {
                    AuditLogs = new Aws.GuardDuty.Inputs.DetectorDatasourcesKubernetesAuditLogsArgs
                    {
                        Enable = false,
                    },
                },
                S3Logs = new Aws.GuardDuty.Inputs.DetectorDatasourcesS3LogsArgs
                {
                    Enable = true,
                },
            },
            Enable = true,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/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{
				Kubernetes: &guardduty.DetectorDatasourcesKubernetesArgs{
					AuditLogs: &guardduty.DetectorDatasourcesKubernetesAuditLogsArgs{
						Enable: pulumi.Bool(false),
					},
				},
				S3Logs: &guardduty.DetectorDatasourcesS3LogsArgs{
					Enable: pulumi.Bool(true),
				},
			},
			Enable: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var myDetector = new Detector("myDetector", DetectorArgs.builder()        
            .datasources(DetectorDatasourcesArgs.builder()
                .kubernetes(DetectorDatasourcesKubernetesArgs.builder()
                    .auditLogs(DetectorDatasourcesKubernetesAuditLogsArgs.builder()
                        .enable(false)
                        .build())
                    .build())
                .s3Logs(DetectorDatasourcesS3LogsArgs.builder()
                    .enable(true)
                    .build())
                .build())
            .enable(true)
            .build());

    }
}
import pulumi
import pulumi_aws as aws

my_detector = aws.guardduty.Detector("myDetector",
    datasources=aws.guardduty.DetectorDatasourcesArgs(
        kubernetes=aws.guardduty.DetectorDatasourcesKubernetesArgs(
            audit_logs=aws.guardduty.DetectorDatasourcesKubernetesAuditLogsArgs(
                enable=False,
            ),
        ),
        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: {
        kubernetes: {
            auditLogs: {
                enable: false,
            },
        },
        s3Logs: {
            enable: true,
        },
    },
    enable: true,
});
resources:
  myDetector:
    type: aws:guardduty:Detector
    properties:
      datasources:
        kubernetes:
          auditLogs:
            enable: false
        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)
public Detector(String name, DetectorArgs args)
public Detector(String name, DetectorArgs args, CustomResourceOptions options)
type: aws:guardduty:Detector
properties: # The arguments to resource properties.
options: # 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.
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.
name String
The unique name of the resource.
args DetectorArgs
The arguments to resource properties.
options 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 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.

datasources Property Map

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 Map<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.

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 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 .

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>

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)
public static Detector get(String name, Output<String> id, DetectorState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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 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 .

accountId String

The AWS account ID of the GuardDuty detector

arn String

Amazon Resource Name (ARN) of the GuardDuty detector

datasources Property Map

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 Map<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>

A map of tags assigned to the resource, including those inherited from the provider .

Supporting Types

DetectorDatasources

Kubernetes DetectorDatasourcesKubernetes

Configures Kubernetes protection. See Kubernetes and Kubernetes Audit Logs below for more details.

S3Logs DetectorDatasourcesS3Logs

Configures S3 protection. See S3 Logs below for more details.

Kubernetes DetectorDatasourcesKubernetes

Configures Kubernetes protection. See Kubernetes and Kubernetes Audit Logs below for more details.

S3Logs DetectorDatasourcesS3Logs

Configures S3 protection. See S3 Logs below for more details.

kubernetes DetectorDatasourcesKubernetes

Configures Kubernetes protection. See Kubernetes and Kubernetes Audit Logs below for more details.

s3Logs DetectorDatasourcesS3Logs

Configures S3 protection. See S3 Logs below for more details.

kubernetes DetectorDatasourcesKubernetes

Configures Kubernetes protection. See Kubernetes and Kubernetes Audit Logs below for more details.

s3Logs DetectorDatasourcesS3Logs

Configures S3 protection. See S3 Logs below for more details.

kubernetes DetectorDatasourcesKubernetes

Configures Kubernetes protection. See Kubernetes and Kubernetes Audit Logs below for more details.

s3_logs DetectorDatasourcesS3Logs

Configures S3 protection. See S3 Logs below for more details.

kubernetes Property Map

Configures Kubernetes protection. See Kubernetes and Kubernetes Audit Logs below for more details.

s3Logs Property Map

Configures S3 protection. See S3 Logs below for more details.

DetectorDatasourcesKubernetes

AuditLogs DetectorDatasourcesKubernetesAuditLogs

Configures Kubernetes audit logs as a data source for Kubernetes protection. See Kubernetes Audit Logs below for more details.

AuditLogs DetectorDatasourcesKubernetesAuditLogs

Configures Kubernetes audit logs as a data source for Kubernetes protection. See Kubernetes Audit Logs below for more details.

auditLogs DetectorDatasourcesKubernetesAuditLogs

Configures Kubernetes audit logs as a data source for Kubernetes protection. See Kubernetes Audit Logs below for more details.

auditLogs DetectorDatasourcesKubernetesAuditLogs

Configures Kubernetes audit logs as a data source for Kubernetes protection. See Kubernetes Audit Logs below for more details.

audit_logs DetectorDatasourcesKubernetesAuditLogs

Configures Kubernetes audit logs as a data source for Kubernetes protection. See Kubernetes Audit Logs below for more details.

auditLogs Property Map

Configures Kubernetes audit logs as a data source for Kubernetes protection. See Kubernetes Audit Logs below for more details.

DetectorDatasourcesKubernetesAuditLogs

Enable bool

If true, enables Kubernetes audit logs as a data source for Kubernetes protection. Defaults to true.

Enable bool

If true, enables Kubernetes audit logs as a data source for Kubernetes protection. Defaults to true.

enable Boolean

If true, enables Kubernetes audit logs as a data source for Kubernetes protection. Defaults to true.

enable boolean

If true, enables Kubernetes audit logs as a data source for Kubernetes protection. Defaults to true.

enable bool

If true, enables Kubernetes audit logs as a data source for Kubernetes protection. Defaults to true.

enable Boolean

If true, enables Kubernetes audit logs as a data source for Kubernetes protection. Defaults to true.

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 boolean

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.

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.