UNPKG

@pulumi/gcp

Version:

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

244 lines • 10.6 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.EntryLink = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * EntryLink represents a link between two Entries. * * To get more information about EntryLink, see: * * * [API documentation](https://cloud.google.com/dataplex/docs/reference/rest/v1/projects.locations.entryGroups.entryLinks) * * How-to Guides * * [Official Documentation](https://cloud.google.com/dataplex/docs) * * ## Example Usage * * ### Dataplex Entry Link Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const entry_group_basic = new gcp.dataplex.EntryGroup("entry-group-basic", { * location: "us-central1", * entryGroupId: "tf-test-entry-group_1443", * project: "1111111111111", * }); * const entry_type_basic = new gcp.dataplex.EntryType("entry-type-basic", { * entryTypeId: "tf-test-entry-type_8647", * location: "us-central1", * project: "1111111111111", * }); * const source = new gcp.dataplex.Entry("source", { * location: "us-central1", * entryGroupId: entry_group_basic.entryGroupId, * entryId: "tf-test-source-entry_26032", * entryType: entry_type_basic.name, * project: "1111111111111", * }); * const target = new gcp.dataplex.Entry("target", { * location: "us-central1", * entryGroupId: entry_group_basic.entryGroupId, * entryId: "tf-test-target-entry_50610", * entryType: entry_type_basic.name, * project: "1111111111111", * }); * const basicEntryLink = new gcp.dataplex.EntryLink("basic_entry_link", { * project: "1111111111111", * location: "us-central1", * entryGroupId: entry_group_basic.entryGroupId, * entryLinkId: "tf-test-entry-link_77124", * entryLinkType: "projects/655216118709/locations/global/entryLinkTypes/related", * entryReferences: [ * { * name: source.name, * }, * { * name: target.name, * }, * ], * }); * ``` * ### Dataplex Entry Link Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as time from "@pulumiverse/time"; * * const entry_group_full = new gcp.dataplex.EntryGroup("entry-group-full", { * location: "us-central1", * entryGroupId: "tf-test-entry-group_15335", * project: "1111111111111", * }); * const entry_type_full = new gcp.dataplex.EntryType("entry-type-full", { * entryTypeId: "tf-test-entry-type_85160", * location: "us-central1", * project: "1111111111111", * }); * const source = new gcp.dataplex.Entry("source", { * location: "us-central1", * entryGroupId: entry_group_full.entryGroupId, * entryId: "tf-test-source-entry_20665", * entryType: entry_type_full.name, * project: "1111111111111", * }); * const termTestIdFull = new gcp.dataplex.Glossary("term_test_id_full", { * glossaryId: "tf-test-glossary_92130", * location: "us-central1", * }); * const termTestIdFullGlossaryTerm = new gcp.dataplex.GlossaryTerm("term_test_id_full", { * parent: pulumi.interpolate`projects/${termTestIdFull.project}/locations/us-central1/glossaries/${termTestIdFull.glossaryId}`, * glossaryId: termTestIdFull.glossaryId, * location: "us-central1", * termId: "tf-test-term-full_16199", * labels: { * tag: "test-tf", * }, * displayName: "terraform term", * description: "term created by Terraform", * }); * // Introduce a 45-second wait after the glossary resource creation * const wait_for_sync = new time.Sleep("wait-for-sync", {createDuration: "45s"}, { * dependsOn: [termTestIdFullGlossaryTerm], * }); * const fullEntryLink = new gcp.dataplex.EntryLink("full_entry_link", { * project: "1111111111111", * location: "us-central1", * entryGroupId: entry_group_full.entryGroupId, * entryLinkId: "tf-test-entry-link_21563", * entryLinkType: "projects/655216118709/locations/global/entryLinkTypes/definition", * entryReferences: [ * { * name: source.name, * type: "SOURCE", * path: "", * }, * { * name: pulumi.all([entry_group_full.project, entry_group_full.project, termTestIdFull.glossaryId, termTestIdFullGlossaryTerm.termId]).apply(([entry-group-fullProject, entry-group-fullProject1, glossaryId, termId]) => `projects/${entry_group_fullProject}/locations/us-central1/entryGroups/@dataplex/entries/projects/${entry_group_fullProject1}/locations/us-central1/glossaries/${glossaryId}/terms/${termId}`), * type: "TARGET", * }, * ], * }, { * dependsOn: [wait_for_sync], * }); * ``` * ## Import * * EntryLink can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/entryGroups/{{entry_group_id}}/entryLinks/{{entry_link_id}}` * * `{{project}}/{{location}}/{{entry_group_id}}/{{entry_link_id}}` * * `{{location}}/{{entry_group_id}}/{{entry_link_id}}` * * When using the `pulumi import` command, EntryLink can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:dataplex/entryLink:EntryLink default projects/{{project}}/locations/{{location}}/entryGroups/{{entry_group_id}}/entryLinks/{{entry_link_id}} * $ pulumi import gcp:dataplex/entryLink:EntryLink default {{project}}/{{location}}/{{entry_group_id}}/{{entry_link_id}} * $ pulumi import gcp:dataplex/entryLink:EntryLink default {{location}}/{{entry_group_id}}/{{entry_link_id}} * ``` */ class EntryLink extends pulumi.CustomResource { /** * Get an existing EntryLink 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 EntryLink(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:dataplex/entryLink:EntryLink'; /** * Returns true if the given object is an instance of EntryLink. 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'] === EntryLink.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["aspects"] = state?.aspects; resourceInputs["createTime"] = state?.createTime; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["entryGroupId"] = state?.entryGroupId; resourceInputs["entryLinkId"] = state?.entryLinkId; resourceInputs["entryLinkType"] = state?.entryLinkType; resourceInputs["entryReferences"] = state?.entryReferences; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["updateTime"] = state?.updateTime; } else { const args = argsOrState; if (args?.entryGroupId === undefined && !opts.urn) { throw new Error("Missing required property 'entryGroupId'"); } if (args?.entryLinkId === undefined && !opts.urn) { throw new Error("Missing required property 'entryLinkId'"); } if (args?.entryLinkType === undefined && !opts.urn) { throw new Error("Missing required property 'entryLinkType'"); } if (args?.entryReferences === undefined && !opts.urn) { throw new Error("Missing required property 'entryReferences'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["aspects"] = args?.aspects; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["entryGroupId"] = args?.entryGroupId; resourceInputs["entryLinkId"] = args?.entryLinkId; resourceInputs["entryLinkType"] = args?.entryLinkType; resourceInputs["entryReferences"] = args?.entryReferences; resourceInputs["location"] = args?.location; resourceInputs["project"] = args?.project; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(EntryLink.__pulumiType, name, resourceInputs, opts); } } exports.EntryLink = EntryLink; //# sourceMappingURL=entryLink.js.map