UNPKG

@pulumi/aws

Version:

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

133 lines 5.33 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.AutomationRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS Security Hub Automation Rule. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.securityhub.AutomationRule("example", { * description: "Elevate finding severity to CRITICAL when specific resources such as an S3 bucket is at risk", * ruleName: "Elevate severity of findings that relate to important resources", * ruleOrder: 1, * actions: [{ * findingFieldsUpdate: { * severity: { * label: "CRITICAL", * product: 0, * }, * note: { * text: "This is a critical resource. Please review ASAP.", * updatedBy: "sechub-automation", * }, * types: ["Software and Configuration Checks/Industry and Regulatory Standards"], * userDefinedFields: { * key: "value", * }, * }, * type: "FINDING_FIELDS_UPDATE", * }], * criteria: { * resourceIds: [{ * comparison: "EQUALS", * value: "arn:aws:s3:::examplebucket/*", * }], * }, * }); * ``` * * ## Import * * ### Identity Schema * * #### Required * * - `arn` (String) Amazon Resource Name (ARN) of the Security Hub automation rule. * * Using `pulumi import`, import Security Hub automation rule using their ARN. For example: * * console * * % pulumi import aws_securityhub_automation_rule.example arn:aws:securityhub:us-west-2:123456789012:automation-rule/473eddde-f5c4-4ae5-85c7-e922f271fffc */ class AutomationRule extends pulumi.CustomResource { /** * Get an existing AutomationRule 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 AutomationRule(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of AutomationRule. 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'] === AutomationRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["actions"] = state?.actions; resourceInputs["arn"] = state?.arn; resourceInputs["criteria"] = state?.criteria; resourceInputs["description"] = state?.description; resourceInputs["isTerminal"] = state?.isTerminal; resourceInputs["region"] = state?.region; resourceInputs["ruleName"] = state?.ruleName; resourceInputs["ruleOrder"] = state?.ruleOrder; resourceInputs["ruleStatus"] = state?.ruleStatus; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; } else { const args = argsOrState; if (args?.description === undefined && !opts.urn) { throw new Error("Missing required property 'description'"); } if (args?.ruleName === undefined && !opts.urn) { throw new Error("Missing required property 'ruleName'"); } if (args?.ruleOrder === undefined && !opts.urn) { throw new Error("Missing required property 'ruleOrder'"); } resourceInputs["actions"] = args?.actions; resourceInputs["criteria"] = args?.criteria; resourceInputs["description"] = args?.description; resourceInputs["isTerminal"] = args?.isTerminal; resourceInputs["region"] = args?.region; resourceInputs["ruleName"] = args?.ruleName; resourceInputs["ruleOrder"] = args?.ruleOrder; resourceInputs["ruleStatus"] = args?.ruleStatus; resourceInputs["tags"] = args?.tags; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AutomationRule.__pulumiType, name, resourceInputs, opts); } } exports.AutomationRule = AutomationRule; /** @internal */ AutomationRule.__pulumiType = 'aws:securityhub/automationRule:AutomationRule'; //# sourceMappingURL=automationRule.js.map