UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

105 lines 4.39 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Detector = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * 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 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const myDetector = new aws.guardduty.Detector("MyDetector", { * enable: true, * datasources: { * s3Logs: { * enable: true, * }, * kubernetes: { * auditLogs: { * enable: false, * }, * }, * malwareProtection: { * scanEc2InstanceWithFindings: { * ebsVolumes: { * enable: true, * }, * }, * }, * }, * }); * ``` * * ## 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`. */ class Detector extends pulumi.CustomResource { /** * Get an existing Detector resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new Detector(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Detector. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Detector.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accountId"] = state?.accountId; resourceInputs["arn"] = state?.arn; resourceInputs["datasources"] = state?.datasources; resourceInputs["enable"] = state?.enable; resourceInputs["findingPublishingFrequency"] = state?.findingPublishingFrequency; resourceInputs["region"] = state?.region; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; } else { const args = argsOrState; resourceInputs["datasources"] = args?.datasources; resourceInputs["enable"] = args?.enable; resourceInputs["findingPublishingFrequency"] = args?.findingPublishingFrequency; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; resourceInputs["accountId"] = undefined /*out*/; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Detector.__pulumiType, name, resourceInputs, opts); } } exports.Detector = Detector; /** @internal */ Detector.__pulumiType = 'aws:guardduty/detector:Detector'; //# sourceMappingURL=detector.js.map