UNPKG

@pulumi/gcp

Version:

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

231 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.ListingSubscription = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * A Bigquery Analytics Hub listing subscription * * To get more information about ListingSubscription, see: * * * [API documentation](https://cloud.google.com/bigquery/docs/reference/analytics-hub/rest/v1/projects.locations.subscriptions) * * How-to Guides * * [Official Documentation](https://cloud.google.com/bigquery/docs/analytics-hub-introduction) * * > **Note:** When importing the resource with `pulumi import`, provide the destination project and location * in the format projects/{{destination_project}}/locations/{{destination_location}}/subscriptions/{{subscription_id}} * ## Example Usage * * ### Bigquery Analyticshub Listing Subscription Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const subscription = new gcp.bigqueryanalyticshub.DataExchange("subscription", { * location: "US", * dataExchangeId: "my_data_exchange", * displayName: "my_data_exchange", * description: "Test Description", * }); * const subscriptionDataset = new gcp.bigquery.Dataset("subscription", { * datasetId: "my_listing", * friendlyName: "my_listing", * description: "Test Description", * location: "US", * }); * const subscriptionListing = new gcp.bigqueryanalyticshub.Listing("subscription", { * location: "US", * dataExchangeId: subscription.dataExchangeId, * listingId: "my_listing", * displayName: "my_listing", * description: "Test Description", * bigqueryDataset: { * dataset: subscriptionDataset.id, * }, * }); * const subscriptionListingSubscription = new gcp.bigqueryanalyticshub.ListingSubscription("subscription", { * location: "US", * dataExchangeId: subscription.dataExchangeId, * listingId: subscriptionListing.listingId, * destinationDataset: { * description: "A test subscription", * friendlyName: "👋", * labels: { * testing: "123", * }, * location: "US", * datasetReference: { * datasetId: "destination_dataset", * projectId: subscriptionDataset.project, * }, * }, * }); * ``` * ### Bigquery Analyticshub Listing Subscription Multiregion * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const subscription = new gcp.bigqueryanalyticshub.DataExchange("subscription", { * location: "us", * dataExchangeId: "my_data_exchange", * displayName: "my_data_exchange", * }); * const subscriptionListing = new gcp.bigqueryanalyticshub.Listing("subscription", { * location: "us", * dataExchangeId: subscription.dataExchangeId, * listingId: "my_listing", * displayName: "my_listing", * bigqueryDataset: { * dataset: "projects/project_id/datasets/my_listing_example2", * replicaLocations: ["eu"], * }, * }); * const subscriptionListingSubscription = new gcp.bigqueryanalyticshub.ListingSubscription("subscription", { * location: "us", * dataExchangeId: subscription.dataExchangeId, * listingId: subscriptionListing.listingId, * destinationDataset: { * location: "us", * datasetReference: { * projectId: subscription.project, * datasetId: "destination_dataset", * }, * replicaLocations: ["eu"], * }, * }); * ``` * * ## Import * * ListingSubscription can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/subscriptions/{{subscription_id}}` * * `{{project}}/{{location}}/{{subscription_id}}` * * `{{location}}/{{subscription_id}}` * * When using the `pulumi import` command, ListingSubscription can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:bigqueryanalyticshub/listingSubscription:ListingSubscription default projects/{{project}}/locations/{{location}}/subscriptions/{{subscription_id}} * $ pulumi import gcp:bigqueryanalyticshub/listingSubscription:ListingSubscription default {{project}}/{{location}}/{{subscription_id}} * $ pulumi import gcp:bigqueryanalyticshub/listingSubscription:ListingSubscription default {{location}}/{{subscription_id}} * ``` */ class ListingSubscription extends pulumi.CustomResource { /** * Get an existing ListingSubscription 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 ListingSubscription(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:bigqueryanalyticshub/listingSubscription:ListingSubscription'; /** * Returns true if the given object is an instance of ListingSubscription. 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'] === ListingSubscription.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["commercialInfos"] = state?.commercialInfos; resourceInputs["creationTime"] = state?.creationTime; resourceInputs["dataExchangeId"] = state?.dataExchangeId; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["destinationDataset"] = state?.destinationDataset; resourceInputs["lastModifyTime"] = state?.lastModifyTime; resourceInputs["linkedDatasetMaps"] = state?.linkedDatasetMaps; resourceInputs["linkedResources"] = state?.linkedResources; resourceInputs["listingId"] = state?.listingId; resourceInputs["location"] = state?.location; resourceInputs["logLinkedDatasetQueryUserEmail"] = state?.logLinkedDatasetQueryUserEmail; resourceInputs["name"] = state?.name; resourceInputs["organizationDisplayName"] = state?.organizationDisplayName; resourceInputs["organizationId"] = state?.organizationId; resourceInputs["project"] = state?.project; resourceInputs["resourceType"] = state?.resourceType; resourceInputs["state"] = state?.state; resourceInputs["subscriberContact"] = state?.subscriberContact; resourceInputs["subscriptionId"] = state?.subscriptionId; } else { const args = argsOrState; if (args?.dataExchangeId === undefined && !opts.urn) { throw new Error("Missing required property 'dataExchangeId'"); } if (args?.destinationDataset === undefined && !opts.urn) { throw new Error("Missing required property 'destinationDataset'"); } if (args?.listingId === undefined && !opts.urn) { throw new Error("Missing required property 'listingId'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["dataExchangeId"] = args?.dataExchangeId; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["destinationDataset"] = args?.destinationDataset; resourceInputs["listingId"] = args?.listingId; resourceInputs["location"] = args?.location; resourceInputs["project"] = args?.project; resourceInputs["commercialInfos"] = undefined /*out*/; resourceInputs["creationTime"] = undefined /*out*/; resourceInputs["lastModifyTime"] = undefined /*out*/; resourceInputs["linkedDatasetMaps"] = undefined /*out*/; resourceInputs["linkedResources"] = undefined /*out*/; resourceInputs["logLinkedDatasetQueryUserEmail"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["organizationDisplayName"] = undefined /*out*/; resourceInputs["organizationId"] = undefined /*out*/; resourceInputs["resourceType"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["subscriberContact"] = undefined /*out*/; resourceInputs["subscriptionId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ListingSubscription.__pulumiType, name, resourceInputs, opts); } } exports.ListingSubscription = ListingSubscription; //# sourceMappingURL=listingSubscription.js.map