import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Configuration for an automated build in response to source repository changes. * * To get more information about Trigger, see: * * * [API documentation](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.triggers) * * How-to Guides * * [Automating builds using build triggers](https://cloud.google.com/cloud-build/docs/running-builds/automate-builds) * * > **Note:** You can retrieve the email of the Cloud Build Service Account used in jobs by using the `gcp.projects.ServiceIdentity` resource. * * ## Example Usage * * ### Cloudbuild Trigger Filename * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const filename_trigger = new gcp.cloudbuild.Trigger("filename-trigger", { * location: "us-central1", * triggerTemplate: { * branchName: "main", * repoName: "my-repo", * }, * substitutions: { * _FOO: "bar", * _BAZ: "qux", * }, * filename: "cloudbuild.yaml", * }); * ``` * ### Cloudbuild Trigger Build * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const build_trigger = new gcp.cloudbuild.Trigger("build-trigger", { * name: "my-trigger", * location: "global", * triggerTemplate: { * branchName: "main", * repoName: "my-repo", * }, * build: { * steps: [ * { * name: "gcr.io/cloud-builders/gcloud", * args: [ * "storage", * "cp", * "gs://mybucket/remotefile.zip", * "localfile.zip", * ], * timeout: "120s", * secretEnvs: ["MY_SECRET"], * }, * { * name: "ubuntu", * script: "echo hello", * }, * ], * source: { * storageSource: { * bucket: "mybucket", * object: "source_code.tar.gz", * }, * }, * tags: [ * "build", * "newFeature", * ], * substitutions: { * _FOO: "bar", * _BAZ: "qux", * }, * queueTtl: "20s", * logsBucket: "gs://mybucket/logs", * secrets: [{ * kmsKeyName: "projects/myProject/locations/global/keyRings/keyring-name/cryptoKeys/key-name", * secretEnv: { * PASSWORD: "ZW5jcnlwdGVkLXBhc3N3b3JkCg==", * }, * }], * availableSecrets: { * secretManagers: [{ * env: "MY_SECRET", * versionName: "projects/myProject/secrets/mySecret/versions/latest", * }], * }, * artifacts: { * images: ["gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA"], * objects: { * location: "gs://bucket/path/to/somewhere/", * paths: ["path"], * }, * npmPackages: [{ * packagePath: "package.json", * repository: "https://us-west1-npm.pkg.dev/myProject/quickstart-nodejs-repo", * }], * pythonPackages: [{ * paths: ["dist/*"], * repository: "https://us-west1-python.pkg.dev/myProject/quickstart-python-repo", * }], * mavenArtifacts: [{ * repository: "https://us-west1-maven.pkg.dev/myProject/quickstart-java-repo", * path: "/workspace/my-app/target/my-app-1.0.SNAPSHOT.jar", * artifactId: "my-app", * groupId: "com.mycompany.app", * version: "1.0", * }], * }, * options: { * sourceProvenanceHashes: ["MD5"], * requestedVerifyOption: "VERIFIED", * machineType: "N1_HIGHCPU_8", * diskSizeGb: 100, * substitutionOption: "ALLOW_LOOSE", * dynamicSubstitutions: true, * logStreamingOption: "STREAM_OFF", * workerPool: "pool", * logging: "LEGACY", * envs: ["ekey = evalue"], * secretEnvs: ["secretenv = svalue"], * volumes: [{ * name: "v1", * path: "v1", * }], * }, * }, * }); * ``` * ### Cloudbuild Trigger Service Account * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const cloudbuildServiceAccount = new gcp.serviceaccount.Account("cloudbuild_service_account", {accountId: "cloud-sa"}); * const actAs = new gcp.projects.IAMMember("act_as", { * project: project.then(project => project.projectId), * role: "roles/iam.serviceAccountUser", * member: pulumi.interpolate`serviceAccount:${cloudbuildServiceAccount.email}`, * }); * const logsWriter = new gcp.projects.IAMMember("logs_writer", { * project: project.then(project => project.projectId), * role: "roles/logging.logWriter", * member: pulumi.interpolate`serviceAccount:${cloudbuildServiceAccount.email}`, * }); * const service_account_trigger = new gcp.cloudbuild.Trigger("service-account-trigger", { * triggerTemplate: { * branchName: "main", * repoName: "my-repo", * }, * serviceAccount: cloudbuildServiceAccount.id, * filename: "cloudbuild.yaml", * }, { * dependsOn: [ * actAs, * logsWriter, * ], * }); * ``` * ### Cloudbuild Trigger Include Build Logs * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const include_build_logs_trigger = new gcp.cloudbuild.Trigger("include-build-logs-trigger", { * location: "us-central1", * name: "include-build-logs-trigger", * filename: "cloudbuild.yaml", * github: { * owner: "hashicorp", * name: "terraform-provider-google-beta", * push: { * branch: "^main$", * }, * }, * includeBuildLogs: "INCLUDE_BUILD_LOGS_WITH_STATUS", * }); * ``` * ### Cloudbuild Trigger Pubsub Config * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const mytopic = new gcp.pubsub.Topic("mytopic", {name: "my-topic"}); * const pubsub_config_trigger = new gcp.cloudbuild.Trigger("pubsub-config-trigger", { * location: "us-central1", * name: "pubsub-trigger", * description: "acceptance test example pubsub build trigger", * pubsubConfig: { * topic: mytopic.id, * }, * sourceToBuild: { * uri: "https://hashicorp/terraform-provider-google-beta", * ref: "refs/heads/main", * repoType: "GITHUB", * }, * gitFileSource: { * path: "cloudbuild.yaml", * uri: "https://hashicorp/terraform-provider-google-beta", * revision: "refs/heads/main", * repoType: "GITHUB", * }, * substitutions: { * _ACTION: "$(body.message.data.action)", * }, * filter: "_ACTION.matches('INSERT')", * }); * ``` * ### Cloudbuild Trigger Webhook Config * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const webhookTriggerSecretKey = new gcp.secretmanager.Secret("webhook_trigger_secret_key", { * secretId: "webhook-trigger-secret-key", * replication: { * userManaged: { * replicas: [{ * location: "us-central1", * }], * }, * }, * }); * const webhookTriggerSecretKeyData = new gcp.secretmanager.SecretVersion("webhook_trigger_secret_key_data", { * secret: webhookTriggerSecretKey.id, * secretData: "secretkeygoeshere", * }); * const project = gcp.organizations.getProject({}); * const secretAccessor = project.then(project => gcp.organizations.getIAMPolicy({ * bindings: [{ * role: "roles/secretmanager.secretAccessor", * members: [`serviceAccount:service-${project.number}@gcp-sa-cloudbuild.iam.gserviceaccount.com`], * }], * })); * const policy = new gcp.secretmanager.SecretIamPolicy("policy", { * project: webhookTriggerSecretKey.project, * secretId: webhookTriggerSecretKey.secretId, * policyData: secretAccessor.then(secretAccessor => secretAccessor.policyData), * }); * const webhook_config_trigger = new gcp.cloudbuild.Trigger("webhook-config-trigger", { * name: "webhook-trigger", * description: "acceptance test example webhook build trigger", * webhookConfig: { * secret: webhookTriggerSecretKeyData.id, * }, * sourceToBuild: { * uri: "https://hashicorp/terraform-provider-google-beta", * ref: "refs/heads/main", * repoType: "GITHUB", * }, * gitFileSource: { * path: "cloudbuild.yaml", * uri: "https://hashicorp/terraform-provider-google-beta", * revision: "refs/heads/main", * repoType: "GITHUB", * }, * }); * ``` * ### Cloudbuild Trigger Manual * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const manual_trigger = new gcp.cloudbuild.Trigger("manual-trigger", { * name: "manual-trigger", * build: { * steps: [{ * name: "gcr.io/cloud-builders/gcloud", * args: ["version"], * }], * }, * approvalConfig: { * approvalRequired: true, * }, * }); * ``` * ### Cloudbuild Trigger Manual Github Enterprise * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const manual_ghe_trigger = new gcp.cloudbuild.Trigger("manual-ghe-trigger", { * name: "my-trigger", * sourceToBuild: { * uri: "https://hashicorp/terraform-provider-google-beta", * ref: "refs/heads/main", * repoType: "GITHUB", * githubEnterpriseConfig: "projects/myProject/locations/global/githubEnterpriseConfigs/configID", * }, * gitFileSource: { * path: "cloudbuild.yaml", * uri: "https://hashicorp/terraform-provider-google-beta", * revision: "refs/heads/main", * repoType: "GITHUB", * githubEnterpriseConfig: "projects/myProject/locations/global/githubEnterpriseConfigs/configID", * }, * }); * ``` * ### Cloudbuild Trigger Manual Bitbucket Server * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const manual_bitbucket_trigger = new gcp.cloudbuild.Trigger("manual-bitbucket-trigger", { * name: "terraform-manual-bbs-trigger", * sourceToBuild: { * uri: "https://bbs.com/scm/stag/test-repo.git", * ref: "refs/heads/main", * repoType: "BITBUCKET_SERVER", * bitbucketServerConfig: "projects/myProject/locations/global/bitbucketServerConfigs/configID", * }, * gitFileSource: { * path: "cloudbuild.yaml", * uri: "https://bbs.com/scm/stag/test-repo.git", * revision: "refs/heads/main", * repoType: "BITBUCKET_SERVER", * bitbucketServerConfig: "projects/myProject/locations/global/bitbucketServerConfigs/configID", * }, * }); * ``` * ### Cloudbuild Trigger Repo * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const my_connection = new gcp.cloudbuildv2.Connection("my-connection", { * location: "us-central1", * name: "my-connection", * githubConfig: { * appInstallationId: 123123, * authorizerCredential: { * oauthTokenSecretVersion: "projects/my-project/secrets/github-pat-secret/versions/latest", * }, * }, * }); * const my_repository = new gcp.cloudbuildv2.Repository("my-repository", { * name: "my-repo", * parentConnection: my_connection.id, * remoteUri: "https://github.com/myuser/my-repo.git", * }); * const repo_trigger = new gcp.cloudbuild.Trigger("repo-trigger", { * location: "us-central1", * repositoryEventConfig: { * repository: my_repository.id, * push: { * branch: "feature-.*", * }, * }, * filename: "cloudbuild.yaml", * }); * ``` * ### Cloudbuild Trigger Bitbucket Server Push * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const bbs_push_trigger = new gcp.cloudbuild.Trigger("bbs-push-trigger", { * name: "bbs-push-trigger", * location: "us-central1", * bitbucketServerTriggerConfig: { * repoSlug: "bbs-push-trigger", * projectKey: "STAG", * bitbucketServerConfigResource: "projects/123456789/locations/us-central1/bitbucketServerConfigs/myBitbucketConfig", * push: { * tag: "^0.1.*", * invertRegex: true, * }, * }, * filename: "cloudbuild.yaml", * }); * ``` * ### Cloudbuild Trigger Bitbucket Server Pull Request * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const bbs_pull_request_trigger = new gcp.cloudbuild.Trigger("bbs-pull-request-trigger", { * name: "ghe-trigger", * location: "us-central1", * bitbucketServerTriggerConfig: { * repoSlug: "terraform-provider-google", * projectKey: "STAG", * bitbucketServerConfigResource: "projects/123456789/locations/us-central1/bitbucketServerConfigs/myBitbucketConfig", * pullRequest: { * branch: "^master$", * invertRegex: false, * commentControl: "COMMENTS_ENABLED", * }, * }, * filename: "cloudbuild.yaml", * }); * ``` * ### Cloudbuild Trigger Github Enterprise * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const ghe_trigger = new gcp.cloudbuild.Trigger("ghe-trigger", { * name: "ghe-trigger", * location: "us-central1", * github: { * owner: "hashicorp", * name: "terraform-provider-google", * push: { * branch: "^main$", * }, * enterpriseConfigResourceName: "projects/123456789/locations/us-central1/githubEnterpriseConfigs/configID", * }, * filename: "cloudbuild.yaml", * }); * ``` * ### Cloudbuild Trigger Allow Failure * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const allow_failure_trigger = new gcp.cloudbuild.Trigger("allow-failure-trigger", { * name: "my-trigger", * location: "global", * triggerTemplate: { * branchName: "main", * repoName: "my-repo", * }, * build: { * steps: [{ * name: "ubuntu", * args: [ * "-c", * "exit 1", * ], * allowFailure: true, * }], * source: { * storageSource: { * bucket: "mybucket", * object: "source_code.tar.gz", * }, * }, * tags: [ * "build", * "newFeature", * ], * substitutions: { * _FOO: "bar", * _BAZ: "qux", * }, * queueTtl: "20s", * logsBucket: "gs://mybucket/logs", * secrets: [{ * kmsKeyName: "projects/myProject/locations/global/keyRings/keyring-name/cryptoKeys/key-name", * secretEnv: { * PASSWORD: "ZW5jcnlwdGVkLXBhc3N3b3JkCg==", * }, * }], * availableSecrets: { * secretManagers: [{ * env: "MY_SECRET", * versionName: "projects/myProject/secrets/mySecret/versions/latest", * }], * }, * artifacts: { * images: ["gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA"], * objects: { * location: "gs://bucket/path/to/somewhere/", * paths: ["path"], * }, * }, * options: { * sourceProvenanceHashes: ["MD5"], * requestedVerifyOption: "VERIFIED", * machineType: "N1_HIGHCPU_8", * diskSizeGb: 100, * substitutionOption: "ALLOW_LOOSE", * dynamicSubstitutions: true, * logStreamingOption: "STREAM_OFF", * workerPool: "pool", * logging: "LEGACY", * envs: ["ekey = evalue"], * secretEnvs: ["secretenv = svalue"], * volumes: [{ * name: "v1", * path: "v1", * }], * }, * }, * }); * ``` * ### Cloudbuild Trigger Allow Exit Codes * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const allow_exit_codes_trigger = new gcp.cloudbuild.Trigger("allow-exit-codes-trigger", { * name: "my-trigger", * location: "global", * triggerTemplate: { * branchName: "main", * repoName: "my-repo", * }, * build: { * steps: [{ * name: "ubuntu", * args: [ * "-c", * "exit 1", * ], * allowExitCodes: [ * 1, * 3, * ], * }], * source: { * storageSource: { * bucket: "mybucket", * object: "source_code.tar.gz", * }, * }, * tags: [ * "build", * "newFeature", * ], * substitutions: { * _FOO: "bar", * _BAZ: "qux", * }, * queueTtl: "20s", * logsBucket: "gs://mybucket/logs", * secrets: [{ * kmsKeyName: "projects/myProject/locations/global/keyRings/keyring-name/cryptoKeys/key-name", * secretEnv: { * PASSWORD: "ZW5jcnlwdGVkLXBhc3N3b3JkCg==", * }, * }], * availableSecrets: { * secretManagers: [{ * env: "MY_SECRET", * versionName: "projects/myProject/secrets/mySecret/versions/latest", * }], * }, * artifacts: { * images: ["gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA"], * objects: { * location: "gs://bucket/path/to/somewhere/", * paths: ["path"], * }, * }, * options: { * sourceProvenanceHashes: ["MD5"], * requestedVerifyOption: "VERIFIED", * machineType: "N1_HIGHCPU_8", * diskSizeGb: 100, * substitutionOption: "ALLOW_LOOSE", * dynamicSubstitutions: true, * logStreamingOption: "STREAM_OFF", * workerPool: "pool", * logging: "LEGACY", * envs: ["ekey = evalue"], * secretEnvs: ["secretenv = svalue"], * volumes: [{ * name: "v1", * path: "v1", * }], * }, * }, * }); * ``` * ### Cloudbuild Trigger Pubsub With Repo * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const my_connection = new gcp.cloudbuildv2.Connection("my-connection", { * location: "us-central1", * name: "my-connection", * githubConfig: { * appInstallationId: 123123, * authorizerCredential: { * oauthTokenSecretVersion: "projects/my-project/secrets/github-pat-secret/versions/latest", * }, * }, * }); * const my_repository = new gcp.cloudbuildv2.Repository("my-repository", { * name: "my-repo", * parentConnection: my_connection.id, * remoteUri: "https://github.com/myuser/my-repo.git", * }); * const mytopic = new gcp.pubsub.Topic("mytopic", {name: "my-topic"}); * const pubsub_with_repo_trigger = new gcp.cloudbuild.Trigger("pubsub-with-repo-trigger", { * name: "pubsub-with-repo-trigger", * location: "us-central1", * pubsubConfig: { * topic: mytopic.id, * }, * sourceToBuild: { * repository: my_repository.id, * ref: "refs/heads/main", * repoType: "GITHUB", * }, * gitFileSource: { * path: "cloudbuild.yaml", * repository: my_repository.id, * revision: "refs/heads/main", * repoType: "GITHUB", * }, * }); * ``` * ### Cloudbuild Trigger Developer Connect Pull * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const developer_connect_trigger_pull = new gcp.cloudbuild.Trigger("developer-connect-trigger-pull", { * location: "us-central1", * developerConnectEventConfig: { * gitRepositoryLink: "projects/cryptic-tower-286020/locations/us-central1/connections/prod-bbs-push/gitRepositoryLinks/cbprob-prod-us-central1-push1", * pullRequest: { * branch: "^master$", * invertRegex: false, * commentControl: "COMMENTS_ENABLED", * }, * }, * filename: "cloudbuild.yaml", * }); * ``` * ### Cloudbuild Trigger Developer Connect Push * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const developer_connect_trigger_push = new gcp.cloudbuild.Trigger("developer-connect-trigger-push", { * location: "us-central1", * developerConnectEventConfig: { * gitRepositoryLink: "projects/cryptic-tower-286020/locations/us-central1/connections/prod-bbs-push/gitRepositoryLinks/cbprob-prod-us-central1-push1", * push: { * tag: "^0.1.*", * invertRegex: true, * }, * }, * filename: "cloudbuild.yaml", * }); * ``` * ### Cloudbuild Trigger Developer Connect Push Branch * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const dc_trigger_regular_push_branch = new gcp.cloudbuild.Trigger("dc-trigger-regular-push-branch", { * location: "us-central1", * developerConnectEventConfig: { * gitRepositoryLink: "projects/cryptic-tower-286020/locations/us-central1/connections/prod-bbs-push/gitRepositoryLinks/cbprob-prod-us-central1-push1", * push: { * branch: "main", * }, * }, * filename: "cloudbuild.yaml", * }); * ``` * * ## Import * * Trigger can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/triggers/{{trigger_id}}` * * `projects/{{project}}/triggers/{{trigger_id}}` * * `{{project}}/{{trigger_id}}` * * `{{trigger_id}}` * * When using the `pulumi import` command, Trigger can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:cloudbuild/trigger:Trigger default projects/{{project}}/locations/{{location}}/triggers/{{trigger_id}} * $ pulumi import gcp:cloudbuild/trigger:Trigger default projects/{{project}}/triggers/{{trigger_id}} * $ pulumi import gcp:cloudbuild/trigger:Trigger default {{project}}/{{trigger_id}} * $ pulumi import gcp:cloudbuild/trigger:Trigger default {{trigger_id}} * ``` */ export declare class Trigger extends pulumi.CustomResource { /** * Get an existing Trigger 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, state?: TriggerState, opts?: pulumi.CustomResourceOptions): Trigger; /** * Returns true if the given object is an instance of Trigger. 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 Trigger; /** * Configuration for manual approval to start a build invocation of this BuildTrigger. * Builds created by this trigger will require approval before they execute. * Any user with a Cloud Build Approver role for the project can approve a build. * Structure is documented below. */ readonly approvalConfig: pulumi.Output; /** * BitbucketServerTriggerConfig describes the configuration of a trigger that creates a build whenever a Bitbucket Server event is received. * Structure is documented below. */ readonly bitbucketServerTriggerConfig: pulumi.Output; /** * Contents of the build template. Either a filename or build template must be provided. * Structure is documented below. */ readonly build: pulumi.Output; /** * Time when the trigger was created. */ readonly createTime: pulumi.Output; /** * Human-readable description of the trigger. */ readonly description: pulumi.Output; /** * Configuration for triggers that respond to Developer Connect events. * Structure is documented below. */ readonly developerConnectEventConfig: pulumi.Output; /** * Whether the trigger is disabled or not. If true, the trigger will never result in a build. */ readonly disabled: pulumi.Output; /** * Path, from the source root, to a file whose contents is used for the template. * Either a filename or build template must be provided. Set this only when using triggerTemplate or github. * When using Pub/Sub, Webhook or Manual set the file name using gitFileSource instead. */ readonly filename: pulumi.Output; /** * A Common Expression Language string. Used only with Pub/Sub and Webhook. */ readonly filter: pulumi.Output; /** * The file source describing the local or remote Build template. * Structure is documented below. */ readonly gitFileSource: pulumi.Output; /** * Describes the configuration of a trigger that creates a build whenever a GitHub event is received. * Structure is documented below. */ readonly github: pulumi.Output; /** * ignoredFiles and includedFiles are file glob matches using https://golang.org/pkg/path/filepath/#Match * extended with support for `**`. * If ignoredFiles and changed files are both empty, then they are not * used to determine whether or not to trigger a build. * If ignoredFiles is not empty, then we ignore any files that match any * of the ignoredFile globs. If the change has no files that are outside * of the ignoredFiles globs, then we do not trigger a build. */ readonly ignoredFiles: pulumi.Output; /** * Build logs will be sent back to GitHub as part of the checkrun * result. Values can be INCLUDE_BUILD_LOGS_UNSPECIFIED or * INCLUDE_BUILD_LOGS_WITH_STATUS * Possible values are: `INCLUDE_BUILD_LOGS_UNSPECIFIED`, `INCLUDE_BUILD_LOGS_WITH_STATUS`. */ readonly includeBuildLogs: pulumi.Output; /** * ignoredFiles and includedFiles are file glob matches using https://golang.org/pkg/path/filepath/#Match * extended with support for `**`. * If any of the files altered in the commit pass the ignoredFiles filter * and includedFiles is empty, then as far as this filter is concerned, we * should trigger the build. * If any of the files altered in the commit pass the ignoredFiles filter * and includedFiles is not empty, then we make sure that at least one of * those files matches a includedFiles glob. If not, then we do not trigger * a build. */ readonly includedFiles: pulumi.Output; /** * The [Cloud Build location](https://cloud.google.com/build/docs/locations) for the trigger. * If not specified, "global" is used. */ readonly location: pulumi.Output; /** * Name of the trigger. Must be unique within the project. */ readonly name: pulumi.Output; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * PubsubConfig describes the configuration of a trigger that creates * a build whenever a Pub/Sub message is published. * Structure is documented below. */ readonly pubsubConfig: pulumi.Output; /** * The configuration of a trigger that creates a build whenever an event from Repo API is received. * Structure is documented below. */ readonly repositoryEventConfig: pulumi.Output; /** * The service account used for all user-controlled operations including * triggers.patch, triggers.run, builds.create, and builds.cancel. * If no service account is set, then the standard Cloud Build service account * ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. * Format: projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL} */ readonly serviceAccount: pulumi.Output; /** * The repo and ref of the repository from which to build. * This field is used only for those triggers that do not respond to SCM events. * Triggers that respond to such events build source at whatever commit caused the event. * This field is currently only used by Webhook, Pub/Sub, Manual, and Cron triggers. * Structure is documented below. */ readonly sourceToBuild: pulumi.Output; /** * Substitutions data for Build resource. */ readonly substitutions: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Tags for annotation of a BuildTrigger */ readonly tags: pulumi.Output; /** * The unique identifier for the trigger. */ readonly triggerId: pulumi.Output; /** * Template describing the types of source changes to trigger a build. * Branch and tag names in trigger templates are interpreted as regular * expressions. Any branch or tag change that matches that regular * expression will trigger a build. * Structure is documented below. */ readonly triggerTemplate: pulumi.Output; /** * WebhookConfig describes the configuration of a trigger that creates * a build whenever a webhook is sent to a trigger's webhook URL. * Structure is documented below. */ readonly webhookConfig: pulumi.Output; /** * Create a Trigger 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?: TriggerArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Trigger resources. */ export interface TriggerState { /** * Configuration for manual approval to start a build invocation of this BuildTrigger. * Builds created by this trigger will require approval before they execute. * Any user with a Cloud Build Approver role for the project can approve a build. * Structure is documented below. */ approvalConfig?: pulumi.Input; /** * BitbucketServerTriggerConfig describes the configuration of a trigger that creates a build whenever a Bitbucket Server event is received. * Structure is documented below. */ bitbucketServerTriggerConfig?: pulumi.Input; /** * Contents of the build template. Either a filename or build template must be provided. * Structure is documented below. */ build?: pulumi.Input; /** * Time when the trigger was created. */ createTime?: pulumi.Input; /** * Human-readable description of the trigger. */ description?: pulumi.Input; /** * Configuration for triggers that respond to Developer Connect events. * Structure is documented below. */ developerConnectEventConfig?: pulumi.Input; /** * Whether the trigger is disabled or not. If true, the trigger will never result in a build. */ disabled?: pulumi.Input; /** * Path, from the source root, to a file whose contents is used for the template. * Either a filename or build template must be provided. Set this only when using triggerTemplate or github. * When using Pub/Sub, Webhook or Manual set the file name using gitFileSource instead. */ filename?: pulumi.Input; /** * A Common Expression Language string. Used only with Pub/Sub and Webhook. */ filter?: pulumi.Input; /** * The file source describing the local or remote Build template. * Structure is documented below. */ gitFileSource?: pulumi.Input; /** * Describes the configuration of a trigger that creates a build whenever a GitHub event is received. * Structure is documented below. */ github?: pulumi.Input; /** * ignoredFiles and includedFiles are file glob matches using https://golang.org/pkg/path/filepath/#Match * extended with support for `**`. * If ignoredFiles and changed files are both empty, then they are not * used to determine whether or not to trigger a build. * If ignoredFiles is not empty, then we ignore any files that match any * of the ignoredFile globs. If the change has no files that are outside * of the ignoredFiles globs, then we do not trigger a build. */ ignoredFiles?: pulumi.Input[]>; /** * Build logs will be sent back to GitHub as part of the checkrun * result. Values can be INCLUDE_BUILD_LOGS_UNSPECIFIED or * INCLUDE_BUILD_LOGS_WITH_STATUS * Possible values are: `INCLUDE_BUILD_LOGS_UNSPECIFIED`, `INCLUDE_BUILD_LOGS_WITH_STATUS`. */ includeBuildLogs?: pulumi.Input; /** * ignoredFiles and includedFiles are file glob matches using https://golang.org/pkg/path/filepath/#Match * extended with support for `**`. * If any of the files altered in the commit pass the ignoredFiles filter * and includedFiles is empty, then as far as this filter is concerned, we * should trigger the build. * If any of the files altered in the commit pass the ignoredFiles filter * and includedFiles is not empty, then we make sure that at least one of * those files matches a includedFiles glob. If not, then we do not trigger * a build. */ includedFiles?: pulumi.Input[]>; /** * The [Cloud Build location](https://cloud.google.com/build/docs/locations) for the trigger. * If not specified, "global" is used. */ location?: pulumi.Input; /** * Name of the trigger. Must be unique within the project. */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * PubsubConfig describes the configuration of a trigger that creates * a build whenever a Pub/Sub message is published. * Structure is documented below. */ pubsubConfig?: pulumi.Input; /** * The configuration of a trigger that creates a build whenever an event from Repo API is received. * Structure is documented below. */ repositoryEventConfig?: pulumi.Input; /** * The service account used for all user-controlled operations including * triggers.patch, triggers.run, builds.create, and builds.cancel. * If no service account is set, then the standard Cloud Build service account * ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. * Format: projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL} */ serviceAccount?: pulumi.Input; /** * The repo and ref of the repository from which to build. * This field is used only for those triggers that do not respond to SCM events. * Triggers that respond to such events build source at whatever commit caused the event. * This field is currently only used by Webhook, Pub/Sub, Manual, and Cron triggers. * Structure is documented below. */ sourceToBuild?: pulumi.Input; /** * Substitutions data for Build resource. */ substitutions?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Tags for annotation of a BuildTrigger */ tags?: pulumi.Input[]>; /** * The unique identifier for the trigger. */ triggerId?: pulumi.Input; /** * Template describing the types of source changes to trigger a build. * Branch and tag names in trigger templates are interpreted as regular * expressions. Any branch or tag change that matches that regular * expression will trigger a build. * Structure is documented below. */ triggerTemplate?: pulumi.Input; /** * WebhookConfig describes the configuration of a trigger that creates * a build whenever a webhook is sent to a trigger's webhook URL. * Structure is documented below. */ webhookConfig?: pulumi.Input; } /** * The set of arguments for constructing a Trigger resource. */ export interface TriggerArgs { /** * Configuration for manual approval to start a build invocation of this BuildTrigger. * Builds created by this trigger will require approval before they execute. * Any user with a Cloud Build Approver role for the project can approve a build. * Structure is documented below. */ approvalConfig?: pulumi.Input; /** * BitbucketServerTriggerConfig describes the configuration of a trigger that creates a build whenever a Bitbucket Server event is received. * Structure is documented below. */ bitbucketServerTriggerConfig?: pulumi.Input; /** * Contents of the build template. Either a filename or build template must be provided. * Structure is documented below. */ build?: pulumi.Input; /** * Human-readable description of the trigger. */ description?: pulumi.Input; /** * Configuration for triggers that respond to Developer Connect events. * Structure is documented below. */ developerConnectEventConfig?: pulumi.Input; /** * Whether the trigger is disabled or not. If true, the trigger will never result in a build. */ disabled?: pulumi.Input; /** * Path, from the source root, to a file whose contents is used for the template. * Either a filename or build template must be provided. Set this only when using triggerTemplate or github. * When using Pub/Sub, Webhook or Manual set the file name using gitFileSource instead. */ filename?: pulumi.Input; /** * A Common Expression Language string. Used only with Pub/Sub and Webhook. */ filter?: pulumi.Input; /** * The file source describing the local or remote Build template. * Structure is documented below. */ gitFileSource?: pulumi.Input; /** * Describes the configuration of a trigger that creates a build whenever a GitHub event is received. * Structure is documented below. */ github?: pulumi.Input; /** * ignoredFiles and includedFiles are file glob matches using https://golang.org/pkg/path/filepath/#Match * extended with support for `**`. * If ignoredFiles and changed files are both empty, then they are not * used to determine whether or not to trigger a build. * If ignoredFiles is not empty, then we ignore any files that match any * of the ignoredFile globs. If the change has no files that are outside * of the ignoredFiles globs, then we do not trigger a build. */ ignoredFiles?: pulumi.Input[]>; /** * Build logs will be sent back to GitHub as part of the checkrun * result. Values can be INCLUDE_BUILD_LOGS_UNSPECIFIED or * INCLUDE_BUILD_LOGS_WITH_STATUS * Possible values are: `INCLUDE_BUILD_LOGS_UNSPECIFIED`, `INCLUDE_BUILD_LOGS_WITH_STATUS`. */ includeBuildLogs?: pulumi.Input; /** * ignoredFiles and includedFiles are file glob matches using https://golang.org/pkg/path/filepath/#Match * extended with support for `**`. * If any of the files altered in the commit pass the ignoredFiles filter * and includedFiles is empty, then as far as this filter is concerned, we * should trigger the build. * If any of the files altered in the commit pass the ignoredFiles filter * and includedFiles is not empty, then we make sure that at least one of * those files matches a includedFiles glob. If not, then we do not trigger * a build. */ includedFiles?: pulumi.Input[]>; /** * The [Cloud Build location](https://cloud.google.com/build/docs/locations) for the trigger. * If not specified, "global" is used. */ location?: pulumi.Input; /** * Name of the trigger. Must be unique within the project. */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * PubsubConfig describes the configuration of a trigger that creates * a build whenever a Pub/Sub message is published. * Structure is documented below. */ pubsubConfig?: pulumi.Input; /** * The configuration of a trigger that creates a build whenever an event from Repo API is received. * Structure is documented below. */ repositoryEventConfig?: pulumi.Input; /** * The service account used for all user-controlled operations including * triggers.patch, triggers.run, builds.create, and builds.cancel. * If no service account is set, then the standard Cloud Build service account * ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. * Format: projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL} */ serviceAccount?: pulumi.Input; /** * The repo and ref of the repository from which to build. * This field is used only for those triggers that do not respond to SCM events. * Triggers that respond to such events build source at whatever commit caused the event. * This field is currently only used by Webhook, Pub/Sub, Manual, and Cron triggers. * Structure is documented below. */ sourceToBuild?: pulumi.Input; /** * Substitutions data for Build resource. */ substitutions?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Tags for annotation of a BuildTrigger */ tags?: pulumi.Input[]>; /** * Template describing the types of source changes to trigger a build. * Branch and tag names in trigger templates are interpreted as regular * expressions. Any branch or tag change that matches that regular * expression will trigger a build. * Structure is documented below. */ triggerTemplate?: pulumi.Input; /** * WebhookConfig describes the configuration of a trigger that creates * a build whenever a webhook is sent to a trigger's webhook URL. * Structure is documented below. */ webhookConfig?: pulumi.Input; }