Class Detector


  • public class Detector
    extends com.pulumi.resources.CustomResource
    Provides a resource to manage an Amazon 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](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_suspend-disable.html) for more information. ## Example Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.guardduty.Detector;
     import com.pulumi.aws.guardduty.DetectorArgs;
     import com.pulumi.aws.guardduty.inputs.DetectorDatasourcesArgs;
     import com.pulumi.aws.guardduty.inputs.DetectorDatasourcesS3LogsArgs;
     import com.pulumi.aws.guardduty.inputs.DetectorDatasourcesKubernetesArgs;
     import com.pulumi.aws.guardduty.inputs.DetectorDatasourcesKubernetesAuditLogsArgs;
     import com.pulumi.aws.guardduty.inputs.DetectorDatasourcesMalwareProtectionArgs;
     import com.pulumi.aws.guardduty.inputs.DetectorDatasourcesMalwareProtectionScanEc2InstanceWithFindingsArgs;
     import com.pulumi.aws.guardduty.inputs.DetectorDatasourcesMalwareProtectionScanEc2InstanceWithFindingsEbsVolumesArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     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()
                     .s3Logs(DetectorDatasourcesS3LogsArgs.builder()
                         .enable(true)
                         .build())
                     .kubernetes(DetectorDatasourcesKubernetesArgs.builder()
                         .auditLogs(DetectorDatasourcesKubernetesAuditLogsArgs.builder()
                             .enable(false)
                             .build())
                         .build())
                     .malwareProtection(DetectorDatasourcesMalwareProtectionArgs.builder()
                         .scanEc2InstanceWithFindings(DetectorDatasourcesMalwareProtectionScanEc2InstanceWithFindingsArgs.builder()
                             .ebsVolumes(DetectorDatasourcesMalwareProtectionScanEc2InstanceWithFindingsEbsVolumesArgs.builder()
                                 .enable(true)
                                 .build())
                             .build())
                         .build())
                     .build())
                 .enable(true)
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import GuardDuty detectors using the detector ID. For example: ```sh $ pulumi import aws:guardduty/detector:Detector MyDetector 00b00fd5aecc0ab60a708659477e9617 ``` The ID of the detector can be retrieved via the [AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/guardduty/list-detectors.html) using `aws guardduty list-detectors`.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Detector​(java.lang.String name)  
      Detector​(java.lang.String name, DetectorArgs args)  
      Detector​(java.lang.String name, DetectorArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> accountId()  
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<DetectorDatasources> datasources()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> enable()  
      com.pulumi.core.Output<java.lang.String> findingPublishingFrequency()  
      static Detector get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, DetectorState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Detector

        public Detector​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Detector

        public Detector​(java.lang.String name,
                        @Nullable
                        DetectorArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Detector

        public Detector​(java.lang.String name,
                        @Nullable
                        DetectorArgs args,
                        @Nullable
                        com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • accountId

        public com.pulumi.core.Output<java.lang.String> accountId()
        Returns:
        AWS account ID of the GuardDuty detector
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of the GuardDuty detector
      • datasources

        public com.pulumi.core.Output<DetectorDatasources> datasources()
        Returns:
        Data sources to enable for the detector. See `datasources` below for more details. [Deprecated](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty-feature-object-api-changes-march2023.html) in favor of `aws.guardduty.DetectorFeature` resources.
      • enable

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> enable()
        Returns:
        Enable monitoring and feedback reporting. Setting to `false` is equivalent to "suspending" GuardDuty. Defaults to `true`.
      • findingPublishingFrequency

        public com.pulumi.core.Output<java.lang.String> findingPublishingFrequency()
        Returns:
        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 Terraform to enable drift detection. Valid values for standalone and primary accounts: `FIFTEEN_MINUTES`, `ONE_HOUR`, `SIX_HOURS`. See [AWS Documentation](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_findings_cloudwatch.html#guardduty_findings_cloudwatch_notification_frequency) for more information.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • get

        public static Detector get​(java.lang.String name,
                                   com.pulumi.core.Output<java.lang.String> id,
                                   @Nullable
                                   DetectorState state,
                                   @Nullable
                                   com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.