# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *

__all__ = ['TriggerArgs', 'Trigger']

@pulumi.input_type
class TriggerArgs:
    def __init__(__self__, *,
                 approval_config: Optional[pulumi.Input['TriggerApprovalConfigArgs']] = None,
                 build: Optional[pulumi.Input['TriggerBuildArgs']] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 disabled: Optional[pulumi.Input[bool]] = None,
                 filename: Optional[pulumi.Input[str]] = None,
                 filter: Optional[pulumi.Input[str]] = None,
                 git_file_source: Optional[pulumi.Input['TriggerGitFileSourceArgs']] = None,
                 github: Optional[pulumi.Input['TriggerGithubArgs']] = None,
                 ignored_files: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 include_build_logs: Optional[pulumi.Input[str]] = None,
                 included_files: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 location: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 pubsub_config: Optional[pulumi.Input['TriggerPubsubConfigArgs']] = None,
                 service_account: Optional[pulumi.Input[str]] = None,
                 source_to_build: Optional[pulumi.Input['TriggerSourceToBuildArgs']] = None,
                 substitutions: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 trigger_template: Optional[pulumi.Input['TriggerTriggerTemplateArgs']] = None,
                 webhook_config: Optional[pulumi.Input['TriggerWebhookConfigArgs']] = None):
        """
        The set of arguments for constructing a Trigger resource.
        :param pulumi.Input['TriggerApprovalConfigArgs'] approval_config: 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.
        :param pulumi.Input['TriggerBuildArgs'] build: Contents of the build template. Either a filename or build template must be provided.
               Structure is documented below.
        :param pulumi.Input[str] description: Human-readable description of the trigger.
        :param pulumi.Input[bool] disabled: Whether the trigger is disabled or not. If true, the trigger will never result in a build.
        :param pulumi.Input[str] filename: 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 trigger_template or github.
               When using Pub/Sub, Webhook or Manual set the file name using git_file_source instead.
        :param pulumi.Input[str] filter: A Common Expression Language string. Used only with Pub/Sub and Webhook.
        :param pulumi.Input['TriggerGitFileSourceArgs'] git_file_source: The file source describing the local or remote Build template.
               Structure is documented below.
        :param pulumi.Input['TriggerGithubArgs'] github: Describes the configuration of a trigger that creates a build whenever a GitHub event is received.
               One of `trigger_template`, `github`, `pubsub_config` or `webhook_config` must be provided.
               Structure is documented below.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] ignored_files: 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 ignored_file globs. If the change has no files that are outside
               of the ignoredFiles globs, then we do not trigger a build.
        :param pulumi.Input[str] include_build_logs: 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` and `INCLUDE_BUILD_LOGS_WITH_STATUS`.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] included_files: 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.
        :param pulumi.Input[str] location: Cloud Storage bucket and optional object path, in the form "gs://bucket/path/to/somewhere/".
               Files in the workspace matching any path pattern will be uploaded to Cloud Storage with
               this location as a prefix.
        :param pulumi.Input[str] name: Name of the volume to mount.
               Volume names must be unique per build step and must be valid names for Docker volumes.
               Each named volume must be used by at least two build steps.
        :param pulumi.Input[str] project: The ID of the project in which the resource belongs.
               If it is not provided, the provider project is used.
        :param pulumi.Input['TriggerPubsubConfigArgs'] pubsub_config: PubsubConfig describes the configuration of a trigger that creates
               a build whenever a Pub/Sub message is published.
               One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        :param pulumi.Input[str] service_account: 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}
        :param pulumi.Input['TriggerSourceToBuildArgs'] source_to_build: 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.
               One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] substitutions: Substitutions to use in a triggered build. Should only be used with triggers.run
        :param pulumi.Input[Sequence[pulumi.Input[str]]] tags: Tags for annotation of a Build. These are not docker tags.
        :param pulumi.Input['TriggerTriggerTemplateArgs'] trigger_template: 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.
               One of `trigger_template`, `github`, `pubsub_config`, `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        :param pulumi.Input['TriggerWebhookConfigArgs'] webhook_config: WebhookConfig describes the configuration of a trigger that creates
               a build whenever a webhook is sent to a trigger's webhook URL.
               One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        """
        if approval_config is not None:
            pulumi.set(__self__, "approval_config", approval_config)
        if build is not None:
            pulumi.set(__self__, "build", build)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if disabled is not None:
            pulumi.set(__self__, "disabled", disabled)
        if filename is not None:
            pulumi.set(__self__, "filename", filename)
        if filter is not None:
            pulumi.set(__self__, "filter", filter)
        if git_file_source is not None:
            pulumi.set(__self__, "git_file_source", git_file_source)
        if github is not None:
            pulumi.set(__self__, "github", github)
        if ignored_files is not None:
            pulumi.set(__self__, "ignored_files", ignored_files)
        if include_build_logs is not None:
            pulumi.set(__self__, "include_build_logs", include_build_logs)
        if included_files is not None:
            pulumi.set(__self__, "included_files", included_files)
        if location is not None:
            pulumi.set(__self__, "location", location)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if project is not None:
            pulumi.set(__self__, "project", project)
        if pubsub_config is not None:
            pulumi.set(__self__, "pubsub_config", pubsub_config)
        if service_account is not None:
            pulumi.set(__self__, "service_account", service_account)
        if source_to_build is not None:
            pulumi.set(__self__, "source_to_build", source_to_build)
        if substitutions is not None:
            pulumi.set(__self__, "substitutions", substitutions)
        if tags is not None:
            pulumi.set(__self__, "tags", tags)
        if trigger_template is not None:
            pulumi.set(__self__, "trigger_template", trigger_template)
        if webhook_config is not None:
            pulumi.set(__self__, "webhook_config", webhook_config)

    @property
    @pulumi.getter(name="approvalConfig")
    def approval_config(self) -> Optional[pulumi.Input['TriggerApprovalConfigArgs']]:
        """
        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.
        """
        return pulumi.get(self, "approval_config")

    @approval_config.setter
    def approval_config(self, value: Optional[pulumi.Input['TriggerApprovalConfigArgs']]):
        pulumi.set(self, "approval_config", value)

    @property
    @pulumi.getter
    def build(self) -> Optional[pulumi.Input['TriggerBuildArgs']]:
        """
        Contents of the build template. Either a filename or build template must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "build")

    @build.setter
    def build(self, value: Optional[pulumi.Input['TriggerBuildArgs']]):
        pulumi.set(self, "build", value)

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[str]]:
        """
        Human-readable description of the trigger.
        """
        return pulumi.get(self, "description")

    @description.setter
    def description(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "description", value)

    @property
    @pulumi.getter
    def disabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether the trigger is disabled or not. If true, the trigger will never result in a build.
        """
        return pulumi.get(self, "disabled")

    @disabled.setter
    def disabled(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "disabled", value)

    @property
    @pulumi.getter
    def filename(self) -> Optional[pulumi.Input[str]]:
        """
        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 trigger_template or github.
        When using Pub/Sub, Webhook or Manual set the file name using git_file_source instead.
        """
        return pulumi.get(self, "filename")

    @filename.setter
    def filename(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "filename", value)

    @property
    @pulumi.getter
    def filter(self) -> Optional[pulumi.Input[str]]:
        """
        A Common Expression Language string. Used only with Pub/Sub and Webhook.
        """
        return pulumi.get(self, "filter")

    @filter.setter
    def filter(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "filter", value)

    @property
    @pulumi.getter(name="gitFileSource")
    def git_file_source(self) -> Optional[pulumi.Input['TriggerGitFileSourceArgs']]:
        """
        The file source describing the local or remote Build template.
        Structure is documented below.
        """
        return pulumi.get(self, "git_file_source")

    @git_file_source.setter
    def git_file_source(self, value: Optional[pulumi.Input['TriggerGitFileSourceArgs']]):
        pulumi.set(self, "git_file_source", value)

    @property
    @pulumi.getter
    def github(self) -> Optional[pulumi.Input['TriggerGithubArgs']]:
        """
        Describes the configuration of a trigger that creates a build whenever a GitHub event is received.
        One of `trigger_template`, `github`, `pubsub_config` or `webhook_config` must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "github")

    @github.setter
    def github(self, value: Optional[pulumi.Input['TriggerGithubArgs']]):
        pulumi.set(self, "github", value)

    @property
    @pulumi.getter(name="ignoredFiles")
    def ignored_files(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        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 ignored_file globs. If the change has no files that are outside
        of the ignoredFiles globs, then we do not trigger a build.
        """
        return pulumi.get(self, "ignored_files")

    @ignored_files.setter
    def ignored_files(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
        pulumi.set(self, "ignored_files", value)

    @property
    @pulumi.getter(name="includeBuildLogs")
    def include_build_logs(self) -> Optional[pulumi.Input[str]]:
        """
        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` and `INCLUDE_BUILD_LOGS_WITH_STATUS`.
        """
        return pulumi.get(self, "include_build_logs")

    @include_build_logs.setter
    def include_build_logs(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "include_build_logs", value)

    @property
    @pulumi.getter(name="includedFiles")
    def included_files(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        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.
        """
        return pulumi.get(self, "included_files")

    @included_files.setter
    def included_files(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
        pulumi.set(self, "included_files", value)

    @property
    @pulumi.getter
    def location(self) -> Optional[pulumi.Input[str]]:
        """
        Cloud Storage bucket and optional object path, in the form "gs://bucket/path/to/somewhere/".
        Files in the workspace matching any path pattern will be uploaded to Cloud Storage with
        this location as a prefix.
        """
        return pulumi.get(self, "location")

    @location.setter
    def location(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "location", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        Name of the volume to mount.
        Volume names must be unique per build step and must be valid names for Docker volumes.
        Each named volume must be used by at least two build steps.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter
    def project(self) -> Optional[pulumi.Input[str]]:
        """
        The ID of the project in which the resource belongs.
        If it is not provided, the provider project is used.
        """
        return pulumi.get(self, "project")

    @project.setter
    def project(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "project", value)

    @property
    @pulumi.getter(name="pubsubConfig")
    def pubsub_config(self) -> Optional[pulumi.Input['TriggerPubsubConfigArgs']]:
        """
        PubsubConfig describes the configuration of a trigger that creates
        a build whenever a Pub/Sub message is published.
        One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "pubsub_config")

    @pubsub_config.setter
    def pubsub_config(self, value: Optional[pulumi.Input['TriggerPubsubConfigArgs']]):
        pulumi.set(self, "pubsub_config", value)

    @property
    @pulumi.getter(name="serviceAccount")
    def service_account(self) -> Optional[pulumi.Input[str]]:
        """
        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}
        """
        return pulumi.get(self, "service_account")

    @service_account.setter
    def service_account(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "service_account", value)

    @property
    @pulumi.getter(name="sourceToBuild")
    def source_to_build(self) -> Optional[pulumi.Input['TriggerSourceToBuildArgs']]:
        """
        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.
        One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "source_to_build")

    @source_to_build.setter
    def source_to_build(self, value: Optional[pulumi.Input['TriggerSourceToBuildArgs']]):
        pulumi.set(self, "source_to_build", value)

    @property
    @pulumi.getter
    def substitutions(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
        """
        Substitutions to use in a triggered build. Should only be used with triggers.run
        """
        return pulumi.get(self, "substitutions")

    @substitutions.setter
    def substitutions(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
        pulumi.set(self, "substitutions", value)

    @property
    @pulumi.getter
    def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        Tags for annotation of a Build. These are not docker tags.
        """
        return pulumi.get(self, "tags")

    @tags.setter
    def tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
        pulumi.set(self, "tags", value)

    @property
    @pulumi.getter(name="triggerTemplate")
    def trigger_template(self) -> Optional[pulumi.Input['TriggerTriggerTemplateArgs']]:
        """
        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.
        One of `trigger_template`, `github`, `pubsub_config`, `webhook_config` or `source_to_build` must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "trigger_template")

    @trigger_template.setter
    def trigger_template(self, value: Optional[pulumi.Input['TriggerTriggerTemplateArgs']]):
        pulumi.set(self, "trigger_template", value)

    @property
    @pulumi.getter(name="webhookConfig")
    def webhook_config(self) -> Optional[pulumi.Input['TriggerWebhookConfigArgs']]:
        """
        WebhookConfig describes the configuration of a trigger that creates
        a build whenever a webhook is sent to a trigger's webhook URL.
        One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "webhook_config")

    @webhook_config.setter
    def webhook_config(self, value: Optional[pulumi.Input['TriggerWebhookConfigArgs']]):
        pulumi.set(self, "webhook_config", value)


