UNPKG

@pulumi/gcp

Version:

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

179 lines • 8.17 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.ListingSubscription = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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, * }, * }, * }); * ``` * * ## 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}} * ``` * * ```sh * $ pulumi import gcp:bigqueryanalyticshub/listingSubscription:ListingSubscription default {{project}}/{{location}}/{{subscription_id}} * ``` * * ```sh * $ 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 }); } /** * 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["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["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; /** @internal */ ListingSubscription.__pulumiType = 'gcp:bigqueryanalyticshub/listingSubscription:ListingSubscription'; //# sourceMappingURL=listingSubscription.js.map