@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
214 lines • 9.41 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! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ParserExtension = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* A parser extension allows customers to extend or customize the behavior of an existing prebuilt or custom parser.
* It enables extracting additional fields from raw logs without modifying the base parser.
*
* To get more information about ParserExtension, see:
*
* * [API documentation](https://cloud.google.com/chronicle/docs/reference/rest/v1/projects.locations.instances.logTypes.parserExtensions)
* * How-to Guides
* * [Custom parsers overview](https://cloud.google.com/chronicle/docs/detection/custom-parsers-overview)
*
* ## Example Usage
*
* ### Chronicle Parserextension Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const example = new gcp.chronicle.ParserExtension("example", {
* location: "us",
* instance: "00000000-0000-0000-0000-000000000000",
* logType: "CISCO_DHCP",
* validationSkipped: true,
* cbnSnippet: "ZHVtbXkgZXh0ZW5zaW9uIHNuaXBwZXQ=",
* });
* ```
* ### Chronicle Parserextension Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const example = new gcp.chronicle.ParserExtension("example", {
* location: "us",
* instance: "00000000-0000-0000-0000-000000000000",
* logType: "AKAMAI_DHCP",
* validationSkipped: true,
* log: "ZHVtbXkgbG9n",
* fieldExtractors: {
* logFormat: "JSON",
* appendRepeatedFields: true,
* preprocessConfig: {
* grokRegex: "(?P<message>.*)",
* target: "message",
* },
* extractors: [
* {
* fieldPath: "$.user",
* destinationPath: "udm.principal.user.userid",
* value: "static-override",
* },
* {
* fieldPath: "$.event",
* destinationPath: "udm.metadata.event_type",
* preconditionOp: "EQUALS",
* preconditionPath: "$.event",
* preconditionValue: "login",
* },
* ],
* },
* });
* ```
* ### Chronicle Parserextension Dynamic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const example = new gcp.chronicle.ParserExtension("example", {
* location: "us",
* instance: "00000000-0000-0000-0000-000000000000",
* logType: "AKAMAI_DHCP",
* validationSkipped: true,
* log: "ZHVtbXkgbG9n",
* dynamicParsing: {
* optedFields: [{
* path: "$.ip",
* sampleValue: "1.1.1.1",
* }],
* },
* });
* ```
*
* ## Import
*
* ParserExtension can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/instances/{{instance}}/logTypes/{{log_type}}/parserExtensions/{{parserextension}}`
* * `{{project}}/{{location}}/{{instance}}/{{log_type}}/{{parserextension}}`
* * `{{location}}/{{instance}}/{{log_type}}/{{parserextension}}`
*
* When using the `pulumi import` command, ParserExtension can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:chronicle/parserExtension:ParserExtension default projects/{{project}}/locations/{{location}}/instances/{{instance}}/logTypes/{{log_type}}/parserExtensions/{{parserextension}}
* $ pulumi import gcp:chronicle/parserExtension:ParserExtension default {{project}}/{{location}}/{{instance}}/{{log_type}}/{{parserextension}}
* $ pulumi import gcp:chronicle/parserExtension:ParserExtension default {{location}}/{{instance}}/{{log_type}}/{{parserextension}}
* ```
*/
class ParserExtension extends pulumi.CustomResource {
/**
* Get an existing ParserExtension 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 ParserExtension(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:chronicle/parserExtension:ParserExtension';
/**
* Returns true if the given object is an instance of ParserExtension. 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'] === ParserExtension.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["cbnSnippet"] = state?.cbnSnippet;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["dynamicParsing"] = state?.dynamicParsing;
resourceInputs["extensionValidationReport"] = state?.extensionValidationReport;
resourceInputs["fieldExtractors"] = state?.fieldExtractors;
resourceInputs["instance"] = state?.instance;
resourceInputs["lastLiveTime"] = state?.lastLiveTime;
resourceInputs["location"] = state?.location;
resourceInputs["log"] = state?.log;
resourceInputs["logType"] = state?.logType;
resourceInputs["name"] = state?.name;
resourceInputs["parserextension"] = state?.parserextension;
resourceInputs["project"] = state?.project;
resourceInputs["state"] = state?.state;
resourceInputs["stateLastChangedTime"] = state?.stateLastChangedTime;
resourceInputs["validationReport"] = state?.validationReport;
resourceInputs["validationSkipped"] = state?.validationSkipped;
}
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'");
}
if (args?.logType === undefined && !opts.urn) {
throw new Error("Missing required property 'logType'");
}
resourceInputs["cbnSnippet"] = args?.cbnSnippet;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["dynamicParsing"] = args?.dynamicParsing;
resourceInputs["fieldExtractors"] = args?.fieldExtractors;
resourceInputs["instance"] = args?.instance;
resourceInputs["location"] = args?.location;
resourceInputs["log"] = args?.log;
resourceInputs["logType"] = args?.logType;
resourceInputs["project"] = args?.project;
resourceInputs["validationSkipped"] = args?.validationSkipped;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["extensionValidationReport"] = undefined /*out*/;
resourceInputs["lastLiveTime"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["parserextension"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["stateLastChangedTime"] = undefined /*out*/;
resourceInputs["validationReport"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ParserExtension.__pulumiType, name, resourceInputs, opts);
}
}
exports.ParserExtension = ParserExtension;
//# sourceMappingURL=parserExtension.js.map