UNPKG

@pulumi/gcp

Version:

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

197 lines • 8.85 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! *** 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.DataExport = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * DataExport resource represents a request to export data from Chronicle to a GCS bucket. * * To get more information about DataExport, see: * * * [API documentation](https://cloud.google.com/chronicle/docs/reference/rest/v1beta/projects.locations.instances.dataExports) * * How-to Guides * * [Data Export Overview](https://cloud.google.com/chronicle/docs/secops/data-export-overview) * * ## Example Usage * * ### Chronicle Data Export Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({ * projectId: "my-project-name", * }); * const testBucket = new gcp.storage.Bucket("test_bucket", { * name: "chronicle-test-bucket-my-project-name-_91042", * project: "my-project-name", * location: "us", * forceDestroy: true, * }); * const example = new gcp.chronicle.DataExport("example", { * location: "us", * instance: "00000000-0000-0000-0000-000000000000", * gcsBucket: pulumi.all([project, testBucket.name]).apply(([project, name]) => `projects/${project.number}/buckets/${name}`), * startTime: "2025-01-01T00:00:00Z", * endTime: "2025-01-01T12:00:00Z", * }); * ``` * ### Chronicle Data Export Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({ * projectId: "my-project-name", * }); * const testBucket = new gcp.storage.Bucket("test_bucket", { * name: "chronicle-test-bucket-my-project-name-_72490", * project: "my-project-name", * location: "us", * forceDestroy: true, * }); * const example = new gcp.chronicle.DataExport("example", { * location: "us", * instance: "00000000-0000-0000-0000-000000000000", * gcsBucket: pulumi.all([project, testBucket.name]).apply(([project, name]) => `projects/${project.number}/buckets/${name}`), * startTime: "2025-01-01T00:00:00Z", * endTime: "2025-01-01T12:00:00Z", * includeLogTypes: ["projects/my-project-name/locations/us/instances/00000000-0000-0000-0000-000000000000/logTypes/GCP_CLOUDAUDIT"], * ingestionLabels: [{ * key: "key1", * value: "val1", * }], * namespaces: ["my-namespace"], * }); * ``` * * ## Import * * DataExport can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/instances/{{instance}}/dataExports/{{data_export_id}}` * * `{{project}}/{{location}}/{{instance}}/{{data_export_id}}` * * `{{location}}/{{instance}}/{{data_export_id}}` * * When using the `pulumi import` command, DataExport can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:chronicle/dataExport:DataExport default projects/{{project}}/locations/{{location}}/instances/{{instance}}/dataExports/{{data_export_id}} * $ pulumi import gcp:chronicle/dataExport:DataExport default {{project}}/{{location}}/{{instance}}/{{data_export_id}} * $ pulumi import gcp:chronicle/dataExport:DataExport default {{location}}/{{instance}}/{{data_export_id}} * ``` */ class DataExport extends pulumi.CustomResource { /** * Get an existing DataExport 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 DataExport(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:chronicle/dataExport:DataExport'; /** * Returns true if the given object is an instance of DataExport. 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'] === DataExport.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createTime"] = state?.createTime; resourceInputs["dataExportId"] = state?.dataExportId; resourceInputs["dataExportStatuses"] = state?.dataExportStatuses; resourceInputs["endTime"] = state?.endTime; resourceInputs["estimatedVolume"] = state?.estimatedVolume; resourceInputs["exportedVolume"] = state?.exportedVolume; resourceInputs["gcsBucket"] = state?.gcsBucket; resourceInputs["includeLogTypes"] = state?.includeLogTypes; resourceInputs["ingestionLabels"] = state?.ingestionLabels; resourceInputs["instance"] = state?.instance; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["namespaces"] = state?.namespaces; resourceInputs["project"] = state?.project; resourceInputs["startTime"] = state?.startTime; resourceInputs["updateTime"] = state?.updateTime; } else { const args = argsOrState; if (args?.endTime === undefined && !opts.urn) { throw new Error("Missing required property 'endTime'"); } if (args?.gcsBucket === undefined && !opts.urn) { throw new Error("Missing required property 'gcsBucket'"); } 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?.startTime === undefined && !opts.urn) { throw new Error("Missing required property 'startTime'"); } resourceInputs["endTime"] = args?.endTime; resourceInputs["gcsBucket"] = args?.gcsBucket; resourceInputs["includeLogTypes"] = args?.includeLogTypes; resourceInputs["ingestionLabels"] = args?.ingestionLabels; resourceInputs["instance"] = args?.instance; resourceInputs["location"] = args?.location; resourceInputs["namespaces"] = args?.namespaces; resourceInputs["project"] = args?.project; resourceInputs["startTime"] = args?.startTime; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["dataExportId"] = undefined /*out*/; resourceInputs["dataExportStatuses"] = undefined /*out*/; resourceInputs["estimatedVolume"] = undefined /*out*/; resourceInputs["exportedVolume"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(DataExport.__pulumiType, name, resourceInputs, opts); } } exports.DataExport = DataExport; //# sourceMappingURL=dataExport.js.map