UNPKG

@pulumi/aws

Version:

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

188 lines 6.13 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.Insight = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a Security Hub custom insight resource. See the [Managing custom insights section](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-custom-insights.html) of the AWS User Guide for more information. * * ## Example Usage * * ### Filter by AWS account ID * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.securityhub.Account("example", {}); * const exampleInsight = new aws.securityhub.Insight("example", { * filters: { * awsAccountIds: [ * { * comparison: "EQUALS", * value: "1234567890", * }, * { * comparison: "EQUALS", * value: "09876543210", * }, * ], * }, * groupByAttribute: "AwsAccountId", * name: "example-insight", * }, { * dependsOn: [example], * }); * ``` * * ### Filter by date range * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.securityhub.Account("example", {}); * const exampleInsight = new aws.securityhub.Insight("example", { * filters: { * createdAts: [{ * dateRange: { * unit: "DAYS", * value: 5, * }, * }], * }, * groupByAttribute: "CreatedAt", * name: "example-insight", * }, { * dependsOn: [example], * }); * ``` * * ### Filter by destination IPv4 address * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.securityhub.Account("example", {}); * const exampleInsight = new aws.securityhub.Insight("example", { * filters: { * networkDestinationIpv4s: [{ * cidr: "10.0.0.0/16", * }], * }, * groupByAttribute: "NetworkDestinationIpV4", * name: "example-insight", * }, { * dependsOn: [example], * }); * ``` * * ### Filter by finding's confidence * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.securityhub.Account("example", {}); * const exampleInsight = new aws.securityhub.Insight("example", { * filters: { * confidences: [{ * gte: "80", * }], * }, * groupByAttribute: "Confidence", * name: "example-insight", * }, { * dependsOn: [example], * }); * ``` * * ### Filter by resource tags * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.securityhub.Account("example", {}); * const exampleInsight = new aws.securityhub.Insight("example", { * filters: { * resourceTags: [{ * comparison: "EQUALS", * key: "Environment", * value: "Production", * }], * }, * groupByAttribute: "ResourceTags", * name: "example-insight", * }, { * dependsOn: [example], * }); * ``` * * ## Import * * Using `pulumi import`, import Security Hub insights using the ARN. For example: * * ```sh * $ pulumi import aws:securityhub/insight:Insight example arn:aws:securityhub:us-west-2:1234567890:insight/1234567890/custom/91299ed7-abd0-4e44-a858-d0b15e37141a * ``` */ class Insight extends pulumi.CustomResource { /** * Get an existing Insight 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 Insight(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Insight. 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'] === Insight.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["filters"] = state?.filters; resourceInputs["groupByAttribute"] = state?.groupByAttribute; resourceInputs["name"] = state?.name; resourceInputs["region"] = state?.region; } else { const args = argsOrState; if (args?.filters === undefined && !opts.urn) { throw new Error("Missing required property 'filters'"); } if (args?.groupByAttribute === undefined && !opts.urn) { throw new Error("Missing required property 'groupByAttribute'"); } resourceInputs["filters"] = args?.filters; resourceInputs["groupByAttribute"] = args?.groupByAttribute; resourceInputs["name"] = args?.name; resourceInputs["region"] = args?.region; resourceInputs["arn"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Insight.__pulumiType, name, resourceInputs, opts); } } exports.Insight = Insight; /** @internal */ Insight.__pulumiType = 'aws:securityhub/insight:Insight'; //# sourceMappingURL=insight.js.map