Google Cloud Functions V2 Client - Class BuildConfig (1.1.2)

Reference documentation and code samples for the Google Cloud Functions V2 Client class BuildConfig.

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

Generated from protobuf message google.cloud.functions.v2.BuildConfig

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ build string

Output only. The Cloud Build name of the latest successful deployment of the function.

↳ runtime 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.

↳ entry_point 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.

↳ source Google\Cloud\Functions\V2\Source

The location of the function source code.

↳ source_provenance Google\Cloud\Functions\V2\SourceProvenance

Output only. A permanent fixed identifier for source.

↳ worker_pool 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-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be granted the role Cloud Build Custom Workers Builder (roles/cloudbuild.customworkers.builder) in the project.

↳ environment_variables array|Google\Protobuf\Internal\MapField

User-provided build-time environment variables for the function

↳ docker_registry int

Optional. Docker Registry to use for this deployment. This configuration is only applicable to 1st Gen functions, 2nd Gen functions can only use Artifact Registry. If docker_repository field is specified, this field will be automatically set as ARTIFACT_REGISTRY. If unspecified, it currently defaults to CONTAINER_REGISTRY. This field may be overridden by the backend for eligible deployments.

↳ docker_repository string

User managed repository created in Artifact Registry optionally with a customer managed encryption key. This is the repository to which the function docker image will be pushed after it is built by Cloud Build. If unspecified, 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}. Cross-project repositories are not supported. Cross-location repositories are not supported. Repository format must be 'DOCKER'.

getBuild

Output only. The Cloud Build name of the latest successful deployment of the function.

Returns
TypeDescription
string

setBuild

Output only. The Cloud Build name of the latest successful deployment of the function.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getRuntime

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.

Returns
TypeDescription
string

setRuntime

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.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getEntryPoint

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
TypeDescription
string

setEntryPoint

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.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getSource

The location of the function source code.

Returns
TypeDescription
Google\Cloud\Functions\V2\Source|null

hasSource

clearSource

setSource

The location of the function source code.

Parameter
NameDescription
var Google\Cloud\Functions\V2\Source
Returns
TypeDescription
$this

getSourceProvenance

Output only. A permanent fixed identifier for source.

Returns
TypeDescription
Google\Cloud\Functions\V2\SourceProvenance|null

hasSourceProvenance

clearSourceProvenance

setSourceProvenance

Output only. A permanent fixed identifier for source.

Parameter
NameDescription
var Google\Cloud\Functions\V2\SourceProvenance
Returns
TypeDescription
$this

getWorkerPool

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-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be granted the role Cloud Build Custom Workers Builder (roles/cloudbuild.customworkers.builder) in the project.

Returns
TypeDescription
string

setWorkerPool

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-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be granted the role Cloud Build Custom Workers Builder (roles/cloudbuild.customworkers.builder) in the project.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getEnvironmentVariables

User-provided build-time environment variables for the function

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setEnvironmentVariables

User-provided build-time environment variables for the function

Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getDockerRegistry

Optional. Docker Registry to use for this deployment. This configuration is only applicable to 1st Gen functions, 2nd Gen functions can only use Artifact Registry.

If docker_repository field is specified, this field will be automatically set as ARTIFACT_REGISTRY. If unspecified, it currently defaults to CONTAINER_REGISTRY. This field may be overridden by the backend for eligible deployments.

Returns
TypeDescription
int

setDockerRegistry

Optional. Docker Registry to use for this deployment. This configuration is only applicable to 1st Gen functions, 2nd Gen functions can only use Artifact Registry.

If docker_repository field is specified, this field will be automatically set as ARTIFACT_REGISTRY. If unspecified, it currently defaults to CONTAINER_REGISTRY. This field may be overridden by the backend for eligible deployments.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getDockerRepository

User managed repository created in Artifact Registry optionally with a customer managed encryption key. This is the repository to which the function docker image will be pushed after it is built by Cloud Build.

If unspecified, 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}. Cross-project repositories are not supported. Cross-location repositories are not supported. Repository format must be 'DOCKER'.

Returns
TypeDescription
string

setDockerRepository

User managed repository created in Artifact Registry optionally with a customer managed encryption key. This is the repository to which the function docker image will be pushed after it is built by Cloud Build.

If unspecified, 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}. Cross-project repositories are not supported. Cross-location repositories are not supported. Repository format must be 'DOCKER'.

Parameter
NameDescription
var string
Returns
TypeDescription
$this