@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
137 lines • 5.59 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.PolicyTag = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Denotes one policy tag in a taxonomy.
*
* To get more information about PolicyTag, see:
*
* * [API documentation](https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.taxonomies.policyTags)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/data-catalog/docs)
*
* ## Example Usage
*
* ### Data Catalog Taxonomies Policy Tag Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const myTaxonomy = new gcp.datacatalog.Taxonomy("my_taxonomy", {
* displayName: "taxonomy_display_name",
* description: "A collection of policy tags",
* activatedPolicyTypes: ["FINE_GRAINED_ACCESS_CONTROL"],
* });
* const basicPolicyTag = new gcp.datacatalog.PolicyTag("basic_policy_tag", {
* taxonomy: myTaxonomy.id,
* displayName: "Low security",
* description: "A policy tag normally associated with low security items",
* });
* ```
* ### Data Catalog Taxonomies Policy Tag Child Policies
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const myTaxonomy = new gcp.datacatalog.Taxonomy("my_taxonomy", {
* displayName: "taxonomy_display_name",
* description: "A collection of policy tags",
* activatedPolicyTypes: ["FINE_GRAINED_ACCESS_CONTROL"],
* });
* const parentPolicy = new gcp.datacatalog.PolicyTag("parent_policy", {
* taxonomy: myTaxonomy.id,
* displayName: "High",
* description: "A policy tag category used for high security access",
* });
* const childPolicy = new gcp.datacatalog.PolicyTag("child_policy", {
* taxonomy: myTaxonomy.id,
* displayName: "ssn",
* description: "A hash of the users ssn",
* parentPolicyTag: parentPolicy.id,
* });
* const childPolicy2 = new gcp.datacatalog.PolicyTag("child_policy2", {
* taxonomy: myTaxonomy.id,
* displayName: "dob",
* description: "The users date of birth",
* parentPolicyTag: parentPolicy.id,
* }, {
* dependsOn: [childPolicy],
* });
* ```
*
* ## Import
*
* PolicyTag can be imported using any of these accepted formats:
*
* * `{{name}}`
*
* When using the `pulumi import` command, PolicyTag can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:datacatalog/policyTag:PolicyTag default {{name}}
* ```
*/
class PolicyTag extends pulumi.CustomResource {
/**
* Get an existing PolicyTag 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 PolicyTag(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of PolicyTag. 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'] === PolicyTag.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["childPolicyTags"] = state ? state.childPolicyTags : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["parentPolicyTag"] = state ? state.parentPolicyTag : undefined;
resourceInputs["taxonomy"] = state ? state.taxonomy : undefined;
}
else {
const args = argsOrState;
if ((!args || args.displayName === undefined) && !opts.urn) {
throw new Error("Missing required property 'displayName'");
}
if ((!args || args.taxonomy === undefined) && !opts.urn) {
throw new Error("Missing required property 'taxonomy'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["parentPolicyTag"] = args ? args.parentPolicyTag : undefined;
resourceInputs["taxonomy"] = args ? args.taxonomy : undefined;
resourceInputs["childPolicyTags"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(PolicyTag.__pulumiType, name, resourceInputs, opts);
}
}
exports.PolicyTag = PolicyTag;
/** @internal */
PolicyTag.__pulumiType = 'gcp:datacatalog/policyTag:PolicyTag';
//# sourceMappingURL=policyTag.js.map