@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
133 lines • 6.25 kB
JavaScript
;
// *** 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.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, Object.assign(Object.assign({}, 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 ? state.author : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["dataAccessLabelId"] = state ? state.dataAccessLabelId : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["instance"] = state ? state.instance : undefined;
resourceInputs["lastEditor"] = state ? state.lastEditor : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["udmQuery"] = state ? state.udmQuery : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
}
else {
const args = argsOrState;
if ((!args || args.dataAccessLabelId === undefined) && !opts.urn) {
throw new Error("Missing required property 'dataAccessLabelId'");
}
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'");
}
if ((!args || args.udmQuery === undefined) && !opts.urn) {
throw new Error("Missing required property 'udmQuery'");
}
resourceInputs["dataAccessLabelId"] = args ? args.dataAccessLabelId : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["instance"] = args ? args.instance : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["udmQuery"] = args ? args.udmQuery : undefined;
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