GoogleComputeRegionBackendService class final
Factory wrapper for google_compute_region_backend_service (provider
hashicorp/google ~> 7.0).
A regional backend service is the load-balancing target for
Internal Application LBs, Internal Proxy NLBs, Regional External
Application LBs, Regional External Proxy NLBs, and Internal /
External Passthrough Network LBs. It groups a set of backends
(instance groups or network endpoint groups) inside a single GCP
region and routes traffic to them according to the configured
protocol, loadBalancingScheme, localityLbPolicy, and
sessionAffinity.
For globally-scoped load balancing use google_compute_backend_service
(curated separately). The regional resource accepts INTERNAL and
INTERNAL_MANAGED schemes that the global resource will reject at
apply time, and it also surfaces a handful of regional-only blocks:
ComputeRegionBackendServiceRegionBackendServiceFailoverPolicy (Internal Passthrough NLB
failover), ComputeRegionBackendServiceRegionBackendServiceHaPolicy (self-managed HA for
Passthrough NLBs), and
ComputeRegionBackendServiceRegionBackendServiceNetworkPassThroughLbTrafficPolicy (zonal
affinity for Internal Passthrough NLBs). It does not support the
global-only blocks locality_lb_policies, security_settings, or
max_stream_duration, nor the global-only compression_mode,
custom_request_headers, custom_response_headers,
edge_security_policy, or service_lb_policy attributes.
Required identity:
localName: Terraform local name (the address segment aftergoogle_compute_region_backend_service.).name: GCP resource name (1-63 chars, lowercase RFC1035).region: GCP region. The Terraform schema lists this as optional+computed (the provider falls back to the provider-level region), but it is wrapped as required here to keep cross-region composition explicit.
Cross-resource references (typical wiring):
healthChecks: list of self-links togoogle_compute_health_checkorgoogle_compute_region_health_checkresources. Required unless every backend is an internet/serverless NEG, or the resource uses ComputeRegionBackendServiceRegionBackendServiceHaPolicy (HA-managed services cannot coexist with health checks).securityPolicy: self-link to a regional Cloud Armorgoogle_compute_region_security_policy. Regional Cloud Armor support is restricted to certainload_balancing_schemevalues (notably the regional managed schemes); the API rejects incompatible combinations at apply time.- ComputeRegionBackendServiceRegionBackendServiceBackend.group: self-link of an instance
group, regional MIG, or
region_network_endpoint_group. All backends in one service must share a kind (no mixing instance groups with NEGs). network: self-link of agoogle_compute_network. Required for Internal Passthrough NLBs when ComputeRegionBackendServiceRegionBackendServiceHaPolicy is set, and for External Passthrough NLBs whenhaPolicy.fastIpMoveis enabled. Only settable whenloadBalancingSchemeisINTERNAL, orEXTERNALwithhaPolicy.fastIpMove.
Example (internal application LB backend, IAP-protected):
final api = GoogleComputeRegionBackendService(
localName: 'api',
name: TfArg.literal('api-rbs'),
region: TfArg.literal('asia-northeast1'),
protocol: TfArg.literal(RegionBackendServiceProtocol.https),
loadBalancingScheme:
TfArg.literal(RegionBackendServiceLoadBalancingScheme.internalManaged),
portName: TfArg.literal('https'),
timeoutSec: TfArg.literal(30),
healthChecks: TfArg.literal([
// From Batch 2: either `google_compute_health_check` or
// `google_compute_region_health_check` is acceptable.
'projects/p/regions/asia-northeast1/healthChecks/api-hc',
]),
securityPolicy: TfArg.literal(
// var.security_policy_id — see Batch 4 regional Cloud Armor.
'projects/p/regions/asia-northeast1/securityPolicies/edge-deny-all',
),
backends: [
ComputeRegionBackendServiceRegionBackendServiceBackend(
group: TfArg.literal(
// var.backend_group_id — typically a Batch 4 regional NEG
// or a Batch 3 regional MIG self-link.
'projects/p/regions/asia-northeast1/networkEndpointGroups/api-rneg',
),
balancingMode: RegionBackendServiceBalancingMode.rate,
maxRatePerEndpoint: 100,
capacityScaler: 1.0,
),
],
iap: const ComputeRegionBackendServiceRegionBackendServiceIap(
enabled: true,
oauth2ClientId: 'xxx.apps.googleusercontent.com',
oauth2ClientSecret: 'super-secret', // sensitive — masked at synth.
),
logConfig: const ComputeRegionBackendServiceRegionBackendServiceLogConfig(
enable: true,
sampleRate: 1.0,
),
);
Sensitive fields (round-trip through the generated sensitiveFields
set): iap.oauth2_client_secret and the computed
iap.oauth2_client_secret_sha256 (provider-side detail). The global
security_settings.aws_v4_authentication.access_key is not
present on the regional resource — security_settings has no
regional analog.
Constructors
-
GoogleComputeRegionBackendService({required String localName, required TfArg<
String> name, TfArg<String> ? region, TfArg<String> ? description, TfArg<RegionBackendServiceProtocol> ? protocol, TfArg<String> ? portName, TfArg<RegionBackendServiceLoadBalancingScheme> ? loadBalancingScheme, TfArg<RegionBackendServiceLocalityLbPolicy> ? localityLbPolicy, TfArg<RegionBackendServiceSessionAffinity> ? sessionAffinity, TfArg<num> ? affinityCookieTtlSec, TfArg<num> ? timeoutSec, TfArg<num> ? connectionDrainingTimeoutSec, TfArg<bool> ? enableCdn, TfArg<RegionBackendServiceIpAddressSelectionPolicy> ? ipAddressSelectionPolicy, TfArg<String> ? network, TfArg<List< ? healthChecks, TfArg<String> >String> ? securityPolicy, List<ComputeRegionBackendServiceRegionBackendServiceBackend> ? backends, ComputeRegionBackendServiceRegionBackendServiceCdnPolicy? cdnPolicy, ComputeRegionBackendServiceRegionBackendServiceIap? iap, ComputeRegionBackendServiceRegionBackendServiceCircuitBreakers? circuitBreakers, ComputeRegionBackendServiceRegionBackendServiceConsistentHash? consistentHash, ComputeRegionBackendServiceRegionBackendServiceOutlierDetection? outlierDetection, ComputeRegionBackendServiceRegionBackendServiceLogConfig? logConfig, List<ComputeRegionBackendServiceRegionBackendServiceCustomMetric> ? customMetrics, ComputeRegionBackendServiceRegionBackendServiceStrongSessionAffinityCookie? strongSessionAffinityCookie, ComputeRegionBackendServiceRegionBackendServiceFailoverPolicy? failoverPolicy, ComputeRegionBackendServiceRegionBackendServiceHaPolicy? haPolicy, ComputeRegionBackendServiceRegionBackendServiceNetworkPassThroughLbTrafficPolicy? networkPassThroughLbTrafficPolicy, ComputeRegionBackendServiceRegionBackendServiceTlsSettings? tlsSettings, ComputeRegionBackendServiceRegionBackendServiceParams? params, TfArg<String> ? project, LifecycleOptions? lifecycle, List<DependencyTarget> ? dependsOn})
Properties
-
argMap
→ Map<
String, TfArg?> -
Argument-name → TfArg map. Keys are snake_case (Terraform JSON name).
Synth emits these keys directly; the factory is responsible for the
camelCase → snake_case translation at construction time.
finalinherited
-
creationTimestamp
→ TfRef<
String> -
Reference to
creation_timestamp(RFC3339).no setter -
dependsOn
→ List<
DependencyTarget> ? -
Optional
depends_on = [...]. Each entry is aDependencyTarget— either a wholesale resource (rendered as bare address) or an explicitTfRef(rendered viabareAddress).finalinherited -
fingerprint
→ TfRef<
String> -
Reference to
fingerprint— used by the API for optimistic locking.no setter -
generatedId
→ TfRef<
int> -
Reference to the server-assigned numeric
generated_id.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
-
id
→ TfRef<
String> -
Reference to
idattribute (projects/{project}/regions/{region}/backendServices/{name}).no setter - kind → ResourceKind
-
Always
ResourceKind.resource. Overridden byData.no setterinherited - lifecycle → LifecycleOptions?
-
Optional
lifecycle { ... }block.finalinherited - localName → String
-
User-supplied local name within a Stack.
finalinherited
-
nameRef
→ TfRef<
String> -
Reference to
nameattribute.no setter - provider → ProviderBinding?
-
Optional explicit provider binding. Only the type is referenced here;
the concrete
Providerclass lives interradart_google(provider classes are defined per-provider, outside the core runtime).finalinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selfLink
→ TfRef<
String> -
Reference to
self_linkattribute (HTTPS API path). The canonical reference downstreamgoogle_compute_region_url_map/google_compute_region_target_*_proxyresources expect.no setter -
sensitiveFields
→ Set<
String> -
Field names that are
@Sensitiveper the IR-derived per-resource constant. Curated factories override with a baked-instatic const Set<String>(file-private in v0.5+).no setter - supportsDeletionProtection → bool
-
Capability flag: true when this resource's underlying Terraform
schema has a
deletion_protectionboolean attribute that the synth-time devMode flow can flip tofalse. Defaults to false; the codegen emitter overrides this totruefor wrappers whose schema includes the attribute.no setterinherited - terraformType → String
-
Terraform resource type, e.g.
google_pubsub_topic.finalinherited - tfAddress → String
-
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited