UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

183 lines • 7.86 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.Rule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * The Rule resource represents a user-created rule. * * To get more information about Rule, see: * * * [API documentation](https://cloud.google.com/chronicle/docs/reference/rest/v1/projects.locations.instances.rules) * * How-to Guides * * [Google SecOps Guides](https://cloud.google.com/chronicle/docs/secops/secops-overview) * * ## Example Usage * * ### Chronicle Rule Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const example = new gcp.chronicle.Rule("example", { * location: "us", * instance: "00000000-0000-0000-0000-000000000000", * deletionPolicy: "DEFAULT", * text: "rule test_rule { meta: events: $userid = $e.principal.user.userid match: $userid over 10m condition: $e }\n", * }); * ``` * ### Chronicle Rule With Force Deletion * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const example = new gcp.chronicle.Rule("example", { * location: "us", * instance: "00000000-0000-0000-0000-000000000000", * deletionPolicy: "FORCE", * text: "rule test_rule { meta: events: $userid = $e.principal.user.userid match: $userid over 10m condition: $e }\n", * }); * ``` * ### Chronicle Rule With Data Access Scope * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const dataAccessScopeTest = new gcp.chronicle.DataAccessScope("data_access_scope_test", { * location: "us", * instance: "00000000-0000-0000-0000-000000000000", * dataAccessScopeId: "scope-name", * description: "scope-description", * allowedDataAccessLabels: [{ * logType: "GCP_CLOUDAUDIT", * }], * }); * const example = new gcp.chronicle.Rule("example", { * location: "us", * instance: "00000000-0000-0000-0000-000000000000", * scope: googleChronicleDataAccessScope.dataAccessScopeTest.name, * text: "rule test_rule { meta: events: $userid = $e.principal.user.userid match: $userid over 10m condition: $e }\n", * }); * ``` * * ## Import * * Rule can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/instances/{{instance}}/rules/{{rule_id}}` * * * `{{project}}/{{location}}/{{instance}}/{{rule_id}}` * * * `{{location}}/{{instance}}/{{rule_id}}` * * When using the `pulumi import` command, Rule can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:chronicle/rule:Rule default projects/{{project}}/locations/{{location}}/instances/{{instance}}/rules/{{rule_id}} * ``` * * ```sh * $ pulumi import gcp:chronicle/rule:Rule default {{project}}/{{location}}/{{instance}}/{{rule_id}} * ``` * * ```sh * $ pulumi import gcp:chronicle/rule:Rule default {{location}}/{{instance}}/{{rule_id}} * ``` */ class Rule extends pulumi.CustomResource { /** * Get an existing Rule 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 Rule(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Rule. 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'] === Rule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["allowedRunFrequencies"] = state?.allowedRunFrequencies; resourceInputs["author"] = state?.author; resourceInputs["compilationDiagnostics"] = state?.compilationDiagnostics; resourceInputs["compilationState"] = state?.compilationState; resourceInputs["createTime"] = state?.createTime; resourceInputs["dataTables"] = state?.dataTables; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["displayName"] = state?.displayName; resourceInputs["etag"] = state?.etag; resourceInputs["instance"] = state?.instance; resourceInputs["location"] = state?.location; resourceInputs["metadata"] = state?.metadata; resourceInputs["name"] = state?.name; resourceInputs["nearRealTimeLiveRuleEligible"] = state?.nearRealTimeLiveRuleEligible; resourceInputs["project"] = state?.project; resourceInputs["referenceLists"] = state?.referenceLists; resourceInputs["revisionCreateTime"] = state?.revisionCreateTime; resourceInputs["revisionId"] = state?.revisionId; resourceInputs["ruleId"] = state?.ruleId; resourceInputs["scope"] = state?.scope; resourceInputs["severities"] = state?.severities; resourceInputs["text"] = state?.text; resourceInputs["type"] = state?.type; } else { const args = argsOrState; if (args?.instance === undefined && !opts.urn) { throw new Error("Missing required property 'instance'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["etag"] = args?.etag; resourceInputs["instance"] = args?.instance; resourceInputs["location"] = args?.location; resourceInputs["project"] = args?.project; resourceInputs["ruleId"] = args?.ruleId; resourceInputs["scope"] = args?.scope; resourceInputs["text"] = args?.text; resourceInputs["allowedRunFrequencies"] = undefined /*out*/; resourceInputs["author"] = undefined /*out*/; resourceInputs["compilationDiagnostics"] = undefined /*out*/; resourceInputs["compilationState"] = undefined /*out*/; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["dataTables"] = undefined /*out*/; resourceInputs["displayName"] = undefined /*out*/; resourceInputs["metadata"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["nearRealTimeLiveRuleEligible"] = undefined /*out*/; resourceInputs["referenceLists"] = undefined /*out*/; resourceInputs["revisionCreateTime"] = undefined /*out*/; resourceInputs["revisionId"] = undefined /*out*/; resourceInputs["severities"] = undefined /*out*/; resourceInputs["type"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Rule.__pulumiType, name, resourceInputs, opts); } } exports.Rule = Rule; /** @internal */ Rule.__pulumiType = 'gcp:chronicle/rule:Rule'; //# sourceMappingURL=rule.js.map