CloudRunV2ServiceTemplate class
template block — the revision template. Required on every Cloud Run
v2 service. Holds at least one CloudRunV2ServiceServiceContainer plus optional
scaling, VPC access, volumes, etc.
- Annotations
-
- @immutable
Constructors
-
CloudRunV2ServiceTemplate({required List<
CloudRunV2ServiceServiceContainer> containers, TfArg<String> ? revision, TfArg<Map< ? labels, TfArg<String, String> >Map< ? annotations, CloudRunV2ServiceTemplateScaling? scaling, CloudRunV2ServiceVpcAccess? vpcAccess, TfArg<String, String> >String> ? timeout, TfArg<String> ? serviceAccount, TfArg<ExecutionEnvironment> ? executionEnvironment, TfArg<String> ? encryptionKey, TfArg<int> ? maxInstanceRequestConcurrency, TfArg<bool> ? sessionAffinity, TfArg<bool> ? healthCheckDisabled, TfArg<bool> ? gpuZonalRedundancyDisabled, List<CloudRunV2ServiceServiceVolume> ? volumes, CloudRunV2ServiceNodeSelector? nodeSelector}) -
const
Properties
-
annotations
→ TfArg<
Map< ?String, String> > -
Per-revision annotations. Same namespace restrictions as labels.
final
-
containers
→ List<
CloudRunV2ServiceServiceContainer> -
One or more containers (the schema allows ≥1; multiple containers
form a sidecar pattern with a single ingress container).
final
-
encryptionKey
→ TfArg<
String> ? -
CMEK key name to encrypt the revision's container image.
final
-
executionEnvironment
→ TfArg<
ExecutionEnvironment> ? -
gen1(legacy gVisor) orgen2(default; supports GCSFuse + larger CPU tiers).final -
gpuZonalRedundancyDisabled
→ TfArg<
bool> ? -
Disables GPU zonal redundancy on this revision.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
healthCheckDisabled
→ TfArg<
bool> ? -
Disables container health checks during deployment.
final
-
labels
→ TfArg<
Map< ?String, String> > -
Per-revision labels. Cloud Run v2 forbids labels with the
run.googleapis.com,cloud.googleapis.com,serving.knative.dev, orautoscaling.knative.devnamespaces.final -
maxInstanceRequestConcurrency
→ TfArg<
int> ? -
Max concurrent requests per instance. Default 80 when CPU >= 1, else 1.
final
- nodeSelector → CloudRunV2ServiceNodeSelector?
-
GPU accelerator pin. Required when the revision uses GPU CPU tiers.
final
-
revision
→ TfArg<
String> ? -
Pin the revision name. When
null, GCP auto-generates<service>-<random>-<idx>.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaling → CloudRunV2ServiceTemplateScaling?
-
Revision-level scaling (min/max instance count).
final
-
serviceAccount
→ TfArg<
String> ? -
Service account email the revision runs as. Defaults to the project
default compute SA.
final
-
sessionAffinity
→ TfArg<
bool> ? -
Whether the LB should send the same client to the same instance.
final
-
timeout
→ TfArg<
String> ? -
Per-request timeout duration ("3.5s" form). Default 5 minutes.
final
-
volumes
→ List<
CloudRunV2ServiceServiceVolume> ? -
Volumes available to all containers in the revision. Reference one
from CloudRunV2ServiceServiceContainer.volumeMounts by CloudRunV2ServiceServiceVolume.name.
final
- vpcAccess → CloudRunV2ServiceVpcAccess?
-
VPC connector or direct VPC egress configuration.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toArgMap(
) → Map< String, Object?> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited