@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
133 lines • 5.83 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.DataAccessLabel = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A DataAccessLabel is a label on events to define user access to data.
*
* To get more information about DataAccessLabel, see:
*
* * [API documentation](https://cloud.google.com/chronicle/docs/reference/rest/v1/projects.locations.instances.dataAccessLabels)
* * How-to Guides
* * [Introduction to data RBAC](https://cloud.google.com/chronicle/docs/onboard/onboard-datarbac)
*
* ## Example Usage
*
* ### Chronicle Dataaccesslabel Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const example = new gcp.chronicle.DataAccessLabel("example", {
* location: "us",
* instance: "00000000-0000-0000-0000-000000000000",
* dataAccessLabelId: "label-id",
* udmQuery: "principal.hostname=\"google.com\"",
* description: "label-description",
* });
* ```
*
* ## Import
*
* DataAccessLabel can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/instances/{{instance}}/dataAccessLabels/{{data_access_label_id}}`
*
* * `{{project}}/{{location}}/{{instance}}/{{data_access_label_id}}`
*
* * `{{location}}/{{instance}}/{{data_access_label_id}}`
*
* When using the `pulumi import` command, DataAccessLabel can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:chronicle/dataAccessLabel:DataAccessLabel default projects/{{project}}/locations/{{location}}/instances/{{instance}}/dataAccessLabels/{{data_access_label_id}}
* ```
*
* ```sh
* $ pulumi import gcp:chronicle/dataAccessLabel:DataAccessLabel default {{project}}/{{location}}/{{instance}}/{{data_access_label_id}}
* ```
*
* ```sh
* $ pulumi import gcp:chronicle/dataAccessLabel:DataAccessLabel default {{location}}/{{instance}}/{{data_access_label_id}}
* ```
*/
class DataAccessLabel extends pulumi.CustomResource {
/**
* Get an existing DataAccessLabel 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 DataAccessLabel(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of DataAccessLabel. 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'] === DataAccessLabel.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["author"] = state?.author;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["dataAccessLabelId"] = state?.dataAccessLabelId;
resourceInputs["description"] = state?.description;
resourceInputs["displayName"] = state?.displayName;
resourceInputs["instance"] = state?.instance;
resourceInputs["lastEditor"] = state?.lastEditor;
resourceInputs["location"] = state?.location;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
resourceInputs["udmQuery"] = state?.udmQuery;
resourceInputs["updateTime"] = state?.updateTime;
}
else {
const args = argsOrState;
if (args?.dataAccessLabelId === undefined && !opts.urn) {
throw new Error("Missing required property 'dataAccessLabelId'");
}
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?.udmQuery === undefined && !opts.urn) {
throw new Error("Missing required property 'udmQuery'");
}
resourceInputs["dataAccessLabelId"] = args?.dataAccessLabelId;
resourceInputs["description"] = args?.description;
resourceInputs["instance"] = args?.instance;
resourceInputs["location"] = args?.location;
resourceInputs["project"] = args?.project;
resourceInputs["udmQuery"] = args?.udmQuery;
resourceInputs["author"] = undefined /*out*/;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["displayName"] = undefined /*out*/;
resourceInputs["lastEditor"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DataAccessLabel.__pulumiType, name, resourceInputs, opts);
}
}
exports.DataAccessLabel = DataAccessLabel;
/** @internal */
DataAccessLabel.__pulumiType = 'gcp:chronicle/dataAccessLabel:DataAccessLabel';
//# sourceMappingURL=dataAccessLabel.js.map
;