UNPKG

@pulumi/aws

Version:

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

128 lines 4.89 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.Filter = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage a GuardDuty filter. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const myFilter = new aws.guardduty.Filter("MyFilter", { * name: "MyFilter", * action: "ARCHIVE", * detectorId: example.id, * rank: 1, * findingCriteria: { * criterions: [ * { * field: "region", * equals: ["eu-west-1"], * }, * { * field: "service.additionalInfo.threatListName", * notEquals: [ * "some-threat", * "another-threat", * ], * }, * { * field: "updatedAt", * greaterThan: "2020-01-01T00:00:00Z", * lessThan: "2020-02-01T00:00:00Z", * }, * { * field: "severity", * greaterThanOrEqual: "4", * }, * ], * }, * }); * ``` * * ## Import * * Using `pulumi import`, import GuardDuty filters using the detector ID and filter's name separated by a colon. For example: * * ```sh * $ pulumi import aws:guardduty/filter:Filter MyFilter 00b00fd5aecc0ab60a708659477e9617:MyFilter * ``` */ class Filter extends pulumi.CustomResource { /** * Get an existing Filter 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 Filter(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Filter. 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'] === Filter.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["action"] = state?.action; resourceInputs["arn"] = state?.arn; resourceInputs["description"] = state?.description; resourceInputs["detectorId"] = state?.detectorId; resourceInputs["findingCriteria"] = state?.findingCriteria; resourceInputs["name"] = state?.name; resourceInputs["rank"] = state?.rank; resourceInputs["region"] = state?.region; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; } else { const args = argsOrState; if (args?.action === undefined && !opts.urn) { throw new Error("Missing required property 'action'"); } if (args?.detectorId === undefined && !opts.urn) { throw new Error("Missing required property 'detectorId'"); } if (args?.findingCriteria === undefined && !opts.urn) { throw new Error("Missing required property 'findingCriteria'"); } if (args?.rank === undefined && !opts.urn) { throw new Error("Missing required property 'rank'"); } resourceInputs["action"] = args?.action; resourceInputs["description"] = args?.description; resourceInputs["detectorId"] = args?.detectorId; resourceInputs["findingCriteria"] = args?.findingCriteria; resourceInputs["name"] = args?.name; resourceInputs["rank"] = args?.rank; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Filter.__pulumiType, name, resourceInputs, opts); } } exports.Filter = Filter; /** @internal */ Filter.__pulumiType = 'aws:guardduty/filter:Filter'; //# sourceMappingURL=filter.js.map