UNPKG

@pulumi/gcp

Version:

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

175 lines • 8.28 kB
"use strict"; // *** 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.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: "", * }); * const subscriptionDataset = new gcp.bigquery.Dataset("subscription", { * datasetId: "my_listing", * friendlyName: "my_listing", * description: "", * location: "US", * }); * const subscriptionListing = new gcp.bigqueryanalyticshub.Listing("subscription", { * location: "US", * dataExchangeId: subscription.dataExchangeId, * listingId: "my_listing", * displayName: "my_listing", * 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, Object.assign(Object.assign({}, 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["creationTime"] = state ? state.creationTime : undefined; resourceInputs["dataExchangeId"] = state ? state.dataExchangeId : undefined; resourceInputs["destinationDataset"] = state ? state.destinationDataset : undefined; resourceInputs["lastModifyTime"] = state ? state.lastModifyTime : undefined; resourceInputs["linkedDatasetMaps"] = state ? state.linkedDatasetMaps : undefined; resourceInputs["linkedResources"] = state ? state.linkedResources : undefined; resourceInputs["listingId"] = state ? state.listingId : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["organizationDisplayName"] = state ? state.organizationDisplayName : undefined; resourceInputs["organizationId"] = state ? state.organizationId : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["resourceType"] = state ? state.resourceType : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["subscriberContact"] = state ? state.subscriberContact : undefined; resourceInputs["subscriptionId"] = state ? state.subscriptionId : undefined; } else { const args = argsOrState; if ((!args || args.dataExchangeId === undefined) && !opts.urn) { throw new Error("Missing required property 'dataExchangeId'"); } if ((!args || args.destinationDataset === undefined) && !opts.urn) { throw new Error("Missing required property 'destinationDataset'"); } if ((!args || args.listingId === undefined) && !opts.urn) { throw new Error("Missing required property 'listingId'"); } if ((!args || args.location === undefined) && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["dataExchangeId"] = args ? args.dataExchangeId : undefined; resourceInputs["destinationDataset"] = args ? args.destinationDataset : undefined; resourceInputs["listingId"] = args ? args.listingId : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["creationTime"] = undefined /*out*/; resourceInputs["lastModifyTime"] = undefined /*out*/; resourceInputs["linkedDatasetMaps"] = undefined /*out*/; resourceInputs["linkedResources"] = 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