Requested disk size for the VM that runs the build. Note that this is NOT
"disk free"; some of the space will be used by the operating system and
build utilities. Also note that this is the minimum disk size that will be
allocated for the build -- the build may run with a larger disk than
requested. At present, the maximum disk size is 4000GB; builds that request
more than the maximum are rejected with an error.
A list of global environment variable definitions that will exist for all
build steps in this build. If a variable is defined in both globally and in
a build step, the variable will use the build step value.
The elements are of the form "KEY=VALUE" for the environment variable "KEY"
being given the value "VALUE".
A list of global environment variables, which are encrypted using a Cloud
Key Management Service crypto key. These values must be specified in the
build's Secret. These variables will be available to all build steps
in this build.
Global list of volumes to mount for ALL build steps
Each volume is created as an empty volume prior to starting the build
process. Upon completion of the build, volumes and their contents are
discarded. Global volume names and paths cannot conflict with the volumes
defined a build step.
Using a global volume in a build with only one step is not valid as
it is indicative of a build request with an incorrect configuration.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-19 UTC."],[[["\u003cp\u003eThis document provides reference documentation for the \u003ccode\u003eBuildOptions\u003c/code\u003e class within the Google Cloud Build v1 API, outlining its properties, constructors, inheritance, and implemented interfaces.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBuildOptions\u003c/code\u003e class allows for customization of build features, such as setting environment variables, managing logging, disk size, and specifying machine types.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the \u003ccode\u003eBuildOptions\u003c/code\u003e documentation is version 2.15.0, and there are versions listed dating back to 1.0.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBuildOptions\u003c/code\u003e class provides properties for configuring build environments, including options for managing variables, logging, disk size and machine type.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBuildOptions\u003c/code\u003e class can be used to set options for using a WorkerPool, which is a way to run builds in a private pool.\u003c/p\u003e\n"]]],[],null,["# Cloud Build v1 API - Class BuildOptions (2.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.16.0 (latest)](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.15.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.15.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.14.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.14.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.13.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.13.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.12.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.12.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.11.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.11.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.10.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.9.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.8.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.7.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.6.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.5.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.4.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.3.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.2.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.1.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.0.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.4.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.3.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.2.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.1.0/Google.Cloud.CloudBuild.V1.BuildOptions)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.0.0/Google.Cloud.CloudBuild.V1.BuildOptions) \n\n public sealed class BuildOptions : IMessage\u003cBuildOptions\u003e, IEquatable\u003cBuildOptions\u003e, IDeepCloneable\u003cBuildOptions\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Build v1 API class BuildOptions.\n\nOptional arguments to enable specific features of builds. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e BuildOptions \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[BuildOptions](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1.BuildOptions), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[BuildOptions](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1.BuildOptions), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[BuildOptions](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1.BuildOptions), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.CloudBuild.V1](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.CloudBuild.V1.dll\n\nConstructors\n------------\n\n### BuildOptions()\n\n public BuildOptions()\n\n### BuildOptions(BuildOptions)\n\n public BuildOptions(BuildOptions other)\n\nProperties\n----------\n\n### AutomapSubstitutions\n\n public bool AutomapSubstitutions { get; set; }\n\nOption to include built-in and custom substitutions as env variables\nfor all build steps.\n\n### DefaultLogsBucketBehavior\n\n public BuildOptions.Types.DefaultLogsBucketBehavior DefaultLogsBucketBehavior { get; set; }\n\nOptional. Option to specify how default logs buckets are setup.\n\n### DiskSizeGb\n\n public long DiskSizeGb { get; set; }\n\nRequested disk size for the VM that runs the build. Note that this is *NOT*\n\"disk free\"; some of the space will be used by the operating system and\nbuild utilities. Also note that this is the minimum disk size that will be\nallocated for the build -- the build may run with a larger disk than\nrequested. At present, the maximum disk size is 4000GB; builds that request\nmore than the maximum are rejected with an error.\n\n### DynamicSubstitutions\n\n public bool DynamicSubstitutions { get; set; }\n\nOption to specify whether or not to apply bash style string\noperations to the substitutions.\n\nNOTE: this is always enabled for triggered builds and cannot be\noverridden in the build configuration file.\n\n### EnableStructuredLogging\n\n public bool EnableStructuredLogging { get; set; }\n\nOptional. Option to specify whether structured logging is enabled.\n\nIf true, JSON-formatted logs are parsed as structured logs.\n\n### Env\n\n public RepeatedField\u003cstring\u003e Env { get; }\n\nA list of global environment variable definitions that will exist for all\nbuild steps in this build. If a variable is defined in both globally and in\na build step, the variable will use the build step value.\n\nThe elements are of the form \"KEY=VALUE\" for the environment variable \"KEY\"\nbeing given the value \"VALUE\".\n\n### LogStreamingOption\n\n public BuildOptions.Types.LogStreamingOption LogStreamingOption { get; set; }\n\nOption to define build log streaming behavior to Cloud\nStorage.\n\n### Logging\n\n public BuildOptions.Types.LoggingMode Logging { get; set; }\n\nOption to specify the logging mode, which determines if and where build\nlogs are stored.\n\n### MachineType\n\n public BuildOptions.Types.MachineType MachineType { get; set; }\n\nCompute Engine machine type on which to run the build.\n\n### Pool\n\n public BuildOptions.Types.PoolOption Pool { get; set; }\n\nOptional. Specification for execution on a `WorkerPool`.\n\nSee [running builds in a private\npool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool)\nfor more information.\n\n### RequestedVerifyOption\n\n public BuildOptions.Types.VerifyOption RequestedVerifyOption { get; set; }\n\nRequested verifiability options.\n\n### SecretEnv\n\n public RepeatedField\u003cstring\u003e SecretEnv { get; }\n\nA list of global environment variables, which are encrypted using a Cloud\nKey Management Service crypto key. These values must be specified in the\nbuild's `Secret`. These variables will be available to all build steps\nin this build.\n\n### SourceProvenanceHash\n\n public RepeatedField\u003cHash.Types.HashType\u003e SourceProvenanceHash { get; }\n\nRequested hash for SourceProvenance.\n\n### SubstitutionOption\n\n public BuildOptions.Types.SubstitutionOption SubstitutionOption { get; set; }\n\nOption to specify behavior when there is an error in the substitution\nchecks.\n\nNOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot\nbe overridden in the build configuration file.\n\n### Volumes\n\n public RepeatedField\u003cVolume\u003e Volumes { get; }\n\nGlobal list of volumes to mount for ALL build steps\n\nEach volume is created as an empty volume prior to starting the build\nprocess. Upon completion of the build, volumes and their contents are\ndiscarded. Global volume names and paths cannot conflict with the volumes\ndefined a build step.\n\nUsing a global volume in a build with only one step is not valid as\nit is indicative of a build request with an incorrect configuration.\n\n### WorkerPool\n\n [Obsolete]\n public string WorkerPool { get; set; }\n\nThis field deprecated; please use `pool.name` instead."]]