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 no hostRule / pathMatcher match 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 with defaultAction: .defaultUrlRedirect(...) -- exactly one of the two must be set when no pathMatcher entries 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.

Inheritance

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_timestamp attribute.
no setter
defaultProvider → String
The provider name a block without provider uses: by default the prefix of terraformType (google for google_pubsub_topic).
no setterinherited
defaultService → TfRef<String>
Reference to default_service attribute.
no setter
deletionPolicy → TfRef<String>
Reference to deletion_policy attribute.
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 description attribute.
no setter
fingerprint → TfRef<String>
Reference to fingerprint attribute.
no setter
hashCode → int
The hash code for this object.
no setterinherited
id → TfRef<String>
Reference to id attribute.
no setter
kind → ResourceKind
Always ResourceKind.resource. Overridden by Data.
no setterinherited
lifecycle → LifecycleOptions?
Optional lifecycle { ... } block.
finalinherited
localName → String
User-supplied local name within a Stack.
finalinherited
mapId → TfRef<num>
Reference to map_id attribute.
no setter
name → TfRef<String>
Reference to name attribute.
no setter
project → TfRef<String>
Reference to project attribute.
no setter
provider → StackProvider?
Optional Terraform provider meta-argument: the provider configuration this block uses, e.g. the aliased GoogleProvider(alias: 'eu') the Stack registered with addProvider.
finalinherited
ref → RefTo<GoogleComputeRegionUrlMap>
A reference to this resource, for arguments typed RefTo<GoogleComputeRegionUrlMap>.
no setter
region → TfRef<String>
Reference to region attribute.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
Reference to self_link attribute.
no setter
sensitiveFields → Set<String>
Field names that are @Sensitive per the IR-derived per-resource constant. Curated factories override with a baked-in static 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_protection boolean attribute that the synth-time devMode flow can flip to false. Defaults to false; the codegen emitter overrides this to true for 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, and terraform validate decides 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

Constants

tfType → const String