@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
278 lines (277 loc) • 11.2 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* A resource represents a Dataform workflow configuration
*
* To get more information about RepositoryWorkflowConfig, see:
*
* * [API documentation](https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories.workflowConfigs)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/dataform/docs/workflow-configurations)
*
* ## Example Usage
*
* ### Dataform Repository Workflow Config
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const gitRepository = new gcp.sourcerepo.Repository("git_repository", {name: "my/repository"});
* const secret = new gcp.secretmanager.Secret("secret", {
* secretId: "my_secret",
* replication: {
* auto: {},
* },
* });
* const secretVersion = new gcp.secretmanager.SecretVersion("secret_version", {
* secret: secret.id,
* secretData: "secret-data",
* });
* const repository = new gcp.dataform.Repository("repository", {
* name: "dataform_repository",
* region: "us-central1",
* gitRemoteSettings: {
* url: gitRepository.url,
* defaultBranch: "main",
* authenticationTokenSecretVersion: secretVersion.id,
* },
* workspaceCompilationOverrides: {
* defaultDatabase: "database",
* schemaSuffix: "_suffix",
* tablePrefix: "prefix_",
* },
* });
* const releaseConfig = new gcp.dataform.RepositoryReleaseConfig("release_config", {
* project: repository.project,
* region: repository.region,
* repository: repository.name,
* name: "my_release",
* gitCommitish: "main",
* cronSchedule: "0 7 * * *",
* timeZone: "America/New_York",
* codeCompilationConfig: {
* defaultDatabase: "gcp-example-project",
* defaultSchema: "example-dataset",
* defaultLocation: "us-central1",
* assertionSchema: "example-assertion-dataset",
* databaseSuffix: "",
* schemaSuffix: "",
* tablePrefix: "",
* vars: {
* var1: "value",
* },
* },
* });
* const dataformSa = new gcp.serviceaccount.Account("dataform_sa", {
* accountId: "dataform-sa",
* displayName: "Dataform Service Account",
* });
* const workflow = new gcp.dataform.RepositoryWorkflowConfig("workflow", {
* project: repository.project,
* region: repository.region,
* repository: repository.name,
* name: "my_workflow",
* releaseConfig: releaseConfig.id,
* invocationConfig: {
* includedTargets: [
* {
* database: "gcp-example-project",
* schema: "example-dataset",
* name: "target_1",
* },
* {
* database: "gcp-example-project",
* schema: "example-dataset",
* name: "target_2",
* },
* ],
* includedTags: ["tag_1"],
* transitiveDependenciesIncluded: true,
* transitiveDependentsIncluded: true,
* fullyRefreshIncrementalTablesEnabled: false,
* serviceAccount: dataformSa.email,
* },
* cronSchedule: "0 7 * * *",
* timeZone: "America/New_York",
* });
* ```
*
* ## Import
*
* RepositoryWorkflowConfig can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{region}}/repositories/{{repository}}/workflowConfigs/{{name}}`
*
* * `{{project}}/{{region}}/{{repository}}/{{name}}`
*
* * `{{region}}/{{repository}}/{{name}}`
*
* * `{{repository}}/{{name}}`
*
* When using the `pulumi import` command, RepositoryWorkflowConfig can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:dataform/repositoryWorkflowConfig:RepositoryWorkflowConfig default projects/{{project}}/locations/{{region}}/repositories/{{repository}}/workflowConfigs/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:dataform/repositoryWorkflowConfig:RepositoryWorkflowConfig default {{project}}/{{region}}/{{repository}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:dataform/repositoryWorkflowConfig:RepositoryWorkflowConfig default {{region}}/{{repository}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:dataform/repositoryWorkflowConfig:RepositoryWorkflowConfig default {{repository}}/{{name}}
* ```
*/
export declare class RepositoryWorkflowConfig extends pulumi.CustomResource {
/**
* Get an existing RepositoryWorkflowConfig 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?: RepositoryWorkflowConfigState, opts?: pulumi.CustomResourceOptions): RepositoryWorkflowConfig;
/**
* Returns true if the given object is an instance of RepositoryWorkflowConfig. 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 RepositoryWorkflowConfig;
/**
* Optional. Optional schedule (in cron format) for automatic creation of compilation results.
*/
readonly cronSchedule: pulumi.Output<string | undefined>;
/**
* Optional. If left unset, a default InvocationConfig will be used.
* Structure is documented below.
*/
readonly invocationConfig: pulumi.Output<outputs.dataform.RepositoryWorkflowConfigInvocationConfig | undefined>;
/**
* The workflow's name.
*/
readonly name: 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>;
/**
* Records of the 10 most recent scheduled execution attempts, ordered in in descending order of executionTime. Updated whenever automatic creation of a workflow invocation is triggered by cronSchedule.
* Structure is documented below.
*/
readonly recentScheduledExecutionRecords: pulumi.Output<outputs.dataform.RepositoryWorkflowConfigRecentScheduledExecutionRecord[]>;
/**
* A reference to the region
*/
readonly region: pulumi.Output<string | undefined>;
/**
* The name of the release config whose releaseCompilationResult should be executed. Must be in the format projects/*/locations/*/repositories/*/releaseConfigs/*.
*/
readonly releaseConfig: pulumi.Output<string>;
/**
* A reference to the Dataform repository
*/
readonly repository: pulumi.Output<string | undefined>;
/**
* Optional. Specifies the time zone to be used when interpreting cronSchedule. Must be a time zone name from the time zone database (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). If left unspecified, the default is UTC.
*/
readonly timeZone: pulumi.Output<string | undefined>;
/**
* Create a RepositoryWorkflowConfig 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: RepositoryWorkflowConfigArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering RepositoryWorkflowConfig resources.
*/
export interface RepositoryWorkflowConfigState {
/**
* Optional. Optional schedule (in cron format) for automatic creation of compilation results.
*/
cronSchedule?: pulumi.Input<string>;
/**
* Optional. If left unset, a default InvocationConfig will be used.
* Structure is documented below.
*/
invocationConfig?: pulumi.Input<inputs.dataform.RepositoryWorkflowConfigInvocationConfig>;
/**
* The workflow's name.
*/
name?: 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>;
/**
* Records of the 10 most recent scheduled execution attempts, ordered in in descending order of executionTime. Updated whenever automatic creation of a workflow invocation is triggered by cronSchedule.
* Structure is documented below.
*/
recentScheduledExecutionRecords?: pulumi.Input<pulumi.Input<inputs.dataform.RepositoryWorkflowConfigRecentScheduledExecutionRecord>[]>;
/**
* A reference to the region
*/
region?: pulumi.Input<string>;
/**
* The name of the release config whose releaseCompilationResult should be executed. Must be in the format projects/*/locations/*/repositories/*/releaseConfigs/*.
*/
releaseConfig?: pulumi.Input<string>;
/**
* A reference to the Dataform repository
*/
repository?: pulumi.Input<string>;
/**
* Optional. Specifies the time zone to be used when interpreting cronSchedule. Must be a time zone name from the time zone database (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). If left unspecified, the default is UTC.
*/
timeZone?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a RepositoryWorkflowConfig resource.
*/
export interface RepositoryWorkflowConfigArgs {
/**
* Optional. Optional schedule (in cron format) for automatic creation of compilation results.
*/
cronSchedule?: pulumi.Input<string>;
/**
* Optional. If left unset, a default InvocationConfig will be used.
* Structure is documented below.
*/
invocationConfig?: pulumi.Input<inputs.dataform.RepositoryWorkflowConfigInvocationConfig>;
/**
* The workflow's name.
*/
name?: 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>;
/**
* A reference to the region
*/
region?: pulumi.Input<string>;
/**
* The name of the release config whose releaseCompilationResult should be executed. Must be in the format projects/*/locations/*/repositories/*/releaseConfigs/*.
*/
releaseConfig: pulumi.Input<string>;
/**
* A reference to the Dataform repository
*/
repository?: pulumi.Input<string>;
/**
* Optional. Specifies the time zone to be used when interpreting cronSchedule. Must be a time zone name from the time zone database (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). If left unspecified, the default is UTC.
*/
timeZone?: pulumi.Input<string>;
}