@pulumi.input_type
class _TriggerState:
    def __init__(__self__, *,
                 approval_config: Optional[pulumi.Input['TriggerApprovalConfigArgs']] = None,
                 build: Optional[pulumi.Input['TriggerBuildArgs']] = None,
                 create_time: Optional[pulumi.Input[str]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 disabled: Optional[pulumi.Input[bool]] = None,
                 filename: Optional[pulumi.Input[str]] = None,
                 filter: Optional[pulumi.Input[str]] = None,
                 git_file_source: Optional[pulumi.Input['TriggerGitFileSourceArgs']] = None,
                 github: Optional[pulumi.Input['TriggerGithubArgs']] = None,
                 ignored_files: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 include_build_logs: Optional[pulumi.Input[str]] = None,
                 included_files: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 location: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 pubsub_config: Optional[pulumi.Input['TriggerPubsubConfigArgs']] = None,
                 service_account: Optional[pulumi.Input[str]] = None,
                 source_to_build: Optional[pulumi.Input['TriggerSourceToBuildArgs']] = None,
                 substitutions: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 trigger_id: Optional[pulumi.Input[str]] = None,
                 trigger_template: Optional[pulumi.Input['TriggerTriggerTemplateArgs']] = None,
                 webhook_config: Optional[pulumi.Input['TriggerWebhookConfigArgs']] = None):
        """
        Input properties used for looking up and filtering Trigger resources.
        :param pulumi.Input['TriggerApprovalConfigArgs'] approval_config: 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.
        :param pulumi.Input['TriggerBuildArgs'] build: Contents of the build template. Either a filename or build template must be provided.
               Structure is documented below.
        :param pulumi.Input[str] create_time: Time when the trigger was created.
        :param pulumi.Input[str] description: Human-readable description of the trigger.
        :param pulumi.Input[bool] disabled: Whether the trigger is disabled or not. If true, the trigger will never result in a build.
        :param pulumi.Input[str] filename: 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 trigger_template or github.
               When using Pub/Sub, Webhook or Manual set the file name using git_file_source instead.
        :param pulumi.Input[str] filter: A Common Expression Language string. Used only with Pub/Sub and Webhook.
        :param pulumi.Input['TriggerGitFileSourceArgs'] git_file_source: The file source describing the local or remote Build template.
               Structure is documented below.
        :param pulumi.Input['TriggerGithubArgs'] github: Describes the configuration of a trigger that creates a build whenever a GitHub event is received.
               One of `trigger_template`, `github`, `pubsub_config` or `webhook_config` must be provided.
               Structure is documented below.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] ignored_files: 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 ignored_file globs. If the change has no files that are outside
               of the ignoredFiles globs, then we do not trigger a build.
        :param pulumi.Input[str] include_build_logs: 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` and `INCLUDE_BUILD_LOGS_WITH_STATUS`.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] included_files: 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.
        :param pulumi.Input[str] location: Cloud Storage bucket and optional object path, in the form "gs://bucket/path/to/somewhere/".
               Files in the workspace matching any path pattern will be uploaded to Cloud Storage with
               this location as a prefix.
        :param pulumi.Input[str] name: Name of the volume to mount.
               Volume names must be unique per build step and must be valid names for Docker volumes.
               Each named volume must be used by at least two build steps.
        :param pulumi.Input[str] project: The ID of the project in which the resource belongs.
               If it is not provided, the provider project is used.
        :param pulumi.Input['TriggerPubsubConfigArgs'] pubsub_config: PubsubConfig describes the configuration of a trigger that creates
               a build whenever a Pub/Sub message is published.
               One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        :param pulumi.Input[str] service_account: 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}
        :param pulumi.Input['TriggerSourceToBuildArgs'] source_to_build: 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.
               One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] substitutions: Substitutions to use in a triggered build. Should only be used with triggers.run
        :param pulumi.Input[Sequence[pulumi.Input[str]]] tags: Tags for annotation of a Build. These are not docker tags.
        :param pulumi.Input[str] trigger_id: The unique identifier for the trigger.
        :param pulumi.Input['TriggerTriggerTemplateArgs'] trigger_template: 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.
               One of `trigger_template`, `github`, `pubsub_config`, `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        :param pulumi.Input['TriggerWebhookConfigArgs'] webhook_config: WebhookConfig describes the configuration of a trigger that creates
               a build whenever a webhook is sent to a trigger's webhook URL.
               One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        """
        if approval_config is not None:
            pulumi.set(__self__, "approval_config", approval_config)
        if build is not None:
            pulumi.set(__self__, "build", build)
        if create_time is not None:
            pulumi.set(__self__, "create_time", create_time)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if disabled is not None:
            pulumi.set(__self__, "disabled", disabled)
        if filename is not None:
            pulumi.set(__self__, "filename", filename)
        if filter is not None:
            pulumi.set(__self__, "filter", filter)
        if git_file_source is not None:
            pulumi.set(__self__, "git_file_source", git_file_source)
        if github is not None:
            pulumi.set(__self__, "github", github)
        if ignored_files is not None:
            pulumi.set(__self__, "ignored_files", ignored_files)
        if include_build_logs is not None:
            pulumi.set(__self__, "include_build_logs", include_build_logs)
        if included_files is not None:
            pulumi.set(__self__, "included_files", included_files)
        if location is not None:
            pulumi.set(__self__, "location", location)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if project is not None:
            pulumi.set(__self__, "project", project)
        if pubsub_config is not None:
            pulumi.set(__self__, "pubsub_config", pubsub_config)
        if service_account is not None:
            pulumi.set(__self__, "service_account", service_account)
        if source_to_build is not None:
            pulumi.set(__self__, "source_to_build", source_to_build)
        if substitutions is not None:
            pulumi.set(__self__, "substitutions", substitutions)
        if tags is not None:
            pulumi.set(__self__, "tags", tags)
        if trigger_id is not None:
            pulumi.set(__self__, "trigger_id", trigger_id)
        if trigger_template is not None:
            pulumi.set(__self__, "trigger_template", trigger_template)
        if webhook_config is not None:
            pulumi.set(__self__, "webhook_config", webhook_config)

    @property
    @pulumi.getter(name="approvalConfig")
    def approval_config(self) -> Optional[pulumi.Input['TriggerApprovalConfigArgs']]:
        """
        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.
        """
        return pulumi.get(self, "approval_config")

    @approval_config.setter
    def approval_config(self, value: Optional[pulumi.Input['TriggerApprovalConfigArgs']]):
        pulumi.set(self, "approval_config", value)

    @property
    @pulumi.getter
    def build(self) -> Optional[pulumi.Input['TriggerBuildArgs']]:
        """
        Contents of the build template. Either a filename or build template must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "build")

    @build.setter
    def build(self, value: Optional[pulumi.Input['TriggerBuildArgs']]):
        pulumi.set(self, "build", value)

    @property
    @pulumi.getter(name="createTime")
    def create_time(self) -> Optional[pulumi.Input[str]]:
        """
        Time when the trigger was created.
        """
        return pulumi.get(self, "create_time")

    @create_time.setter
    def create_time(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "create_time", value)

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[str]]:
        """
        Human-readable description of the trigger.
        """
        return pulumi.get(self, "description")

    @description.setter
    def description(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "description", value)

    @property
    @pulumi.getter
    def disabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether the trigger is disabled or not. If true, the trigger will never result in a build.
        """
        return pulumi.get(self, "disabled")

    @disabled.setter
    def disabled(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "disabled", value)

    @property
    @pulumi.getter
    def filename(self) -> Optional[pulumi.Input[str]]:
        """
        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 trigger_template or github.
        When using Pub/Sub, Webhook or Manual set the file name using git_file_source instead.
        """
        return pulumi.get(self, "filename")

    @filename.setter
    def filename(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "filename", value)

    @property
    @pulumi.getter
    def filter(self) -> Optional[pulumi.Input[str]]:
        """
        A Common Expression Language string. Used only with Pub/Sub and Webhook.
        """
        return pulumi.get(self, "filter")

    @filter.setter
    def filter(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "filter", value)

    @property
    @pulumi.getter(name="gitFileSource")
    def git_file_source(self) -> Optional[pulumi.Input['TriggerGitFileSourceArgs']]:
        """
        The file source describing the local or remote Build template.
        Structure is documented below.
        """
        return pulumi.get(self, "git_file_source")

    @git_file_source.setter
    def git_file_source(self, value: Optional[pulumi.Input['TriggerGitFileSourceArgs']]):
        pulumi.set(self, "git_file_source", value)

    @property
    @pulumi.getter
    def github(self) -> Optional[pulumi.Input['TriggerGithubArgs']]:
        """
        Describes the configuration of a trigger that creates a build whenever a GitHub event is received.
        One of `trigger_template`, `github`, `pubsub_config` or `webhook_config` must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "github")

    @github.setter
    def github(self, value: Optional[pulumi.Input['TriggerGithubArgs']]):
        pulumi.set(self, "github", value)

    @property
    @pulumi.getter(name="ignoredFiles")
    def ignored_files(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        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 ignored_file globs. If the change has no files that are outside
        of the ignoredFiles globs, then we do not trigger a build.
        """
        return pulumi.get(self, "ignored_files")

    @ignored_files.setter
    def ignored_files(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
        pulumi.set(self, "ignored_files", value)

    @property
    @pulumi.getter(name="includeBuildLogs")
    def include_build_logs(self) -> Optional[pulumi.Input[str]]:
        """
        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` and `INCLUDE_BUILD_LOGS_WITH_STATUS`.
        """
        return pulumi.get(self, "include_build_logs")

    @include_build_logs.setter
    def include_build_logs(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "include_build_logs", value)

    @property
    @pulumi.getter(name="includedFiles")
    def included_files(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        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.
        """
        return pulumi.get(self, "included_files")

    @included_files.setter
    def included_files(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
        pulumi.set(self, "included_files", value)

    @property
    @pulumi.getter
    def location(self) -> Optional[pulumi.Input[str]]:
        """
        Cloud Storage bucket and optional object path, in the form "gs://bucket/path/to/somewhere/".
        Files in the workspace matching any path pattern will be uploaded to Cloud Storage with
        this location as a prefix.
        """
        return pulumi.get(self, "location")

    @location.setter
    def location(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "location", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        Name of the volume to mount.
        Volume names must be unique per build step and must be valid names for Docker volumes.
        Each named volume must be used by at least two build steps.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter
    def project(self) -> Optional[pulumi.Input[str]]:
        """
        The ID of the project in which the resource belongs.
        If it is not provided, the provider project is used.
        """
        return pulumi.get(self, "project")

    @project.setter
    def project(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "project", value)

    @property
    @pulumi.getter(name="pubsubConfig")
    def pubsub_config(self) -> Optional[pulumi.Input['TriggerPubsubConfigArgs']]:
        """
        PubsubConfig describes the configuration of a trigger that creates
        a build whenever a Pub/Sub message is published.
        One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "pubsub_config")

    @pubsub_config.setter
    def pubsub_config(self, value: Optional[pulumi.Input['TriggerPubsubConfigArgs']]):
        pulumi.set(self, "pubsub_config", value)

    @property
    @pulumi.getter(name="serviceAccount")
    def service_account(self) -> Optional[pulumi.Input[str]]:
        """
        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}
        """
        return pulumi.get(self, "service_account")

    @service_account.setter
    def service_account(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "service_account", value)

    @property
    @pulumi.getter(name="sourceToBuild")
    def source_to_build(self) -> Optional[pulumi.Input['TriggerSourceToBuildArgs']]:
        """
        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.
        One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "source_to_build")

    @source_to_build.setter
    def source_to_build(self, value: Optional[pulumi.Input['TriggerSourceToBuildArgs']]):
        pulumi.set(self, "source_to_build", value)

    @property
    @pulumi.getter
    def substitutions(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
        """
        Substitutions to use in a triggered build. Should only be used with triggers.run
        """
        return pulumi.get(self, "substitutions")

    @substitutions.setter
    def substitutions(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
        pulumi.set(self, "substitutions", value)

    @property
    @pulumi.getter
    def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        Tags for annotation of a Build. These are not docker tags.
        """
        return pulumi.get(self, "tags")

    @tags.setter
    def tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
        pulumi.set(self, "tags", value)

    @property
    @pulumi.getter(name="triggerId")
    def trigger_id(self) -> Optional[pulumi.Input[str]]:
        """
        The unique identifier for the trigger.
        """
        return pulumi.get(self, "trigger_id")

    @trigger_id.setter
    def trigger_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "trigger_id", value)

    @property
    @pulumi.getter(name="triggerTemplate")
    def trigger_template(self) -> Optional[pulumi.Input['TriggerTriggerTemplateArgs']]:
        """
        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.
        One of `trigger_template`, `github`, `pubsub_config`, `webhook_config` or `source_to_build` must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "trigger_template")

    @trigger_template.setter
    def trigger_template(self, value: Optional[pulumi.Input['TriggerTriggerTemplateArgs']]):
        pulumi.set(self, "trigger_template", value)

    @property
    @pulumi.getter(name="webhookConfig")
    def webhook_config(self) -> Optional[pulumi.Input['TriggerWebhookConfigArgs']]:
        """
        WebhookConfig describes the configuration of a trigger that creates
        a build whenever a webhook is sent to a trigger's webhook URL.
        One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "webhook_config")

    @webhook_config.setter
    def webhook_config(self, value: Optional[pulumi.Input['TriggerWebhookConfigArgs']]):
        pulumi.set(self, "webhook_config", value)


