UNPKG

@pulumi/gcp

Version:

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

666 lines (665 loc) • 26.2 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * A Bigquery Analytics Hub data exchange listing * * To get more information about Listing, see: * * * [API documentation](https://cloud.google.com/bigquery/docs/reference/analytics-hub/rest/v1/projects.locations.dataExchanges.listings) * * How-to Guides * * [Official Documentation](https://cloud.google.com/bigquery/docs/analytics-hub-introduction) * * ## Example Usage * * ### Bigquery Analyticshub Listing Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const listing = new gcp.bigqueryanalyticshub.DataExchange("listing", { * location: "US", * dataExchangeId: "my_data_exchange", * displayName: "my_data_exchange", * description: "example data exchange", * }); * const listingDataset = new gcp.bigquery.Dataset("listing", { * datasetId: "my_listing", * friendlyName: "my_listing", * description: "example data exchange", * location: "US", * }); * const listingListing = new gcp.bigqueryanalyticshub.Listing("listing", { * location: "US", * dataExchangeId: listing.dataExchangeId, * listingId: "my_listing", * displayName: "my_listing", * description: "example data exchange", * bigqueryDataset: { * dataset: listingDataset.id, * }, * }); * ``` * ### Bigquery Analyticshub Listing Restricted * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const listing = new gcp.bigqueryanalyticshub.DataExchange("listing", { * location: "US", * dataExchangeId: "my_data_exchange", * displayName: "my_data_exchange", * description: "example data exchange", * }); * const listingDataset = new gcp.bigquery.Dataset("listing", { * datasetId: "my_listing", * friendlyName: "my_listing", * description: "example data exchange", * location: "US", * }); * const listingListing = new gcp.bigqueryanalyticshub.Listing("listing", { * location: "US", * dataExchangeId: listing.dataExchangeId, * listingId: "my_listing", * displayName: "my_listing", * description: "example data exchange", * bigqueryDataset: { * dataset: listingDataset.id, * }, * restrictedExportConfig: { * enabled: true, * restrictQueryResult: true, * }, * }); * ``` * ### Bigquery Analyticshub Listing Dcr * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const listing = new gcp.bigqueryanalyticshub.DataExchange("listing", { * location: "US", * dataExchangeId: "dcr_data_exchange", * displayName: "dcr_data_exchange", * description: "example dcr data exchange", * sharingEnvironmentConfig: { * dcrExchangeConfig: {}, * }, * }); * const listingDataset = new gcp.bigquery.Dataset("listing", { * datasetId: "dcr_listing", * friendlyName: "dcr_listing", * description: "example dcr data exchange", * location: "US", * }); * const listingTable = new gcp.bigquery.Table("listing", { * deletionProtection: false, * tableId: "dcr_listing", * datasetId: listingDataset.datasetId, * schema: `[ * { * "name": "name", * "type": "STRING", * "mode": "NULLABLE" * }, * { * "name": "post_abbr", * "type": "STRING", * "mode": "NULLABLE" * }, * { * "name": "date", * "type": "DATE", * "mode": "NULLABLE" * } * ] * `, * }); * const listingListing = new gcp.bigqueryanalyticshub.Listing("listing", { * location: "US", * dataExchangeId: listing.dataExchangeId, * listingId: "dcr_listing", * displayName: "dcr_listing", * description: "example dcr data exchange", * bigqueryDataset: { * dataset: listingDataset.id, * selectedResources: [{ * table: listingTable.id, * }], * }, * restrictedExportConfig: { * enabled: true, * }, * }); * ``` * ### Bigquery Analyticshub Listing Log Linked Dataset Query User * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const listingLogEmail = new gcp.bigqueryanalyticshub.DataExchange("listing_log_email", { * location: "US", * dataExchangeId: "tf_test_log_email_de", * displayName: "tf_test_log_email_de", * description: "Example for log email test", * }); * const listingLogEmailDataset = new gcp.bigquery.Dataset("listing_log_email", { * datasetId: "tf_test_log_email_ds", * friendlyName: "tf_test_log_email_ds", * description: "Example for log email test", * location: "US", * }); * const listing = new gcp.bigqueryanalyticshub.Listing("listing", { * location: "US", * dataExchangeId: listingLogEmail.dataExchangeId, * listingId: "tf_test_log_email_listing", * displayName: "tf_test_log_email_listing", * description: "Example for log email test", * logLinkedDatasetQueryUserEmail: true, * bigqueryDataset: { * dataset: listingLogEmailDataset.id, * }, * }); * ``` * ### Bigquery Analyticshub Listing Pubsub * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const listing = new gcp.bigqueryanalyticshub.DataExchange("listing", { * location: "US", * dataExchangeId: "tf_test_pubsub_data_exchange", * displayName: "tf_test_pubsub_data_exchange", * description: "Example for pubsub topic source", * }); * const tfTestPubsubTopic = new gcp.pubsub.Topic("tf_test_pubsub_topic", {name: "test_pubsub"}); * const listingListing = new gcp.bigqueryanalyticshub.Listing("listing", { * location: "US", * dataExchangeId: listing.dataExchangeId, * listingId: "tf_test_pubsub_listing", * displayName: "tf_test_pubsub_listing", * description: "Example for pubsub topic source", * pubsubTopic: { * topic: tfTestPubsubTopic.id, * dataAffinityRegions: [ * "us-central1", * "europe-west1", * ], * }, * }); * ``` * ### Bigquery Analyticshub Listing Dcr Routine * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const dcrDataExchangeExample = new gcp.bigqueryanalyticshub.DataExchange("dcr_data_exchange_example", { * location: "us", * dataExchangeId: "tf_test_data_exchange", * displayName: "tf_test_data_exchange", * description: "Example for listing with routine", * sharingEnvironmentConfig: { * dcrExchangeConfig: {}, * }, * }); * const listing = new gcp.bigquery.Dataset("listing", { * datasetId: "tf_test_dataset", * friendlyName: "tf_test_dataset", * description: "Example for listing with routine", * location: "us", * }); * const listingRoutine = new gcp.bigquery.Routine("listing", { * datasetId: listing.datasetId, * routineId: "tf_test_routine", * routineType: "TABLE_VALUED_FUNCTION", * language: "SQL", * description: "A DCR routine example.", * definitionBody: "SELECT 1 + value AS value\n", * arguments: [{ * name: "value", * argumentKind: "FIXED_TYPE", * dataType: JSON.stringify({ * typeKind: "INT64", * }), * }], * returnTableType: JSON.stringify({ * columns: [{ * name: "value", * type: { * typeKind: "INT64", * }, * }], * }), * }); * const listingListing = new gcp.bigqueryanalyticshub.Listing("listing", { * location: "US", * dataExchangeId: dcrDataExchangeExample.dataExchangeId, * listingId: "tf_test_listing_routine", * displayName: "tf_test_listing_routine", * description: "Example for listing with routine", * bigqueryDataset: { * dataset: listing.id, * selectedResources: [{ * routine: listingRoutine.id, * }], * }, * restrictedExportConfig: { * enabled: true, * }, * }); * ``` * ### Bigquery Analyticshub Public Listing * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const listing = new gcp.bigqueryanalyticshub.DataExchange("listing", { * location: "US", * dataExchangeId: "my_data_exchange", * displayName: "my_data_exchange", * description: "example public listing", * discoveryType: "DISCOVERY_TYPE_PUBLIC", * }); * const listingDataset = new gcp.bigquery.Dataset("listing", { * datasetId: "my_listing", * friendlyName: "my_listing", * description: "example public listing", * location: "US", * }); * const listingListing = new gcp.bigqueryanalyticshub.Listing("listing", { * location: "US", * dataExchangeId: listing.dataExchangeId, * listingId: "my_listing", * displayName: "my_listing", * description: "example public listing", * discoveryType: "DISCOVERY_TYPE_PUBLIC", * allowOnlyMetadataSharing: false, * bigqueryDataset: { * dataset: listingDataset.id, * }, * }); * ``` * ### Bigquery Analyticshub Listing Marketplace * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const listing = new gcp.bigqueryanalyticshub.DataExchange("listing", { * location: "US", * dataExchangeId: "my_data_exchange", * displayName: "my_data_exchange", * description: "example data exchange", * }); * const listingDataset = new gcp.bigquery.Dataset("listing", { * datasetId: "my_listing", * friendlyName: "my_listing", * description: "example data exchange", * location: "US", * }); * const listingListing = new gcp.bigqueryanalyticshub.Listing("listing", { * location: "US", * dataExchangeId: listing.dataExchangeId, * listingId: "my_listing", * displayName: "my_listing", * description: "example data exchange", * deleteCommercial: true, * bigqueryDataset: { * dataset: listingDataset.id, * }, * }); * ``` * * ## Import * * Listing can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/dataExchanges/{{data_exchange_id}}/listings/{{listing_id}}` * * * `{{project}}/{{location}}/{{data_exchange_id}}/{{listing_id}}` * * * `{{location}}/{{data_exchange_id}}/{{listing_id}}` * * When using the `pulumi import` command, Listing can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:bigqueryanalyticshub/listing:Listing default projects/{{project}}/locations/{{location}}/dataExchanges/{{data_exchange_id}}/listings/{{listing_id}} * ``` * * ```sh * $ pulumi import gcp:bigqueryanalyticshub/listing:Listing default {{project}}/{{location}}/{{data_exchange_id}}/{{listing_id}} * ``` * * ```sh * $ pulumi import gcp:bigqueryanalyticshub/listing:Listing default {{location}}/{{data_exchange_id}}/{{listing_id}} * ``` */ export declare class Listing extends pulumi.CustomResource { /** * Get an existing Listing 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: string, id: pulumi.Input<pulumi.ID>, state?: ListingState, opts?: pulumi.CustomResourceOptions): Listing; /** * Returns true if the given object is an instance of Listing. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Listing; /** * If true, the listing is only available to get the resource metadata. Listing is non subscribable. */ readonly allowOnlyMetadataSharing: pulumi.Output<boolean | undefined>; /** * Shared dataset i.e. BigQuery dataset source. * Structure is documented below. */ readonly bigqueryDataset: pulumi.Output<outputs.bigqueryanalyticshub.ListingBigqueryDataset | undefined>; /** * Categories of the listing. Up to two categories are allowed. */ readonly categories: pulumi.Output<string[] | undefined>; /** * Commercial info contains the information about the commercial data products associated with the listing. * Structure is documented below. */ readonly commercialInfos: pulumi.Output<outputs.bigqueryanalyticshub.ListingCommercialInfo[]>; /** * The ID of the data exchange. Must contain only Unicode letters, numbers (0-9), underscores (_). Should not use characters that require URL-escaping, or characters outside of ASCII, spaces. */ readonly dataExchangeId: pulumi.Output<string>; /** * Details of the data provider who owns the source data. * Structure is documented below. */ readonly dataProvider: pulumi.Output<outputs.bigqueryanalyticshub.ListingDataProvider | undefined>; /** * If the listing is commercial then this field must be set to true, otherwise a failure is thrown. This acts as a safety guard to avoid deleting commercial listings accidentally. */ readonly deleteCommercial: pulumi.Output<boolean | undefined>; /** * Short description of the listing. The description must not contain Unicode non-characters and C0 and C1 control codes except tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF). */ readonly description: pulumi.Output<string | undefined>; /** * Specifies the type of discovery on the discovery page. Cannot be set for a restricted listing. Note that this does not control the visibility of the exchange/listing which is defined by IAM permission. * Possible values are: `DISCOVERY_TYPE_PRIVATE`, `DISCOVERY_TYPE_PUBLIC`. */ readonly discoveryType: pulumi.Output<string>; /** * Human-readable display name of the listing. The display name must contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces. */ readonly displayName: pulumi.Output<string>; /** * Documentation describing the listing. */ readonly documentation: pulumi.Output<string | undefined>; /** * Base64 encoded image representing the listing. */ readonly icon: pulumi.Output<string | undefined>; /** * The ID of the listing. Must contain only Unicode letters, numbers (0-9), underscores (_). Should not use characters that require URL-escaping, or characters outside of ASCII, spaces. */ readonly listingId: pulumi.Output<string>; /** * The name of the location this data exchange listing. */ readonly location: pulumi.Output<string>; /** * If true, subscriber email logging is enabled and all queries on the linked dataset will log the email address of the querying user. Once enabled, this setting cannot be turned off. */ readonly logLinkedDatasetQueryUserEmail: pulumi.Output<boolean | undefined>; /** * The resource name of the listing. e.g. "projects/myproject/locations/US/dataExchanges/123/listings/456" */ readonly name: pulumi.Output<string>; /** * Email or URL of the primary point of contact of the listing. */ readonly primaryContact: pulumi.Output<string | undefined>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * Details of the publisher who owns the listing and who can share the source data. * Structure is documented below. */ readonly publisher: pulumi.Output<outputs.bigqueryanalyticshub.ListingPublisher | undefined>; /** * Pub/Sub topic source. * Structure is documented below. */ readonly pubsubTopic: pulumi.Output<outputs.bigqueryanalyticshub.ListingPubsubTopic | undefined>; /** * Email or URL of the request access of the listing. Subscribers can use this reference to request access. */ readonly requestAccess: pulumi.Output<string | undefined>; /** * If set, restricted export configuration will be propagated and enforced on the linked dataset. * Structure is documented below. */ readonly restrictedExportConfig: pulumi.Output<outputs.bigqueryanalyticshub.ListingRestrictedExportConfig | undefined>; /** * Current state of the listing. */ readonly state: pulumi.Output<string>; /** * Create a Listing resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ListingArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Listing resources. */ export interface ListingState { /** * If true, the listing is only available to get the resource metadata. Listing is non subscribable. */ allowOnlyMetadataSharing?: pulumi.Input<boolean>; /** * Shared dataset i.e. BigQuery dataset source. * Structure is documented below. */ bigqueryDataset?: pulumi.Input<inputs.bigqueryanalyticshub.ListingBigqueryDataset>; /** * Categories of the listing. Up to two categories are allowed. */ categories?: pulumi.Input<pulumi.Input<string>[]>; /** * Commercial info contains the information about the commercial data products associated with the listing. * Structure is documented below. */ commercialInfos?: pulumi.Input<pulumi.Input<inputs.bigqueryanalyticshub.ListingCommercialInfo>[]>; /** * The ID of the data exchange. Must contain only Unicode letters, numbers (0-9), underscores (_). Should not use characters that require URL-escaping, or characters outside of ASCII, spaces. */ dataExchangeId?: pulumi.Input<string>; /** * Details of the data provider who owns the source data. * Structure is documented below. */ dataProvider?: pulumi.Input<inputs.bigqueryanalyticshub.ListingDataProvider>; /** * If the listing is commercial then this field must be set to true, otherwise a failure is thrown. This acts as a safety guard to avoid deleting commercial listings accidentally. */ deleteCommercial?: pulumi.Input<boolean>; /** * Short description of the listing. The description must not contain Unicode non-characters and C0 and C1 control codes except tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF). */ description?: pulumi.Input<string>; /** * Specifies the type of discovery on the discovery page. Cannot be set for a restricted listing. Note that this does not control the visibility of the exchange/listing which is defined by IAM permission. * Possible values are: `DISCOVERY_TYPE_PRIVATE`, `DISCOVERY_TYPE_PUBLIC`. */ discoveryType?: pulumi.Input<string>; /** * Human-readable display name of the listing. The display name must contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces. */ displayName?: pulumi.Input<string>; /** * Documentation describing the listing. */ documentation?: pulumi.Input<string>; /** * Base64 encoded image representing the listing. */ icon?: pulumi.Input<string>; /** * The ID of the listing. Must contain only Unicode letters, numbers (0-9), underscores (_). Should not use characters that require URL-escaping, or characters outside of ASCII, spaces. */ listingId?: pulumi.Input<string>; /** * The name of the location this data exchange listing. */ location?: pulumi.Input<string>; /** * If true, subscriber email logging is enabled and all queries on the linked dataset will log the email address of the querying user. Once enabled, this setting cannot be turned off. */ logLinkedDatasetQueryUserEmail?: pulumi.Input<boolean>; /** * The resource name of the listing. e.g. "projects/myproject/locations/US/dataExchanges/123/listings/456" */ name?: pulumi.Input<string>; /** * Email or URL of the primary point of contact of the listing. */ primaryContact?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * Details of the publisher who owns the listing and who can share the source data. * Structure is documented below. */ publisher?: pulumi.Input<inputs.bigqueryanalyticshub.ListingPublisher>; /** * Pub/Sub topic source. * Structure is documented below. */ pubsubTopic?: pulumi.Input<inputs.bigqueryanalyticshub.ListingPubsubTopic>; /** * Email or URL of the request access of the listing. Subscribers can use this reference to request access. */ requestAccess?: pulumi.Input<string>; /** * If set, restricted export configuration will be propagated and enforced on the linked dataset. * Structure is documented below. */ restrictedExportConfig?: pulumi.Input<inputs.bigqueryanalyticshub.ListingRestrictedExportConfig>; /** * Current state of the listing. */ state?: pulumi.Input<string>; } /** * The set of arguments for constructing a Listing resource. */ export interface ListingArgs { /** * If true, the listing is only available to get the resource metadata. Listing is non subscribable. */ allowOnlyMetadataSharing?: pulumi.Input<boolean>; /** * Shared dataset i.e. BigQuery dataset source. * Structure is documented below. */ bigqueryDataset?: pulumi.Input<inputs.bigqueryanalyticshub.ListingBigqueryDataset>; /** * Categories of the listing. Up to two categories are allowed. */ categories?: pulumi.Input<pulumi.Input<string>[]>; /** * The ID of the data exchange. Must contain only Unicode letters, numbers (0-9), underscores (_). Should not use characters that require URL-escaping, or characters outside of ASCII, spaces. */ dataExchangeId: pulumi.Input<string>; /** * Details of the data provider who owns the source data. * Structure is documented below. */ dataProvider?: pulumi.Input<inputs.bigqueryanalyticshub.ListingDataProvider>; /** * If the listing is commercial then this field must be set to true, otherwise a failure is thrown. This acts as a safety guard to avoid deleting commercial listings accidentally. */ deleteCommercial?: pulumi.Input<boolean>; /** * Short description of the listing. The description must not contain Unicode non-characters and C0 and C1 control codes except tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF). */ description?: pulumi.Input<string>; /** * Specifies the type of discovery on the discovery page. Cannot be set for a restricted listing. Note that this does not control the visibility of the exchange/listing which is defined by IAM permission. * Possible values are: `DISCOVERY_TYPE_PRIVATE`, `DISCOVERY_TYPE_PUBLIC`. */ discoveryType?: pulumi.Input<string>; /** * Human-readable display name of the listing. The display name must contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces. */ displayName: pulumi.Input<string>; /** * Documentation describing the listing. */ documentation?: pulumi.Input<string>; /** * Base64 encoded image representing the listing. */ icon?: pulumi.Input<string>; /** * The ID of the listing. Must contain only Unicode letters, numbers (0-9), underscores (_). Should not use characters that require URL-escaping, or characters outside of ASCII, spaces. */ listingId: pulumi.Input<string>; /** * The name of the location this data exchange listing. */ location: pulumi.Input<string>; /** * If true, subscriber email logging is enabled and all queries on the linked dataset will log the email address of the querying user. Once enabled, this setting cannot be turned off. */ logLinkedDatasetQueryUserEmail?: pulumi.Input<boolean>; /** * Email or URL of the primary point of contact of the listing. */ primaryContact?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * Details of the publisher who owns the listing and who can share the source data. * Structure is documented below. */ publisher?: pulumi.Input<inputs.bigqueryanalyticshub.ListingPublisher>; /** * Pub/Sub topic source. * Structure is documented below. */ pubsubTopic?: pulumi.Input<inputs.bigqueryanalyticshub.ListingPubsubTopic>; /** * Email or URL of the request access of the listing. Subscribers can use this reference to request access. */ requestAccess?: pulumi.Input<string>; /** * If set, restricted export configuration will be propagated and enforced on the linked dataset. * Structure is documented below. */ restrictedExportConfig?: pulumi.Input<inputs.bigqueryanalyticshub.ListingRestrictedExportConfig>; }