GoogleComputeRegionUrlMap class final
Factory wrapper for google_compute_region_url_map.
UrlMaps are used to route requests to a backend service based on rules that you define for the host and path of an incoming URL.
Manages a regional Cloud Load Balancing URL map -- the layer that
routes incoming HTTP(S) requests to one of several
google_compute_region_backend_service (or
google_compute_backend_bucket) targets based on host + path matching.
Used by regional / internal HTTP(S) load balancers
(target_http_proxy / target_https_proxy with
loadBalancingScheme = INTERNAL_MANAGED / EXTERNAL_MANAGED). The
global URL map lives in a separate resource
(google_compute_url_map).
Required identity:
- localName: Terraform local name (the address segment after
google_compute_region_url_map.). name: GCP URL map name. 1-63 chars, RFC 1035 ([a-z]([-a-z0-9]*[a-z0-9])?).region: GCP region the URL map lives in (e.g.us-central1). Must match the region of every GoogleComputeRegionBackendService referenced from this map; cross-region backend references are rejected by the API.
Default target (highest fallback):
default_service: self-link to the backend consulted when nohostRule/pathMatchermatch the incoming request. The link accepts either a GoogleComputeRegionBackendService (.../regions/<region>/backendServices/<name>) or a GoogleComputeBackendBucket (.../backendBuckets/<name>-- backend buckets are a global resource and are also valid targets for a regional URL map). The GCP API distinguishes by URL segment, not by a separate field. Mutually exclusive withdefaultAction: .defaultUrlRedirect(...)-- exactly one of the two must be set when nopathMatcherentries are present.
Matching pipeline (request flow):
incoming request
-> match Host: header against host_rule.hosts[]
-> dispatch to path_matcher named host_rule.path_matcher
-> match path against path_matcher.path_rule[].paths[]
-> path_rule.service (specific backend)
-> OR path_rule.url_redirect
-> OR path_rule.route_action (advanced)
-> OR match against path_matcher.route_rules[]
(priority-ordered, header/query-aware)
-> fallthrough -> path_matcher.default_service
-> fallthrough -> url_map.default_service
Names referenced within a single URL map (host_rule.path_matcher ->
path_matcher.name) are LOCAL to the URL map -- they are NOT
google_compute_* resource addresses. Service links, in contrast, are
full self-links that must point at already-applied backends.
Example (login backend + static bucket, both routed via host/path, in
us-central1):
final urlMap = GoogleComputeRegionUrlMap(
'urlmap',
name: TfArg.literal('regionurlmap-prod'),
region: TfArg.literal('us-central1'),
defaultService: login.ref,
hostRule: [
ComputeRegionUrlMapHostRule(
hosts: TfArg.literal(['mysite.com', 'myothersite.com']),
pathMatcher: TfArg.literal('allpaths'),
),
],
pathMatcher: [
ComputeRegionUrlMapPathMatcher(
name: TfArg.literal('allpaths'),
defaultService: login.ref,
pathRule: [
.new(
paths: TfArg.literal(const ['/home']),
service: login.ref,
),
.new(
paths: TfArg.literal(const ['/static']),
service: staticBucket.ref,
),
],
),
],
test: [
ComputeRegionUrlMapTest(
host: TfArg.literal('mysite.com'),
path: TfArg.literal('/home'),
service: login.ref,
),
],
);
Naming convention: ALL nested helper types in this resource are prefixed
ComputeRegionUrlMap... (e.g. ComputeRegionUrlMapHostRule, ComputeRegionUrlMapPathMatcher,
ComputeRegionUrlMapDefaultUrlRedirect) to avoid colliding with the
similarly-shaped helpers in the global google_compute_url_map wrapper
(which uses the ComputeUrlMap... prefix) and with other sibling
load-balancer resources.
Traffic-policy sub-blocks (path_matcher.default_route_action,
path_rule.route_action, route_rules.route_action, ...) are typed
helpers too (e.g. ComputeRegionUrlMapPathRuleRouteAction); the top-level
default_url_redirect / default_route_action pair is the sealed
defaultAction argument (.defaultUrlRedirect(...) /
.defaultRouteAction(...)).
Composition pattern: extends Resource for
runtime behavior.
Constructors
-
GoogleComputeRegionUrlMap(String localName, {required TfArg<
String> name, TfArg<String> ? region, RefTo<GoogleComputeRegionBackendService> ? defaultService, TfArg<String> ? description, List<ComputeRegionUrlMapHostRule> ? hostRule, List<ComputeRegionUrlMapPathMatcher> ? pathMatcher, List<ComputeRegionUrlMapTest> ? test, ComputeRegionUrlMapDefaultAction? defaultAction, ComputeRegionUrlMapHeaderAction? headerAction, TfArg<String> ? project, LifecycleOptions? lifecycle, List<TfAddressed> ? dependsOn, StackProvider? provider, TfTimeouts? timeouts})
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_timestampattribute.no setter - defaultProvider → String
-
The provider name a block without provider uses: by default the
prefix of terraformType (
googleforgoogle_pubsub_topic).no setterinherited -
defaultService
→ TfRef<
String> -
Reference to
default_serviceattribute.no setter -
deletionPolicy
→ TfRef<
String> -
Reference to
deletion_policyattribute.no setter -
dependsOn
→ List<
TfAddressed> ? -
Optional
depends_on = [...]: the resources, data sources and module calls this block waits for, e.g.dependsOn: [api, ...apiDeps]. Terraform takes whole blocks only, so an entry is never an attribute.finalinherited -
description
→ TfRef<
String> -
Reference to
descriptionattribute.no setter -
fingerprint
→ TfRef<
String> -
Reference to
fingerprintattribute.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
-
id
→ TfRef<
String> -
Reference to
idattribute.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
-
mapId
→ TfRef<
num> -
Reference to
map_idattribute.no setter -
name
→ TfRef<
String> -
Reference to
nameattribute.no setter -
project
→ TfRef<
String> -
Reference to
projectattribute.no setter - provider → StackProvider?
-
Optional Terraform
providermeta-argument: the provider configuration this block uses, e.g. the aliasedGoogleProvider(alias: 'eu')the Stack registered withaddProvider.finalinherited -
ref
→ RefTo<
GoogleComputeRegionUrlMap> -
A reference to this resource, for arguments typed
RefTo<GoogleComputeRegionUrlMap>.no setter -
region
→ TfRef<
String> -
Reference to
regionattribute.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selfLink
→ TfRef<
String> -
Reference to
self_linkattribute.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 setteroverride - 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
-
Terraform address
<terraformType>.<localName>, e.g.google_pubsub_topic.orders.no setterinherited - timeouts → TfTimeouts?
-
Optional
timeouts { ... }block: how long Terraform waits for each operation. Provider-neutral like lifecycle — synth copies the duration strings verbatim, andterraform validatedecides whether this resource's schema declares the operations set here.finalinherited
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