# Cloud Functions V2 API - Class Google::Cloud::Functions::V2::BuildConfig (v1.5.1)

1.5.1 (latest) 1.5.0 1.4.0 1.3.1 1.2.0 1.1.0 1.0.2 0.10.0 0.9.0 0.8.1 0.7.0 0.6.2 0.5.0 0.4.1 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Cloud Functions V2 API class Google::Cloud::Functions::V2::BuildConfig.

Describes the Build step of the function that builds a container from the
given source.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #automatic_update_policy

    def automatic_update_policy() -> ::Google::Cloud::Functions::V2::AutomaticUpdatePolicy

**Returns**

- ([::Google::Cloud::Functions::V2::AutomaticUpdatePolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-AutomaticUpdatePolicy)) --- Note: The following fields are mutually exclusive: `automatic_update_policy`, `on_deploy_update_policy`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #automatic_update_policy=

    def automatic_update_policy=(value) -> ::Google::Cloud::Functions::V2::AutomaticUpdatePolicy

**Parameter**

- **value** ([::Google::Cloud::Functions::V2::AutomaticUpdatePolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-AutomaticUpdatePolicy)) --- Note: The following fields are mutually exclusive: `automatic_update_policy`, `on_deploy_update_policy`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Functions::V2::AutomaticUpdatePolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-AutomaticUpdatePolicy)) --- Note: The following fields are mutually exclusive: `automatic_update_policy`, `on_deploy_update_policy`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #build

    def build() -> ::String

**Returns**

- (::String) --- Output only. The Cloud Build name of the latest successful deployment of the function.

### #docker_registry

    def docker_registry() -> ::Google::Cloud::Functions::V2::BuildConfig::DockerRegistry

**Returns**

- ([::Google::Cloud::Functions::V2::BuildConfig::DockerRegistry](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-BuildConfig-DockerRegistry)) --- Docker Registry to use for this deployment. This configuration is only applicable to 1st Gen functions, 2nd Gen functions can only use Artifact Registry. Deprecated: As of March 2025, `CONTAINER_REGISTRY` option is no longer available in response to Container Registry's deprecation: https://cloud.google.com/artifact-registry/docs/transition/transition-from-gcr Please use Artifact Registry instead, which is the default choice.


  If unspecified, it defaults to `ARTIFACT_REGISTRY`.
  If `docker_repository` field is specified, this field should either be left
  unspecified or set to `ARTIFACT_REGISTRY`.

### #docker_registry=

    def docker_registry=(value) -> ::Google::Cloud::Functions::V2::BuildConfig::DockerRegistry

**Parameter**

- **value** ([::Google::Cloud::Functions::V2::BuildConfig::DockerRegistry](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-BuildConfig-DockerRegistry)) --- Docker Registry to use for this deployment. This configuration is only applicable to 1st Gen functions, 2nd Gen functions can only use Artifact Registry. Deprecated: As of March 2025, `CONTAINER_REGISTRY` option is no longer available in response to Container Registry's deprecation: https://cloud.google.com/artifact-registry/docs/transition/transition-from-gcr Please use Artifact Registry instead, which is the default choice.


  If unspecified, it defaults to `ARTIFACT_REGISTRY`.
  If `docker_repository` field is specified, this field should either be left
  unspecified or set to `ARTIFACT_REGISTRY`.
**Returns**

- ([::Google::Cloud::Functions::V2::BuildConfig::DockerRegistry](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-BuildConfig-DockerRegistry)) --- Docker Registry to use for this deployment. This configuration is only applicable to 1st Gen functions, 2nd Gen functions can only use Artifact Registry. Deprecated: As of March 2025, `CONTAINER_REGISTRY` option is no longer available in response to Container Registry's deprecation: https://cloud.google.com/artifact-registry/docs/transition/transition-from-gcr Please use Artifact Registry instead, which is the default choice.


  If unspecified, it defaults to `ARTIFACT_REGISTRY`.
  If `docker_repository` field is specified, this field should either be left
  unspecified or set to `ARTIFACT_REGISTRY`.

### #docker_repository

    def docker_repository() -> ::String

**Returns**

- (::String) --- Repository in Artifact Registry to which the function docker image will be pushed after it is built by Cloud Build. If specified by user, it is created and managed by user with a customer managed encryption key. Otherwise, GCF will create and use a repository named 'gcf-artifacts' for every deployed region.

  It must match the pattern
  `projects/{project}/locations/{location}/repositories/{repository}`.
  Repository format must be 'DOCKER'.

### #docker_repository=

    def docker_repository=(value) -> ::String

**Parameter**

- **value** (::String) --- Repository in Artifact Registry to which the function docker image will be pushed after it is built by Cloud Build. If specified by user, it is created and managed by user with a customer managed encryption key. Otherwise, GCF will create and use a repository named 'gcf-artifacts' for every deployed region.


  It must match the pattern
  `projects/{project}/locations/{location}/repositories/{repository}`.
  Repository format must be 'DOCKER'.
**Returns**

- (::String) --- Repository in Artifact Registry to which the function docker image will be pushed after it is built by Cloud Build. If specified by user, it is created and managed by user with a customer managed encryption key. Otherwise, GCF will create and use a repository named 'gcf-artifacts' for every deployed region.

  It must match the pattern
  `projects/{project}/locations/{location}/repositories/{repository}`.
  Repository format must be 'DOCKER'.

