Cloud Functions v2 API - Class ServiceConfig (1.0.0)

public sealed class ServiceConfig : IMessage<ServiceConfig>, IEquatable<ServiceConfig>, IDeepCloneable<ServiceConfig>, IBufferMessage, IMessage

Reference documentation and code samples for the Cloud Functions v2 API class ServiceConfig.

Describes the Service being deployed. Currently Supported : Cloud Run (fully managed).

Inheritance

Object > ServiceConfig

Namespace

Google.Cloud.Functions.V2

Assembly

Google.Cloud.Functions.V2.dll

Constructors

ServiceConfig()

public ServiceConfig()

ServiceConfig(ServiceConfig)

public ServiceConfig(ServiceConfig other)
Parameter
NameDescription
otherServiceConfig

Properties

AllTrafficOnLatestRevision

public bool AllTrafficOnLatestRevision { get; set; }

Whether 100% of traffic is routed to the latest revision. On CreateFunction and UpdateFunction, when set to true, the revision being deployed will serve 100% of traffic, ignoring any traffic split settings, if any. On GetFunction, true will be returned if the latest revision is serving 100% of traffic.

Property Value
TypeDescription
Boolean

AvailableMemory

public string AvailableMemory { get; set; }

The amount of memory available for a function. Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is supplied the value is interpreted as bytes. See https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go a full description.

Property Value
TypeDescription
String

EnvironmentVariables

public MapField<string, string> EnvironmentVariables { get; }

Environment variables that shall be available during function execution.

Property Value
TypeDescription
MapField<String, String>

IngressSettings

public ServiceConfig.Types.IngressSettings IngressSettings { get; set; }

The ingress settings for the function, controlling what traffic can reach it.

Property Value
TypeDescription
ServiceConfig.Types.IngressSettings

MaxInstanceCount

public int MaxInstanceCount { get; set; }

The limit on the maximum number of function instances that may coexist at a given time.

In some cases, such as rapid traffic surges, Cloud Functions may, for a short period of time, create more instances than the specified max instances limit. If your function cannot tolerate this temporary behavior, you may want to factor in a safety margin and set a lower max instances value than your function can tolerate.

See the Max Instances Guide for more details.

Property Value
TypeDescription
Int32

MinInstanceCount

public int MinInstanceCount { get; set; }

The limit on the minimum number of function instances that may coexist at a given time.

Function instances are kept in idle state for a short period after they finished executing the request to reduce cold start time for subsequent requests. Setting a minimum instance count will ensure that the given number of instances are kept running in idle state always. This can help with cold start times when jump in incoming request count occurs after the idle instance would have been stopped in the default case.

Property Value
TypeDescription
Int32

Revision

public string Revision { get; set; }

Output only. The name of service revision.

Property Value
TypeDescription
String

SecretEnvironmentVariables

public RepeatedField<SecretEnvVar> SecretEnvironmentVariables { get; }

Secret environment variables configuration.

Property Value
TypeDescription
RepeatedField<SecretEnvVar>

SecretVolumes

public RepeatedField<SecretVolume> SecretVolumes { get; }

Secret volumes configuration.

Property Value
TypeDescription
RepeatedField<SecretVolume>

Service

public string Service { get; set; }

Output only. Name of the service associated with a Function. The format of this field is projects/{project}/locations/{region}/services/{service}

Property Value
TypeDescription
String

ServiceAccountEmail

public string ServiceAccountEmail { get; set; }

The email of the service's service account. If empty, defaults to {project_number}-compute@developer.gserviceaccount.com.

Property Value
TypeDescription
String

ServiceAsServiceName

public ServiceName ServiceAsServiceName { get; set; }

ServiceName-typed view over the Service resource name property.

Property Value
TypeDescription
ServiceName

TimeoutSeconds

public int TimeoutSeconds { get; set; }

The function execution timeout. Execution is considered failed and can be terminated if the function is not completed at the end of the timeout period. Defaults to 60 seconds.

Property Value
TypeDescription
Int32

Uri

public string Uri { get; set; }

Output only. URI of the Service deployed.

Property Value
TypeDescription
String

VpcConnector

public string VpcConnector { get; set; }

The Serverless VPC Access connector that this cloud function can connect to. The format of this field is projects/*/locations/*/connectors/*.

Property Value
TypeDescription
String

VpcConnectorAsConnectorName

public ConnectorName VpcConnectorAsConnectorName { get; set; }

ConnectorName-typed view over the VpcConnector resource name property.

Property Value
TypeDescription
ConnectorName

VpcConnectorEgressSettings

public ServiceConfig.Types.VpcConnectorEgressSettings VpcConnectorEgressSettings { get; set; }

The egress settings for the connector, controlling what traffic is diverted through it.

Property Value
TypeDescription
ServiceConfig.Types.VpcConnectorEgressSettings