@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
303 lines • 13.2 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Represents a BigQuery Query Template within a Data Exchange.
* This resource defines a reusable SQL routine (e.g., a TVF) that can be
* shared or executed via the Data Exchange.
*
* > **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
* See Provider Versions for more details on beta resources.
*
* To get more information about QueryTemplate, see:
*
* * [API documentation](https://docs.cloud.google.com/bigquery/docs/reference/analytics-hub/rest/v1/projects.locations.dataExchanges.queryTemplates)
* * How-to Guides
* * [Use query templates](https://docs.cloud.google.com/bigquery/docs/query-templates)
*
* ## Example Usage
*
* ### Bigquery Analyticshub Querytemplate Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const me = gcp.organizations.getClientOpenIdUserInfo({});
* const querytemplate = new gcp.bigqueryanalyticshub.DataExchange("querytemplate", {
* displayName: "My Audience Data Exchange",
* dataExchangeId: "my_data_exchange",
* description: "example of query template",
* location: "us",
* sharingEnvironmentConfig: {
* dcrExchangeConfig: {},
* },
* });
* const querytemplateQueryTemplate = new gcp.bigqueryanalyticshub.QueryTemplate("querytemplate", {
* location: "us",
* dataExchangeId: querytemplate.dataExchangeId,
* queryTemplateId: "my_query_template",
* displayName: "my_query_template",
* description: "example of query template",
* primaryContact: me.then(me => me.email),
* documentation: "This TVF takes a table t1 as input and returns all columns. Useful for basic data pass-through.",
* routine: {
* routineType: "TABLE_VALUED_FUNCTION",
* definitionBody: "my_query_template() as (select * from t1)",
* },
* submit: false,
* });
* ```
*
* ## Import
*
* QueryTemplate can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/dataExchanges/{{data_exchange_id}}/queryTemplates/{{query_template_id}}`
* * `{{project}}/{{location}}/{{data_exchange_id}}/{{query_template_id}}`
* * `{{location}}/{{data_exchange_id}}/{{query_template_id}}`
*
* When using the `pulumi import` command, QueryTemplate can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:bigqueryanalyticshub/queryTemplate:QueryTemplate default projects/{{project}}/locations/{{location}}/dataExchanges/{{data_exchange_id}}/queryTemplates/{{query_template_id}}
* $ pulumi import gcp:bigqueryanalyticshub/queryTemplate:QueryTemplate default {{project}}/{{location}}/{{data_exchange_id}}/{{query_template_id}}
* $ pulumi import gcp:bigqueryanalyticshub/queryTemplate:QueryTemplate default {{location}}/{{data_exchange_id}}/{{query_template_id}}
* ```
*/
export declare class QueryTemplate extends pulumi.CustomResource {
/**
* Get an existing QueryTemplate 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?: QueryTemplateState, opts?: pulumi.CustomResourceOptions): QueryTemplate;
/**
* Returns true if the given object is an instance of QueryTemplate. 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 QueryTemplate;
/**
* Timestamp when the QueryTemplate was created.
*/
readonly createTime: 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>;
/**
* Sets the policy for deleting the QueryTemplate. Defaults to `DELETE_IF_DRAFTED`.
* * `ABANDON`: Untracks the resource from Terraform state but leaves it intact in BigQuery.
* * `DELETE`: Deletes the QueryTemplate from BigQuery.
* * `DELETE_IF_DRAFTED`: Deletes the QueryTemplate only if it is in a `DRAFTED` state; otherwise, it abandons it.
* * `PREVENT`: Prevents deletion of the QueryTemplate.
*/
readonly deletionPolicy: pulumi.Output<string>;
/**
* Short description of the QueryTemplate. The description must not contain
* Unicode non-characters and C0 and C1 control codes except tabs,
* new lines, carriage returns, and page breaks.
* Default value is an empty string. Max length: 2000 bytes.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Human-readable display name of the QueryTemplate. The display name must
* contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
* spaces ( ), ampersands (&) and can't start or end with spaces. Default
* value is an empty string.
*/
readonly displayName: pulumi.Output<string>;
/**
* Documentation describing the QueryTemplate.
*/
readonly documentation: pulumi.Output<string | undefined>;
/**
* The name of the location this data exchange query template.
*/
readonly location: pulumi.Output<string>;
/**
* The resource name of the QueryTemplate. e.g. `projects/myproject/locations/us/dataExchanges/123/queryTemplates/456`
*/
readonly name: pulumi.Output<string>;
/**
* Email or URL of the primary point of contact of the QueryTemplate.
*/
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>;
/**
* Unique QueryTemplate ID.
*/
readonly queryTemplateId: pulumi.Output<string>;
/**
* The routine associated with the QueryTemplate.
* Structure is documented below.
*/
readonly routine: pulumi.Output<outputs.bigqueryanalyticshub.QueryTemplateRoutine | undefined>;
/**
* The QueryTemplate lifecycle state.
*/
readonly state: pulumi.Output<string>;
/**
* If set to `true`, the QueryTemplate will be submitted for approval and cannot be updated afterwards. This is a one-time action.
*/
readonly submit: pulumi.Output<boolean | undefined>;
/**
* Timestamp when the QueryTemplate was last modified.
*/
readonly updateTime: pulumi.Output<string>;
/**
* Create a QueryTemplate 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: QueryTemplateArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering QueryTemplate resources.
*/
export interface QueryTemplateState {
/**
* Timestamp when the QueryTemplate was created.
*/
createTime?: pulumi.Input<string | undefined>;
/**
* 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 | undefined>;
/**
* Sets the policy for deleting the QueryTemplate. Defaults to `DELETE_IF_DRAFTED`.
* * `ABANDON`: Untracks the resource from Terraform state but leaves it intact in BigQuery.
* * `DELETE`: Deletes the QueryTemplate from BigQuery.
* * `DELETE_IF_DRAFTED`: Deletes the QueryTemplate only if it is in a `DRAFTED` state; otherwise, it abandons it.
* * `PREVENT`: Prevents deletion of the QueryTemplate.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* Short description of the QueryTemplate. The description must not contain
* Unicode non-characters and C0 and C1 control codes except tabs,
* new lines, carriage returns, and page breaks.
* Default value is an empty string. Max length: 2000 bytes.
*/
description?: pulumi.Input<string | undefined>;
/**
* Human-readable display name of the QueryTemplate. The display name must
* contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
* spaces ( ), ampersands (&) and can't start or end with spaces. Default
* value is an empty string.
*/
displayName?: pulumi.Input<string | undefined>;
/**
* Documentation describing the QueryTemplate.
*/
documentation?: pulumi.Input<string | undefined>;
/**
* The name of the location this data exchange query template.
*/
location?: pulumi.Input<string | undefined>;
/**
* The resource name of the QueryTemplate. e.g. `projects/myproject/locations/us/dataExchanges/123/queryTemplates/456`
*/
name?: pulumi.Input<string | undefined>;
/**
* Email or URL of the primary point of contact of the QueryTemplate.
*/
primaryContact?: pulumi.Input<string | undefined>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string | undefined>;
/**
* Unique QueryTemplate ID.
*/
queryTemplateId?: pulumi.Input<string | undefined>;
/**
* The routine associated with the QueryTemplate.
* Structure is documented below.
*/
routine?: pulumi.Input<inputs.bigqueryanalyticshub.QueryTemplateRoutine | undefined>;
/**
* The QueryTemplate lifecycle state.
*/
state?: pulumi.Input<string | undefined>;
/**
* If set to `true`, the QueryTemplate will be submitted for approval and cannot be updated afterwards. This is a one-time action.
*/
submit?: pulumi.Input<boolean | undefined>;
/**
* Timestamp when the QueryTemplate was last modified.
*/
updateTime?: pulumi.Input<string | undefined>;
}
/**
* The set of arguments for constructing a QueryTemplate resource.
*/
export interface QueryTemplateArgs {
/**
* 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>;
/**
* Sets the policy for deleting the QueryTemplate. Defaults to `DELETE_IF_DRAFTED`.
* * `ABANDON`: Untracks the resource from Terraform state but leaves it intact in BigQuery.
* * `DELETE`: Deletes the QueryTemplate from BigQuery.
* * `DELETE_IF_DRAFTED`: Deletes the QueryTemplate only if it is in a `DRAFTED` state; otherwise, it abandons it.
* * `PREVENT`: Prevents deletion of the QueryTemplate.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* Short description of the QueryTemplate. The description must not contain
* Unicode non-characters and C0 and C1 control codes except tabs,
* new lines, carriage returns, and page breaks.
* Default value is an empty string. Max length: 2000 bytes.
*/
description?: pulumi.Input<string | undefined>;
/**
* Human-readable display name of the QueryTemplate. The display name must
* contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
* spaces ( ), ampersands (&) and can't start or end with spaces. Default
* value is an empty string.
*/
displayName: pulumi.Input<string>;
/**
* Documentation describing the QueryTemplate.
*/
documentation?: pulumi.Input<string | undefined>;
/**
* The name of the location this data exchange query template.
*/
location: pulumi.Input<string>;
/**
* Email or URL of the primary point of contact of the QueryTemplate.
*/
primaryContact?: pulumi.Input<string | undefined>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string | undefined>;
/**
* Unique QueryTemplate ID.
*/
queryTemplateId: pulumi.Input<string>;
/**
* The routine associated with the QueryTemplate.
* Structure is documented below.
*/
routine?: pulumi.Input<inputs.bigqueryanalyticshub.QueryTemplateRoutine | undefined>;
/**
* If set to `true`, the QueryTemplate will be submitted for approval and cannot be updated afterwards. This is a one-time action.
*/
submit?: pulumi.Input<boolean | undefined>;
}
//# sourceMappingURL=queryTemplate.d.ts.map