@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
368 lines (367 loc) • 14.6 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* A Bigquery Analytics Hub Data Exchange subscription
*
* To get more information about DataExchangeSubscription, 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/subscriber's project and location
* in the format projects/{{subscriber_project}}/locations/{{subscriber_location}}/subscriptions/{{subscription_id}}
* ## Example Usage
*
* ### Bigquery Analyticshub Dataexchange 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_test_dataexchange",
* displayName: "my_test_dataexchange",
* description: "Test Data Exchange",
* sharingEnvironmentConfig: {
* dcrExchangeConfig: {},
* },
* });
* const subscriptionDataset = new gcp.bigquery.Dataset("subscription", {
* datasetId: "listing_src_dataset",
* friendlyName: "listing_src_dataset",
* description: "Dataset for Listing",
* location: "us",
* });
* const subscriptionTable = new gcp.bigquery.Table("subscription", {
* deletionProtection: false,
* tableId: "listing_src_table",
* datasetId: subscriptionDataset.datasetId,
* schema: `[
* {
* "name": "name",
* "type": "STRING",
* "mode": "NULLABLE"
* },
* {
* "name": "post_abbr",
* "type": "STRING",
* "mode": "NULLABLE"
* },
* {
* "name": "date",
* "type": "DATE",
* "mode": "NULLABLE"
* }
* ]
* `,
* });
* const subscriptionListing = new gcp.bigqueryanalyticshub.Listing("subscription", {
* location: "us",
* dataExchangeId: subscription.dataExchangeId,
* listingId: "my_test_listing",
* displayName: "my_test_listing",
* description: "Test Listing",
* restrictedExportConfig: {
* enabled: true,
* },
* bigqueryDataset: {
* dataset: subscriptionDataset.id,
* selectedResources: [{
* table: subscriptionTable.id,
* }],
* },
* });
* const subscriptionDataExchangeSubscription = new gcp.bigqueryanalyticshub.DataExchangeSubscription("subscription", {
* project: subscriptionDataset.project,
* location: "us",
* dataExchangeProject: subscription.project,
* dataExchangeLocation: subscription.location,
* dataExchangeId: subscription.dataExchangeId,
* subscriptionId: "my_subscription_id",
* subscriberContact: "testuser@example.com",
* destinationDataset: {
* location: "us",
* datasetReference: {
* projectId: subscriptionDataset.project,
* datasetId: "subscribed_dest_dataset",
* },
* friendlyName: "Subscribed Destination Dataset",
* description: "Destination dataset for subscription",
* labels: {
* environment: "development",
* owner: "team-a",
* },
* },
* refreshPolicy: "ON_READ",
* });
* ```
*
* ## Import
*
* DataExchangeSubscription 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, DataExchangeSubscription can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:bigqueryanalyticshub/dataExchangeSubscription:DataExchangeSubscription default projects/{{project}}/locations/{{location}}/subscriptions/{{subscription_id}}
* ```
*
* ```sh
* $ pulumi import gcp:bigqueryanalyticshub/dataExchangeSubscription:DataExchangeSubscription default {{project}}/{{location}}/{{subscription_id}}
* ```
*
* ```sh
* $ pulumi import gcp:bigqueryanalyticshub/dataExchangeSubscription:DataExchangeSubscription default {{location}}/{{subscription_id}}
* ```
*/
export declare class DataExchangeSubscription extends pulumi.CustomResource {
/**
* Get an existing DataExchangeSubscription 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?: DataExchangeSubscriptionState, opts?: pulumi.CustomResourceOptions): DataExchangeSubscription;
/**
* Returns true if the given object is an instance of DataExchangeSubscription. 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 DataExchangeSubscription;
/**
* Timestamp when the subscription was created.
*/
readonly creationTime: pulumi.Output<string>;
/**
* Output only. Resource name of the source Data Exchange. e.g. projects/123/locations/us/dataExchanges/456
*/
readonly dataExchange: pulumi.Output<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.
*/
readonly dataExchangeId: pulumi.Output<string>;
/**
* The name of the location of the Data Exchange.
*/
readonly dataExchangeLocation: pulumi.Output<string>;
/**
* The ID of the Google Cloud project where the Data Exchange is located.
*/
readonly dataExchangeProject: pulumi.Output<string>;
/**
* BigQuery destination dataset to create for the subscriber.
* Structure is documented below.
*/
readonly destinationDataset: pulumi.Output<outputs.bigqueryanalyticshub.DataExchangeSubscriptionDestinationDataset | undefined>;
/**
* Timestamp when the subscription was last modified.
*/
readonly lastModifyTime: pulumi.Output<string>;
/**
* Output only. Map of listing resource names to associated linked resource,
* e.g. projects/123/locations/us/dataExchanges/456/listings/789 > projects/123/datasets/my_dataset
* For Data Exchange subscriptions, this map may contain multiple entries if the Data Exchange has multiple listings.
* Structure is documented below.
*/
readonly linkedDatasetMaps: pulumi.Output<outputs.bigqueryanalyticshub.DataExchangeSubscriptionLinkedDatasetMap[]>;
/**
* Output only. Linked resources created in the subscription. Only contains values if state = STATE_ACTIVE.
* Structure is documented below.
*/
readonly linkedResources: pulumi.Output<outputs.bigqueryanalyticshub.DataExchangeSubscriptionLinkedResource[]>;
/**
* The geographic location where the Subscription (and its linked dataset) should reside.
* This is the subscriber's desired location for the created resources.
* See https://cloud.google.com/bigquery/docs/locations for supported locations.
*/
readonly location: pulumi.Output<string>;
/**
* Output only. By default, false. If true, the Subscriber agreed to the email sharing mandate that is enabled for DataExchange/Listing.
*/
readonly logLinkedDatasetQueryUserEmail: pulumi.Output<boolean>;
/**
* The resource name of the subscription. e.g. "projects/myproject/locations/us/subscriptions/123"
*/
readonly name: pulumi.Output<string>;
/**
* Display name of the project of this subscription.
*/
readonly organizationDisplayName: pulumi.Output<string>;
/**
* Organization of the project this subscription belongs to.
*/
readonly organizationId: pulumi.Output<string>;
/**
* 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>;
readonly refreshPolicy: pulumi.Output<string | undefined>;
/**
* Listing shared asset type.
*/
readonly resourceType: pulumi.Output<string>;
/**
* Current state of the subscription.
*/
readonly state: pulumi.Output<string>;
/**
* Email of the subscriber.
*/
readonly subscriberContact: pulumi.Output<string | undefined>;
/**
* Name of the subscription to create.
*/
readonly subscriptionId: pulumi.Output<string>;
/**
* Create a DataExchangeSubscription 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: DataExchangeSubscriptionArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering DataExchangeSubscription resources.
*/
export interface DataExchangeSubscriptionState {
/**
* Timestamp when the subscription was created.
*/
creationTime?: pulumi.Input<string>;
/**
* Output only. Resource name of the source Data Exchange. e.g. projects/123/locations/us/dataExchanges/456
*/
dataExchange?: 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>;
/**
* The name of the location of the Data Exchange.
*/
dataExchangeLocation?: pulumi.Input<string>;
/**
* The ID of the Google Cloud project where the Data Exchange is located.
*/
dataExchangeProject?: pulumi.Input<string>;
/**
* BigQuery destination dataset to create for the subscriber.
* Structure is documented below.
*/
destinationDataset?: pulumi.Input<inputs.bigqueryanalyticshub.DataExchangeSubscriptionDestinationDataset>;
/**
* Timestamp when the subscription was last modified.
*/
lastModifyTime?: pulumi.Input<string>;
/**
* Output only. Map of listing resource names to associated linked resource,
* e.g. projects/123/locations/us/dataExchanges/456/listings/789 > projects/123/datasets/my_dataset
* For Data Exchange subscriptions, this map may contain multiple entries if the Data Exchange has multiple listings.
* Structure is documented below.
*/
linkedDatasetMaps?: pulumi.Input<pulumi.Input<inputs.bigqueryanalyticshub.DataExchangeSubscriptionLinkedDatasetMap>[]>;
/**
* Output only. Linked resources created in the subscription. Only contains values if state = STATE_ACTIVE.
* Structure is documented below.
*/
linkedResources?: pulumi.Input<pulumi.Input<inputs.bigqueryanalyticshub.DataExchangeSubscriptionLinkedResource>[]>;
/**
* The geographic location where the Subscription (and its linked dataset) should reside.
* This is the subscriber's desired location for the created resources.
* See https://cloud.google.com/bigquery/docs/locations for supported locations.
*/
location?: pulumi.Input<string>;
/**
* Output only. By default, false. If true, the Subscriber agreed to the email sharing mandate that is enabled for DataExchange/Listing.
*/
logLinkedDatasetQueryUserEmail?: pulumi.Input<boolean>;
/**
* The resource name of the subscription. e.g. "projects/myproject/locations/us/subscriptions/123"
*/
name?: pulumi.Input<string>;
/**
* Display name of the project of this subscription.
*/
organizationDisplayName?: pulumi.Input<string>;
/**
* Organization of the project this subscription belongs to.
*/
organizationId?: 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>;
refreshPolicy?: pulumi.Input<string>;
/**
* Listing shared asset type.
*/
resourceType?: pulumi.Input<string>;
/**
* Current state of the subscription.
*/
state?: pulumi.Input<string>;
/**
* Email of the subscriber.
*/
subscriberContact?: pulumi.Input<string>;
/**
* Name of the subscription to create.
*/
subscriptionId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a DataExchangeSubscription resource.
*/
export interface DataExchangeSubscriptionArgs {
/**
* 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>;
/**
* The name of the location of the Data Exchange.
*/
dataExchangeLocation: pulumi.Input<string>;
/**
* The ID of the Google Cloud project where the Data Exchange is located.
*/
dataExchangeProject: pulumi.Input<string>;
/**
* BigQuery destination dataset to create for the subscriber.
* Structure is documented below.
*/
destinationDataset?: pulumi.Input<inputs.bigqueryanalyticshub.DataExchangeSubscriptionDestinationDataset>;
/**
* The geographic location where the Subscription (and its linked dataset) should reside.
* This is the subscriber's desired location for the created resources.
* See https://cloud.google.com/bigquery/docs/locations for supported locations.
*/
location: 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>;
refreshPolicy?: pulumi.Input<string>;
/**
* Email of the subscriber.
*/
subscriberContact?: pulumi.Input<string>;
/**
* Name of the subscription to create.
*/
subscriptionId: pulumi.Input<string>;
}