@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
127 lines • 5.64 kB
JavaScript
;
// *** 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
*
* Using `pulumi import`, import Security Hub automation rule using their ARN. For example:
*
* ```sh
* $ pulumi import aws:securityhub/automationRule:AutomationRule 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, Object.assign(Object.assign({}, 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 ? state.actions : undefined;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["criteria"] = state ? state.criteria : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["isTerminal"] = state ? state.isTerminal : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["ruleName"] = state ? state.ruleName : undefined;
resourceInputs["ruleOrder"] = state ? state.ruleOrder : undefined;
resourceInputs["ruleStatus"] = state ? state.ruleStatus : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
}
else {
const args = argsOrState;
if ((!args || args.description === undefined) && !opts.urn) {
throw new Error("Missing required property 'description'");
}
if ((!args || args.ruleName === undefined) && !opts.urn) {
throw new Error("Missing required property 'ruleName'");
}
if ((!args || args.ruleOrder === undefined) && !opts.urn) {
throw new Error("Missing required property 'ruleOrder'");
}
resourceInputs["actions"] = args ? args.actions : undefined;
resourceInputs["criteria"] = args ? args.criteria : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["isTerminal"] = args ? args.isTerminal : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["ruleName"] = args ? args.ruleName : undefined;
resourceInputs["ruleOrder"] = args ? args.ruleOrder : undefined;
resourceInputs["ruleStatus"] = args ? args.ruleStatus : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
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