### #entry_point

    def entry_point() -> ::String

**Returns**

- (::String) --- The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified. For backward compatibility, if function with given name is not found, then the system will try to use function named "function". For Node.js this is name of a function exported by the module specified in `source_location`.

### #entry_point=

    def entry_point=(value) -> ::String

**Parameter**

- **value** (::String) --- The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified. For backward compatibility, if function with given name is not found, then the system will try to use function named "function". For Node.js this is name of a function exported by the module specified in `source_location`.
**Returns**

- (::String) --- The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified. For backward compatibility, if function with given name is not found, then the system will try to use function named "function". For Node.js this is name of a function exported by the module specified in `source_location`.

### #environment_variables

    def environment_variables() -> ::Google::Protobuf::Map{::String => ::String}

**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- User-provided build-time environment variables for the function

### #environment_variables=

    def environment_variables=(value) -> ::Google::Protobuf::Map{::String => ::String}

**Parameter**

- **value** (::Google::Protobuf::Map{::String =\> ::String}) --- User-provided build-time environment variables for the function
**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- User-provided build-time environment variables for the function

### #on_deploy_update_policy

    def on_deploy_update_policy() -> ::Google::Cloud::Functions::V2::OnDeployUpdatePolicy

**Returns**

- ([::Google::Cloud::Functions::V2::OnDeployUpdatePolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-OnDeployUpdatePolicy)) --- Note: The following fields are mutually exclusive: `on_deploy_update_policy`, `automatic_update_policy`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #on_deploy_update_policy=

    def on_deploy_update_policy=(value) -> ::Google::Cloud::Functions::V2::OnDeployUpdatePolicy

**Parameter**

- **value** ([::Google::Cloud::Functions::V2::OnDeployUpdatePolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-OnDeployUpdatePolicy)) --- Note: The following fields are mutually exclusive: `on_deploy_update_policy`, `automatic_update_policy`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Functions::V2::OnDeployUpdatePolicy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-OnDeployUpdatePolicy)) --- Note: The following fields are mutually exclusive: `on_deploy_update_policy`, `automatic_update_policy`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #runtime

    def runtime() -> ::String

**Returns**

- (::String) --- The runtime in which to run the function. Required when deploying a new function, optional when updating an existing function. For a complete list of possible choices, see the [`gcloud` command
  reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).

### #runtime=

    def runtime=(value) -> ::String

**Parameter**

- **value** (::String) --- The runtime in which to run the function. Required when deploying a new function, optional when updating an existing function. For a complete list of possible choices, see the [`gcloud` command
  reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
**Returns**

- (::String) --- The runtime in which to run the function. Required when deploying a new function, optional when updating an existing function. For a complete list of possible choices, see the [`gcloud` command
  reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).

### #service_account

    def service_account() -> ::String

**Returns**

- (::String) --- Service account to be used for building the container. The format of this field is `projects/{projectId}/serviceAccounts/{serviceAccountEmail}`.

### #service_account=

    def service_account=(value) -> ::String

**Parameter**

- **value** (::String) --- Service account to be used for building the container. The format of this field is `projects/{projectId}/serviceAccounts/{serviceAccountEmail}`.
**Returns**

- (::String) --- Service account to be used for building the container. The format of this field is `projects/{projectId}/serviceAccounts/{serviceAccountEmail}`.

### #source

    def source() -> ::Google::Cloud::Functions::V2::Source

**Returns**

- ([::Google::Cloud::Functions::V2::Source](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-Source)) --- The location of the function source code.

### #source=

    def source=(value) -> ::Google::Cloud::Functions::V2::Source

**Parameter**

- **value** ([::Google::Cloud::Functions::V2::Source](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-Source)) --- The location of the function source code.
**Returns**

- ([::Google::Cloud::Functions::V2::Source](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-Source)) --- The location of the function source code.

### #source_provenance

    def source_provenance() -> ::Google::Cloud::Functions::V2::SourceProvenance

**Returns**

- ([::Google::Cloud::Functions::V2::SourceProvenance](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-SourceProvenance)) --- Output only. A permanent fixed identifier for source.

### #worker_pool

    def worker_pool() -> ::String

**Returns**

- (::String) --- Name of the Cloud Build Custom Worker Pool that should be used to build the function. The format of this field is `projects/{project}/locations/{region}/workerPools/{workerPool}` where {project} and {region} are the project id and region respectively where the worker pool is defined and {workerPool} is the short name of the worker pool.


  If the project id is not the same as the function, then the Cloud
  Functions Service Agent
  (service-

### #worker_pool=

    def worker_pool=(value) -> ::String

**Parameter**

- **value** (::String) --- Name of the Cloud Build Custom Worker Pool that should be used to build the function. The format of this field is `projects/{project}/locations/{region}/workerPools/{workerPool}` where {project} and {region} are the project id and region respectively where the worker pool is defined and {workerPool} is the short name of the worker pool.


  If the project id is not the same as the function, then the Cloud
  Functions Service Agent
  (service-
**Returns**

- (::String) --- Name of the Cloud Build Custom Worker Pool that should be used to build the function. The format of this field is `projects/{project}/locations/{region}/workerPools/{workerPool}` where {project} and {region} are the project id and region respectively where the worker pool is defined and {workerPool} is the short name of the worker pool.


  If the project id is not the same as the function, then the Cloud
  Functions Service Agent
  (service-