UNPKG

@pulumi/gcp

Version:

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

183 lines • 8.51 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** 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, Object.assign(Object.assign({}, 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 ? state.allowedRunFrequencies : undefined; resourceInputs["author"] = state ? state.author : undefined; resourceInputs["compilationDiagnostics"] = state ? state.compilationDiagnostics : undefined; resourceInputs["compilationState"] = state ? state.compilationState : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["dataTables"] = state ? state.dataTables : undefined; resourceInputs["deletionPolicy"] = state ? state.deletionPolicy : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["etag"] = state ? state.etag : undefined; resourceInputs["instance"] = state ? state.instance : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["metadata"] = state ? state.metadata : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["nearRealTimeLiveRuleEligible"] = state ? state.nearRealTimeLiveRuleEligible : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["referenceLists"] = state ? state.referenceLists : undefined; resourceInputs["revisionCreateTime"] = state ? state.revisionCreateTime : undefined; resourceInputs["revisionId"] = state ? state.revisionId : undefined; resourceInputs["ruleId"] = state ? state.ruleId : undefined; resourceInputs["scope"] = state ? state.scope : undefined; resourceInputs["severities"] = state ? state.severities : undefined; resourceInputs["text"] = state ? state.text : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.instance === undefined) && !opts.urn) { throw new Error("Missing required property 'instance'"); } if ((!args || args.location === undefined) && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["deletionPolicy"] = args ? args.deletionPolicy : undefined; resourceInputs["etag"] = args ? args.etag : undefined; resourceInputs["instance"] = args ? args.instance : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["ruleId"] = args ? args.ruleId : undefined; resourceInputs["scope"] = args ? args.scope : undefined; resourceInputs["text"] = args ? args.text : undefined; 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