UNPKG

@pulumi/gcp

Version:

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

273 lines • 10.3 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Entry = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * An entry represents a data asset for which you capture metadata, such as a BigQuery table. * The primary constituents of an entry are aspects, which provide thematically coherent information. * Examples include a table's schema, sensitive data protection profile, data quality information, or a simple tag. * * **Important Considerations:** * * * There is a limit of 99 aspects per entry. * * The entry resource has to use project numbers and not project IDs. Therefore, if * a dependency was already provisioned using project ID, it needs to be referenced explicitly as a resource name * containing the project number. * * To get more information about Entry, see: * * * [API documentation](https://cloud.google.com/dataplex/docs/reference/rest/v1/projects.locations.entryGroups.entries) * * How-to Guides * * [Manage entries and ingest custom sources](https://cloud.google.com/dataplex/docs/ingest-custom-sources) * * ## Example Usage * * ### Dataplex Entry 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", { * entryGroupId: "entry-group-basic", * project: "1111111111111", * location: "us-central1", * }); * const entry_type_basic = new gcp.dataplex.EntryType("entry-type-basic", { * entryTypeId: "entry-type-basic", * project: "1111111111111", * location: "us-central1", * }); * const testBasic = new gcp.dataplex.Entry("test_basic", { * entryGroupId: entry_group_basic.entryGroupId, * project: "1111111111111", * location: "us-central1", * entryId: "entry-basic", * entryType: entry_type_basic.name, * }); * ``` * ### Dataplex Entry Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const aspect_type_full_one = new gcp.dataplex.AspectType("aspect-type-full-one", { * aspectTypeId: "aspect-type-full-one", * location: "us-central1", * project: "1111111111111", * metadataTemplate: `{ * "name": "tf-test-template", * "type": "record", * "recordFields": [ * { * "name": "type", * "type": "enum", * "annotations": { * "displayName": "Type", * "description": "Specifies the type of view represented by the entry." * }, * "index": 1, * "constraints": { * "required": true * }, * "enumValues": [ * { * "name": "VIEW", * "index": 1 * } * ] * } * ] * } * `, * }); * const aspect_type_full_two = new gcp.dataplex.AspectType("aspect-type-full-two", { * aspectTypeId: "aspect-type-full-two", * location: "us-central1", * project: "1111111111111", * metadataTemplate: `{ * "name": "tf-test-template", * "type": "record", * "recordFields": [ * { * "name": "story", * "type": "enum", * "annotations": { * "displayName": "Story", * "description": "Specifies the story of an entry." * }, * "index": 1, * "constraints": { * "required": true * }, * "enumValues": [ * { * "name": "SEQUENCE", * "index": 1 * } * ] * } * ] * } * `, * }); * const entry_group_full = new gcp.dataplex.EntryGroup("entry-group-full", { * entryGroupId: "entry-group-full", * project: "1111111111111", * location: "us-central1", * }); * const entry_type_full = new gcp.dataplex.EntryType("entry-type-full", { * entryTypeId: "entry-type-full", * project: "1111111111111", * location: "us-central1", * requiredAspects: [{ * type: aspect_type_full_one.name, * }], * }); * const testEntryFull = new gcp.dataplex.Entry("test_entry_full", { * entryGroupId: entry_group_full.entryGroupId, * project: "1111111111111", * location: "us-central1", * entryId: "entry-full/has/slashes", * entryType: entry_type_full.name, * fullyQualifiedName: "bigquery:1111111111111.test-dataset", * parentEntry: "projects/1111111111111/locations/us-central1/entryGroups/entry-group-full/entries/some-other-entry", * entrySource: { * resource: "bigquery:1111111111111.test-dataset", * system: "System III", * platform: "BigQuery", * displayName: "Human readable name", * description: "Description from source system", * labels: { * "some-label": "some-value", * }, * ancestors: [ * { * name: "ancestor-one", * type: "type-one", * }, * { * name: "ancestor-two", * type: "type-two", * }, * ], * createTime: "2023-08-03T19:19:00.094Z", * updateTime: "2023-08-03T20:19:00.094Z", * }, * aspects: [ * { * aspectKey: "1111111111111.us-central1.aspect-type-full-one", * aspect: { * data: " {\"type\": \"VIEW\" }\n", * }, * }, * { * aspectKey: "1111111111111.us-central1.aspect-type-full-two", * aspect: { * data: " {\"story\": \"SEQUENCE\" }\n", * }, * }, * ], * }, { * dependsOn: [ * aspect_type_full_two, * aspect_type_full_one, * ], * }); * ``` * * ## Import * * Entry can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/entryGroups/{{entry_group_id}}/entries/{{entry_id}}` * * * `{{project}}/{{location}}/{{entry_group_id}}/{{entry_id}}` * * * `{{location}}/{{entry_group_id}}/{{entry_id}}` * * When using the `pulumi import` command, Entry can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:dataplex/entry:Entry default projects/{{project}}/locations/{{location}}/entryGroups/{{entry_group_id}}/entries/{{entry_id}} * ``` * * ```sh * $ pulumi import gcp:dataplex/entry:Entry default {{project}}/{{location}}/{{entry_group_id}}/{{entry_id}} * ``` * * ```sh * $ pulumi import gcp:dataplex/entry:Entry default {{location}}/{{entry_group_id}}/{{entry_id}} * ``` */ class Entry extends pulumi.CustomResource { /** * Get an existing Entry 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 Entry(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Entry. 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'] === Entry.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["aspects"] = state ? state.aspects : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["entryGroupId"] = state ? state.entryGroupId : undefined; resourceInputs["entryId"] = state ? state.entryId : undefined; resourceInputs["entrySource"] = state ? state.entrySource : undefined; resourceInputs["entryType"] = state ? state.entryType : undefined; resourceInputs["fullyQualifiedName"] = state ? state.fullyQualifiedName : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["parentEntry"] = state ? state.parentEntry : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; } else { const args = argsOrState; if ((!args || args.entryType === undefined) && !opts.urn) { throw new Error("Missing required property 'entryType'"); } resourceInputs["aspects"] = args ? args.aspects : undefined; resourceInputs["entryGroupId"] = args ? args.entryGroupId : undefined; resourceInputs["entryId"] = args ? args.entryId : undefined; resourceInputs["entrySource"] = args ? args.entrySource : undefined; resourceInputs["entryType"] = args ? args.entryType : undefined; resourceInputs["fullyQualifiedName"] = args ? args.fullyQualifiedName : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["parentEntry"] = args ? args.parentEntry : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Entry.__pulumiType, name, resourceInputs, opts); } } exports.Entry = Entry; /** @internal */ Entry.__pulumiType = 'gcp:dataplex/entry:Entry'; //# sourceMappingURL=entry.js.map