class Trigger(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 approval_config: Optional[pulumi.Input[pulumi.InputType['TriggerApprovalConfigArgs']]] = None,
                 build: Optional[pulumi.Input[pulumi.InputType['TriggerBuildArgs']]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 disabled: Optional[pulumi.Input[bool]] = None,
                 filename: Optional[pulumi.Input[str]] = None,
                 filter: Optional[pulumi.Input[str]] = None,
                 git_file_source: Optional[pulumi.Input[pulumi.InputType['TriggerGitFileSourceArgs']]] = None,
                 github: Optional[pulumi.Input[pulumi.InputType['TriggerGithubArgs']]] = None,
                 ignored_files: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 include_build_logs: Optional[pulumi.Input[str]] = None,
                 included_files: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 location: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 pubsub_config: Optional[pulumi.Input[pulumi.InputType['TriggerPubsubConfigArgs']]] = None,
                 service_account: Optional[pulumi.Input[str]] = None,
                 source_to_build: Optional[pulumi.Input[pulumi.InputType['TriggerSourceToBuildArgs']]] = None,
                 substitutions: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 trigger_template: Optional[pulumi.Input[pulumi.InputType['TriggerTriggerTemplateArgs']]] = None,
                 webhook_config: Optional[pulumi.Input[pulumi.InputType['TriggerWebhookConfigArgs']]] = None,
                 __props__=None):
        """
        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 `projects.ServiceIdentity` resource.

        ## Example Usage
        ### Cloudbuild Trigger Filename

        ```python
        import pulumi
        import pulumi_gcp as gcp

        filename_trigger = gcp.cloudbuild.Trigger("filename-trigger",
            filename="cloudbuild.yaml",
            location="us-central1",
            substitutions={
                "_BAZ": "qux",
                "_FOO": "bar",
            },
            trigger_template=gcp.cloudbuild.TriggerTriggerTemplateArgs(
                branch_name="main",
                repo_name="my-repo",
            ))
        ```
        ### Cloudbuild Trigger Service Account

        ```python
        import pulumi
        import pulumi_gcp as gcp

        project = gcp.organizations.get_project()
        cloudbuild_service_account = gcp.service_account.Account("cloudbuildServiceAccount", account_id="my-service-account")
        act_as = gcp.projects.IAMMember("actAs",
            project=project.project_id,
            role="roles/iam.serviceAccountUser",
            member=cloudbuild_service_account.email.apply(lambda email: f"serviceAccount:{email}"))
        logs_writer = gcp.projects.IAMMember("logsWriter",
            project=project.project_id,
            role="roles/logging.logWriter",
            member=cloudbuild_service_account.email.apply(lambda email: f"serviceAccount:{email}"))
        service_account_trigger = gcp.cloudbuild.Trigger("service-account-trigger",
            trigger_template=gcp.cloudbuild.TriggerTriggerTemplateArgs(
                branch_name="main",
                repo_name="my-repo",
            ),
            service_account=cloudbuild_service_account.id,
            filename="cloudbuild.yaml",
            opts=pulumi.ResourceOptions(depends_on=[
                    act_as,
                    logs_writer,
                ]))
        ```
        ### Cloudbuild Trigger Include Build Logs

        ```python
        import pulumi
        import pulumi_gcp as gcp

        include_build_logs_trigger = gcp.cloudbuild.Trigger("include-build-logs-trigger",
            filename="cloudbuild.yaml",
            github=gcp.cloudbuild.TriggerGithubArgs(
                name="terraform-provider-google-beta",
                owner="hashicorp",
                push=gcp.cloudbuild.TriggerGithubPushArgs(
                    branch="^main$",
                ),
            ),
            include_build_logs="INCLUDE_BUILD_LOGS_WITH_STATUS",
            location="us-central1")
        ```
        ### Cloudbuild Trigger Pubsub Config

        ```python
        import pulumi
        import pulumi_gcp as gcp

        mytopic = gcp.pubsub.Topic("mytopic")
        pubsub_config_trigger = gcp.cloudbuild.Trigger("pubsub-config-trigger",
            location="us-central1",
            description="acceptance test example pubsub build trigger",
            pubsub_config=gcp.cloudbuild.TriggerPubsubConfigArgs(
                topic=mytopic.id,
            ),
            source_to_build=gcp.cloudbuild.TriggerSourceToBuildArgs(
                uri="https://hashicorp/terraform-provider-google-beta",
                ref="refs/heads/main",
                repo_type="GITHUB",
            ),
            git_file_source=gcp.cloudbuild.TriggerGitFileSourceArgs(
                path="cloudbuild.yaml",
                uri="https://hashicorp/terraform-provider-google-beta",
                revision="refs/heads/main",
                repo_type="GITHUB",
            ),
            substitutions={
                "_ACTION": "$(body.message.data.action)",
            },
            filter="_ACTION.matches('INSERT')")
        ```
        ### Cloudbuild Trigger Webhook Config

        ```python
        import pulumi
        import pulumi_gcp as gcp

        webhook_trigger_secret_key = gcp.secretmanager.Secret("webhookTriggerSecretKey",
            secret_id="webhook_trigger-secret-key-1",
            replication=gcp.secretmanager.SecretReplicationArgs(
                user_managed=gcp.secretmanager.SecretReplicationUserManagedArgs(
                    replicas=[gcp.secretmanager.SecretReplicationUserManagedReplicaArgs(
                        location="us-central1",
                    )],
                ),
            ))
        webhook_trigger_secret_key_data = gcp.secretmanager.SecretVersion("webhookTriggerSecretKeyData",
            secret=webhook_trigger_secret_key.id,
            secret_data="secretkeygoeshere")
        project = gcp.organizations.get_project()
        secret_accessor = gcp.organizations.get_iam_policy(bindings=[gcp.organizations.GetIAMPolicyBindingArgs(
            role="roles/secretmanager.secretAccessor",
            members=[f"serviceAccount:service-{project.number}@gcp-sa-cloudbuild.iam.gserviceaccount.com"],
        )])
        policy = gcp.secretmanager.SecretIamPolicy("policy",
            project=webhook_trigger_secret_key.project,
            secret_id=webhook_trigger_secret_key.secret_id,
            policy_data=secret_accessor.policy_data)
        webhook_config_trigger = gcp.cloudbuild.Trigger("webhook-config-trigger",
            description="acceptance test example webhook build trigger",
            webhook_config=gcp.cloudbuild.TriggerWebhookConfigArgs(
                secret=webhook_trigger_secret_key_data.id,
            ),
            source_to_build=gcp.cloudbuild.TriggerSourceToBuildArgs(
                uri="https://hashicorp/terraform-provider-google-beta",
                ref="refs/heads/main",
                repo_type="GITHUB",
            ),
            git_file_source=gcp.cloudbuild.TriggerGitFileSourceArgs(
                path="cloudbuild.yaml",
                uri="https://hashicorp/terraform-provider-google-beta",
                revision="refs/heads/main",
                repo_type="GITHUB",
            ))
        ```
        ### Cloudbuild Trigger Manual

        ```python
        import pulumi
        import pulumi_gcp as gcp

        manual_trigger = gcp.cloudbuild.Trigger("manual-trigger",
            approval_config=gcp.cloudbuild.TriggerApprovalConfigArgs(
                approval_required=True,
            ),
            git_file_source=gcp.cloudbuild.TriggerGitFileSourceArgs(
                path="cloudbuild.yaml",
                repo_type="GITHUB",
                revision="refs/heads/main",
                uri="https://hashicorp/terraform-provider-google-beta",
            ),
            source_to_build=gcp.cloudbuild.TriggerSourceToBuildArgs(
                ref="refs/heads/main",
                repo_type="GITHUB",
                uri="https://hashicorp/terraform-provider-google-beta",
            ))
        ```

        ## Import

        Trigger can be imported using any of these accepted formats

        ```sh
         $ pulumi import gcp:cloudbuild/trigger:Trigger default projects/{{project}}/locations/{{location}}/triggers/{{trigger_id}}
        ```

        ```sh
         $ pulumi import gcp:cloudbuild/trigger:Trigger default projects/{{project}}/triggers/{{trigger_id}}
        ```

        ```sh
         $ pulumi import gcp:cloudbuild/trigger:Trigger default {{project}}/{{trigger_id}}
        ```

        ```sh
         $ pulumi import gcp:cloudbuild/trigger:Trigger default {{trigger_id}}
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[pulumi.InputType['TriggerApprovalConfigArgs']] approval_config: 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.
        :param pulumi.Input[pulumi.InputType['TriggerBuildArgs']] build: Contents of the build template. Either a filename or build template must be provided.
               Structure is documented below.
        :param pulumi.Input[str] description: Human-readable description of the trigger.
        :param pulumi.Input[bool] disabled: Whether the trigger is disabled or not. If true, the trigger will never result in a build.
        :param pulumi.Input[str] filename: 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 trigger_template or github.
               When using Pub/Sub, Webhook or Manual set the file name using git_file_source instead.
        :param pulumi.Input[str] filter: A Common Expression Language string. Used only with Pub/Sub and Webhook.
        :param pulumi.Input[pulumi.InputType['TriggerGitFileSourceArgs']] git_file_source: The file source describing the local or remote Build template.
               Structure is documented below.
        :param pulumi.Input[pulumi.InputType['TriggerGithubArgs']] github: Describes the configuration of a trigger that creates a build whenever a GitHub event is received.
               One of `trigger_template`, `github`, `pubsub_config` or `webhook_config` must be provided.
               Structure is documented below.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] ignored_files: 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 ignored_file globs. If the change has no files that are outside
               of the ignoredFiles globs, then we do not trigger a build.
        :param pulumi.Input[str] include_build_logs: 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` and `INCLUDE_BUILD_LOGS_WITH_STATUS`.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] included_files: 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.
        :param pulumi.Input[str] location: Cloud Storage bucket and optional object path, in the form "gs://bucket/path/to/somewhere/".
               Files in the workspace matching any path pattern will be uploaded to Cloud Storage with
               this location as a prefix.
        :param pulumi.Input[str] name: Name of the volume to mount.
               Volume names must be unique per build step and must be valid names for Docker volumes.
               Each named volume must be used by at least two build steps.
        :param pulumi.Input[str] project: The ID of the project in which the resource belongs.
               If it is not provided, the provider project is used.
        :param pulumi.Input[pulumi.InputType['TriggerPubsubConfigArgs']] pubsub_config: PubsubConfig describes the configuration of a trigger that creates
               a build whenever a Pub/Sub message is published.
               One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        :param pulumi.Input[str] service_account: 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}
        :param pulumi.Input[pulumi.InputType['TriggerSourceToBuildArgs']] source_to_build: 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.
               One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] substitutions: Substitutions to use in a triggered build. Should only be used with triggers.run
        :param pulumi.Input[Sequence[pulumi.Input[str]]] tags: Tags for annotation of a Build. These are not docker tags.
        :param pulumi.Input[pulumi.InputType['TriggerTriggerTemplateArgs']] trigger_template: 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.
               One of `trigger_template`, `github`, `pubsub_config`, `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        :param pulumi.Input[pulumi.InputType['TriggerWebhookConfigArgs']] webhook_config: WebhookConfig describes the configuration of a trigger that creates
               a build whenever a webhook is sent to a trigger's webhook URL.
               One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: Optional[TriggerArgs] = None,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        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 `projects.ServiceIdentity` resource.

        ## Example Usage
        ### Cloudbuild Trigger Filename

        ```python
        import pulumi
        import pulumi_gcp as gcp

        filename_trigger = gcp.cloudbuild.Trigger("filename-trigger",
            filename="cloudbuild.yaml",
            location="us-central1",
            substitutions={
                "_BAZ": "qux",
                "_FOO": "bar",
            },
            trigger_template=gcp.cloudbuild.TriggerTriggerTemplateArgs(
                branch_name="main",
                repo_name="my-repo",
            ))
        ```
        ### Cloudbuild Trigger Service Account

        ```python
        import pulumi
        import pulumi_gcp as gcp

        project = gcp.organizations.get_project()
        cloudbuild_service_account = gcp.service_account.Account("cloudbuildServiceAccount", account_id="my-service-account")
        act_as = gcp.projects.IAMMember("actAs",
            project=project.project_id,
            role="roles/iam.serviceAccountUser",
            member=cloudbuild_service_account.email.apply(lambda email: f"serviceAccount:{email}"))
        logs_writer = gcp.projects.IAMMember("logsWriter",
            project=project.project_id,
            role="roles/logging.logWriter",
            member=cloudbuild_service_account.email.apply(lambda email: f"serviceAccount:{email}"))
        service_account_trigger = gcp.cloudbuild.Trigger("service-account-trigger",
            trigger_template=gcp.cloudbuild.TriggerTriggerTemplateArgs(
                branch_name="main",
                repo_name="my-repo",
            ),
            service_account=cloudbuild_service_account.id,
            filename="cloudbuild.yaml",
            opts=pulumi.ResourceOptions(depends_on=[
                    act_as,
                    logs_writer,
                ]))
        ```
        ### Cloudbuild Trigger Include Build Logs

        ```python
        import pulumi
        import pulumi_gcp as gcp

        include_build_logs_trigger = gcp.cloudbuild.Trigger("include-build-logs-trigger",
            filename="cloudbuild.yaml",
            github=gcp.cloudbuild.TriggerGithubArgs(
                name="terraform-provider-google-beta",
                owner="hashicorp",
                push=gcp.cloudbuild.TriggerGithubPushArgs(
                    branch="^main$",
                ),
            ),
            include_build_logs="INCLUDE_BUILD_LOGS_WITH_STATUS",
            location="us-central1")
        ```
        ### Cloudbuild Trigger Pubsub Config

        ```python
        import pulumi
        import pulumi_gcp as gcp

        mytopic = gcp.pubsub.Topic("mytopic")
        pubsub_config_trigger = gcp.cloudbuild.Trigger("pubsub-config-trigger",
            location="us-central1",
            description="acceptance test example pubsub build trigger",
            pubsub_config=gcp.cloudbuild.TriggerPubsubConfigArgs(
                topic=mytopic.id,
            ),
            source_to_build=gcp.cloudbuild.TriggerSourceToBuildArgs(
                uri="https://hashicorp/terraform-provider-google-beta",
                ref="refs/heads/main",
                repo_type="GITHUB",
            ),
            git_file_source=gcp.cloudbuild.TriggerGitFileSourceArgs(
                path="cloudbuild.yaml",
                uri="https://hashicorp/terraform-provider-google-beta",
                revision="refs/heads/main",
                repo_type="GITHUB",
            ),
            substitutions={
                "_ACTION": "$(body.message.data.action)",
            },
            filter="_ACTION.matches('INSERT')")
        ```
        ### Cloudbuild Trigger Webhook Config

        ```python
        import pulumi
        import pulumi_gcp as gcp

        webhook_trigger_secret_key = gcp.secretmanager.Secret("webhookTriggerSecretKey",
            secret_id="webhook_trigger-secret-key-1",
            replication=gcp.secretmanager.SecretReplicationArgs(
                user_managed=gcp.secretmanager.SecretReplicationUserManagedArgs(
                    replicas=[gcp.secretmanager.SecretReplicationUserManagedReplicaArgs(
                        location="us-central1",
                    )],
                ),
            ))
        webhook_trigger_secret_key_data = gcp.secretmanager.SecretVersion("webhookTriggerSecretKeyData",
            secret=webhook_trigger_secret_key.id,
            secret_data="secretkeygoeshere")
        project = gcp.organizations.get_project()
        secret_accessor = gcp.organizations.get_iam_policy(bindings=[gcp.organizations.GetIAMPolicyBindingArgs(
            role="roles/secretmanager.secretAccessor",
            members=[f"serviceAccount:service-{project.number}@gcp-sa-cloudbuild.iam.gserviceaccount.com"],
        )])
        policy = gcp.secretmanager.SecretIamPolicy("policy",
            project=webhook_trigger_secret_key.project,
            secret_id=webhook_trigger_secret_key.secret_id,
            policy_data=secret_accessor.policy_data)
        webhook_config_trigger = gcp.cloudbuild.Trigger("webhook-config-trigger",
            description="acceptance test example webhook build trigger",
            webhook_config=gcp.cloudbuild.TriggerWebhookConfigArgs(
                secret=webhook_trigger_secret_key_data.id,
            ),
            source_to_build=gcp.cloudbuild.TriggerSourceToBuildArgs(
                uri="https://hashicorp/terraform-provider-google-beta",
                ref="refs/heads/main",
                repo_type="GITHUB",
            ),
            git_file_source=gcp.cloudbuild.TriggerGitFileSourceArgs(
                path="cloudbuild.yaml",
                uri="https://hashicorp/terraform-provider-google-beta",
                revision="refs/heads/main",
                repo_type="GITHUB",
            ))
        ```
        ### Cloudbuild Trigger Manual

        ```python
        import pulumi
        import pulumi_gcp as gcp

        manual_trigger = gcp.cloudbuild.Trigger("manual-trigger",
            approval_config=gcp.cloudbuild.TriggerApprovalConfigArgs(
                approval_required=True,
            ),
            git_file_source=gcp.cloudbuild.TriggerGitFileSourceArgs(
                path="cloudbuild.yaml",
                repo_type="GITHUB",
                revision="refs/heads/main",
                uri="https://hashicorp/terraform-provider-google-beta",
            ),
            source_to_build=gcp.cloudbuild.TriggerSourceToBuildArgs(
                ref="refs/heads/main",
                repo_type="GITHUB",
                uri="https://hashicorp/terraform-provider-google-beta",
            ))
        ```

        ## Import

        Trigger can be imported using any of these accepted formats

        ```sh
         $ pulumi import gcp:cloudbuild/trigger:Trigger default projects/{{project}}/locations/{{location}}/triggers/{{trigger_id}}
        ```

        ```sh
         $ pulumi import gcp:cloudbuild/trigger:Trigger default projects/{{project}}/triggers/{{trigger_id}}
        ```

        ```sh
         $ pulumi import gcp:cloudbuild/trigger:Trigger default {{project}}/{{trigger_id}}
        ```

        ```sh
         $ pulumi import gcp:cloudbuild/trigger:Trigger default {{trigger_id}}
        ```

        :param str resource_name: The name of the resource.
        :param TriggerArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(TriggerArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 approval_config: Optional[pulumi.Input[pulumi.InputType['TriggerApprovalConfigArgs']]] = None,
                 build: Optional[pulumi.Input[pulumi.InputType['TriggerBuildArgs']]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 disabled: Optional[pulumi.Input[bool]] = None,
                 filename: Optional[pulumi.Input[str]] = None,
                 filter: Optional[pulumi.Input[str]] = None,
                 git_file_source: Optional[pulumi.Input[pulumi.InputType['TriggerGitFileSourceArgs']]] = None,
                 github: Optional[pulumi.Input[pulumi.InputType['TriggerGithubArgs']]] = None,
                 ignored_files: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 include_build_logs: Optional[pulumi.Input[str]] = None,
                 included_files: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 location: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 pubsub_config: Optional[pulumi.Input[pulumi.InputType['TriggerPubsubConfigArgs']]] = None,
                 service_account: Optional[pulumi.Input[str]] = None,
                 source_to_build: Optional[pulumi.Input[pulumi.InputType['TriggerSourceToBuildArgs']]] = None,
                 substitutions: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 trigger_template: Optional[pulumi.Input[pulumi.InputType['TriggerTriggerTemplateArgs']]] = None,
                 webhook_config: Optional[pulumi.Input[pulumi.InputType['TriggerWebhookConfigArgs']]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = TriggerArgs.__new__(TriggerArgs)

            __props__.__dict__["approval_config"] = approval_config
            __props__.__dict__["build"] = build
            __props__.__dict__["description"] = description
            __props__.__dict__["disabled"] = disabled
            __props__.__dict__["filename"] = filename
            __props__.__dict__["filter"] = filter
            __props__.__dict__["git_file_source"] = git_file_source
            __props__.__dict__["github"] = github
            __props__.__dict__["ignored_files"] = ignored_files
            __props__.__dict__["include_build_logs"] = include_build_logs
            __props__.__dict__["included_files"] = included_files
            __props__.__dict__["location"] = location
            __props__.__dict__["name"] = name
            __props__.__dict__["project"] = project
            __props__.__dict__["pubsub_config"] = pubsub_config
            __props__.__dict__["service_account"] = service_account
            __props__.__dict__["source_to_build"] = source_to_build
            __props__.__dict__["substitutions"] = substitutions
            __props__.__dict__["tags"] = tags
            __props__.__dict__["trigger_template"] = trigger_template
            __props__.__dict__["webhook_config"] = webhook_config
            __props__.__dict__["create_time"] = None
            __props__.__dict__["trigger_id"] = None
        super(Trigger, __self__).__init__(
            'gcp:cloudbuild/trigger:Trigger',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            approval_config: Optional[pulumi.Input[pulumi.InputType['TriggerApprovalConfigArgs']]] = None,
            build: Optional[pulumi.Input[pulumi.InputType['TriggerBuildArgs']]] = None,
            create_time: Optional[pulumi.Input[str]] = None,
            description: Optional[pulumi.Input[str]] = None,
            disabled: Optional[pulumi.Input[bool]] = None,
            filename: Optional[pulumi.Input[str]] = None,
            filter: Optional[pulumi.Input[str]] = None,
            git_file_source: Optional[pulumi.Input[pulumi.InputType['TriggerGitFileSourceArgs']]] = None,
            github: Optional[pulumi.Input[pulumi.InputType['TriggerGithubArgs']]] = None,
            ignored_files: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            include_build_logs: Optional[pulumi.Input[str]] = None,
            included_files: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            location: Optional[pulumi.Input[str]] = None,
            name: Optional[pulumi.Input[str]] = None,
            project: Optional[pulumi.Input[str]] = None,
            pubsub_config: Optional[pulumi.Input[pulumi.InputType['TriggerPubsubConfigArgs']]] = None,
            service_account: Optional[pulumi.Input[str]] = None,
            source_to_build: Optional[pulumi.Input[pulumi.InputType['TriggerSourceToBuildArgs']]] = None,
            substitutions: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
            tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            trigger_id: Optional[pulumi.Input[str]] = None,
            trigger_template: Optional[pulumi.Input[pulumi.InputType['TriggerTriggerTemplateArgs']]] = None,
            webhook_config: Optional[pulumi.Input[pulumi.InputType['TriggerWebhookConfigArgs']]] = None) -> 'Trigger':
        """
        Get an existing Trigger resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[pulumi.InputType['TriggerApprovalConfigArgs']] approval_config: 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.
        :param pulumi.Input[pulumi.InputType['TriggerBuildArgs']] build: Contents of the build template. Either a filename or build template must be provided.
               Structure is documented below.
        :param pulumi.Input[str] create_time: Time when the trigger was created.
        :param pulumi.Input[str] description: Human-readable description of the trigger.
        :param pulumi.Input[bool] disabled: Whether the trigger is disabled or not. If true, the trigger will never result in a build.
        :param pulumi.Input[str] filename: 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 trigger_template or github.
               When using Pub/Sub, Webhook or Manual set the file name using git_file_source instead.
        :param pulumi.Input[str] filter: A Common Expression Language string. Used only with Pub/Sub and Webhook.
        :param pulumi.Input[pulumi.InputType['TriggerGitFileSourceArgs']] git_file_source: The file source describing the local or remote Build template.
               Structure is documented below.
        :param pulumi.Input[pulumi.InputType['TriggerGithubArgs']] github: Describes the configuration of a trigger that creates a build whenever a GitHub event is received.
               One of `trigger_template`, `github`, `pubsub_config` or `webhook_config` must be provided.
               Structure is documented below.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] ignored_files: 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 ignored_file globs. If the change has no files that are outside
               of the ignoredFiles globs, then we do not trigger a build.
        :param pulumi.Input[str] include_build_logs: 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` and `INCLUDE_BUILD_LOGS_WITH_STATUS`.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] included_files: 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.
        :param pulumi.Input[str] location: Cloud Storage bucket and optional object path, in the form "gs://bucket/path/to/somewhere/".
               Files in the workspace matching any path pattern will be uploaded to Cloud Storage with
               this location as a prefix.
        :param pulumi.Input[str] name: Name of the volume to mount.
               Volume names must be unique per build step and must be valid names for Docker volumes.
               Each named volume must be used by at least two build steps.
        :param pulumi.Input[str] project: The ID of the project in which the resource belongs.
               If it is not provided, the provider project is used.
        :param pulumi.Input[pulumi.InputType['TriggerPubsubConfigArgs']] pubsub_config: PubsubConfig describes the configuration of a trigger that creates
               a build whenever a Pub/Sub message is published.
               One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        :param pulumi.Input[str] service_account: 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}
        :param pulumi.Input[pulumi.InputType['TriggerSourceToBuildArgs']] source_to_build: 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.
               One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] substitutions: Substitutions to use in a triggered build. Should only be used with triggers.run
        :param pulumi.Input[Sequence[pulumi.Input[str]]] tags: Tags for annotation of a Build. These are not docker tags.
        :param pulumi.Input[str] trigger_id: The unique identifier for the trigger.
        :param pulumi.Input[pulumi.InputType['TriggerTriggerTemplateArgs']] trigger_template: 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.
               One of `trigger_template`, `github`, `pubsub_config`, `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        :param pulumi.Input[pulumi.InputType['TriggerWebhookConfigArgs']] webhook_config: WebhookConfig describes the configuration of a trigger that creates
               a build whenever a webhook is sent to a trigger's webhook URL.
               One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
               Structure is documented below.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _TriggerState.__new__(_TriggerState)

        __props__.__dict__["approval_config"] = approval_config
        __props__.__dict__["build"] = build
        __props__.__dict__["create_time"] = create_time
        __props__.__dict__["description"] = description
        __props__.__dict__["disabled"] = disabled
        __props__.__dict__["filename"] = filename
        __props__.__dict__["filter"] = filter
        __props__.__dict__["git_file_source"] = git_file_source
        __props__.__dict__["github"] = github
        __props__.__dict__["ignored_files"] = ignored_files
        __props__.__dict__["include_build_logs"] = include_build_logs
        __props__.__dict__["included_files"] = included_files
        __props__.__dict__["location"] = location
        __props__.__dict__["name"] = name
        __props__.__dict__["project"] = project
        __props__.__dict__["pubsub_config"] = pubsub_config
        __props__.__dict__["service_account"] = service_account
        __props__.__dict__["source_to_build"] = source_to_build
        __props__.__dict__["substitutions"] = substitutions
        __props__.__dict__["tags"] = tags
        __props__.__dict__["trigger_id"] = trigger_id
        __props__.__dict__["trigger_template"] = trigger_template
        __props__.__dict__["webhook_config"] = webhook_config
        return Trigger(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="approvalConfig")
    def approval_config(self) -> pulumi.Output['outputs.TriggerApprovalConfig']:
        """
        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.
        """
        return pulumi.get(self, "approval_config")

    @property
    @pulumi.getter
    def build(self) -> pulumi.Output[Optional['outputs.TriggerBuild']]:
        """
        Contents of the build template. Either a filename or build template must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "build")

    @property
    @pulumi.getter(name="createTime")
    def create_time(self) -> pulumi.Output[str]:
        """
        Time when the trigger was created.
        """
        return pulumi.get(self, "create_time")

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[Optional[str]]:
        """
        Human-readable description of the trigger.
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter
    def disabled(self) -> pulumi.Output[Optional[bool]]:
        """
        Whether the trigger is disabled or not. If true, the trigger will never result in a build.
        """
        return pulumi.get(self, "disabled")

    @property
    @pulumi.getter
    def filename(self) -> pulumi.Output[Optional[str]]:
        """
        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 trigger_template or github.
        When using Pub/Sub, Webhook or Manual set the file name using git_file_source instead.
        """
        return pulumi.get(self, "filename")

    @property
    @pulumi.getter
    def filter(self) -> pulumi.Output[Optional[str]]:
        """
        A Common Expression Language string. Used only with Pub/Sub and Webhook.
        """
        return pulumi.get(self, "filter")

    @property
    @pulumi.getter(name="gitFileSource")
    def git_file_source(self) -> pulumi.Output[Optional['outputs.TriggerGitFileSource']]:
        """
        The file source describing the local or remote Build template.
        Structure is documented below.
        """
        return pulumi.get(self, "git_file_source")

    @property
    @pulumi.getter
    def github(self) -> pulumi.Output[Optional['outputs.TriggerGithub']]:
        """
        Describes the configuration of a trigger that creates a build whenever a GitHub event is received.
        One of `trigger_template`, `github`, `pubsub_config` or `webhook_config` must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "github")

    @property
    @pulumi.getter(name="ignoredFiles")
    def ignored_files(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        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 ignored_file globs. If the change has no files that are outside
        of the ignoredFiles globs, then we do not trigger a build.
        """
        return pulumi.get(self, "ignored_files")

    @property
    @pulumi.getter(name="includeBuildLogs")
    def include_build_logs(self) -> pulumi.Output[Optional[str]]:
        """
        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` and `INCLUDE_BUILD_LOGS_WITH_STATUS`.
        """
        return pulumi.get(self, "include_build_logs")

    @property
    @pulumi.getter(name="includedFiles")
    def included_files(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        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.
        """
        return pulumi.get(self, "included_files")

    @property
    @pulumi.getter
    def location(self) -> pulumi.Output[Optional[str]]:
        """
        Cloud Storage bucket and optional object path, in the form "gs://bucket/path/to/somewhere/".
        Files in the workspace matching any path pattern will be uploaded to Cloud Storage with
        this location as a prefix.
        """
        return pulumi.get(self, "location")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        Name of the volume to mount.
        Volume names must be unique per build step and must be valid names for Docker volumes.
        Each named volume must be used by at least two build steps.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def project(self) -> pulumi.Output[str]:
        """
        The ID of the project in which the resource belongs.
        If it is not provided, the provider project is used.
        """
        return pulumi.get(self, "project")

    @property
    @pulumi.getter(name="pubsubConfig")
    def pubsub_config(self) -> pulumi.Output[Optional['outputs.TriggerPubsubConfig']]:
        """
        PubsubConfig describes the configuration of a trigger that creates
        a build whenever a Pub/Sub message is published.
        One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "pubsub_config")

    @property
    @pulumi.getter(name="serviceAccount")
    def service_account(self) -> pulumi.Output[Optional[str]]:
        """
        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}
        """
        return pulumi.get(self, "service_account")

    @property
    @pulumi.getter(name="sourceToBuild")
    def source_to_build(self) -> pulumi.Output[Optional['outputs.TriggerSourceToBuild']]:
        """
        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.
        One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "source_to_build")

    @property
    @pulumi.getter
    def substitutions(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
        """
        Substitutions to use in a triggered build. Should only be used with triggers.run
        """
        return pulumi.get(self, "substitutions")

    @property
    @pulumi.getter
    def tags(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        Tags for annotation of a Build. These are not docker tags.
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter(name="triggerId")
    def trigger_id(self) -> pulumi.Output[str]:
        """
        The unique identifier for the trigger.
        """
        return pulumi.get(self, "trigger_id")

    @property
    @pulumi.getter(name="triggerTemplate")
    def trigger_template(self) -> pulumi.Output[Optional['outputs.TriggerTriggerTemplate']]:
        """
        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.
        One of `trigger_template`, `github`, `pubsub_config`, `webhook_config` or `source_to_build` must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "trigger_template")

    @property
    @pulumi.getter(name="webhookConfig")
    def webhook_config(self) -> pulumi.Output[Optional['outputs.TriggerWebhookConfig']]:
        """
        WebhookConfig describes the configuration of a trigger that creates
        a build whenever a webhook is sent to a trigger's webhook URL.
        One of `trigger_template`, `github`, `pubsub_config` `webhook_config` or `source_to_build` must be provided.
        Structure is documented below.
        """
        return pulumi.get(self, "webhook_config")

