google::compute-url-map

Creates a global URL map.

Example

google::compute-url-map url-map-example
    name: "url-map-example"
    description: "URL map description."
    default-backend-service: $(google::compute-backend-service backend-service-example-url-map)

    host-rule
        hosts: [ "example.com" ]
        path-matcher: "abc-path"
    end

    path-matcher
        name: "abc-path"
        default-backend-service: $(google::compute-backend-service backend-service-example-url-map)
        path-rule
            backend-bucket: $(google::compute-backend-bucket backend-bucket-example)
            paths: [ "/abc" ]
        end
    end
end

Attributes

Attribute Description
name The name of the URL map. Must be 1-63 characters long, and the first character must be a lowercase letter. All other characters must be a lowercase letter, digit, or -, except the last character, which cannot be a -. (Required)
description An optional description of this URL map.
host-rule list subresource

The list of host rules to use against the URL.

description
An optional description of this host rule.
hosts list
The list of host patterns to match. They must be valid hostnames, except * will match any string of lowercase letters, numbers, -, and .. In that case, * must be the first character and must be followed in the pattern by either - or ..
path-matcher
The name of the path matcher to use to match the path portion of the URL if the host rule matches the URL’s host portion.
path-matcher list subresource

The list of named path matchers to use against the URL.

name
The name to which this path matcher is referred by the host rule.
description
An optional description of this path matcher.
default-backend-bucket
The default backend bucket resource to which traffic is directed if none of the host rules match. Conflicts with default-backend-service and default-region-backend-service.
default-backend-service
The default backend service resource to which traffic is directed if none of the host rules match. Conflicts with default-backend-bucket and default-region-backend-service.
default-region-backend-service
The default region backend service resource to which traffic is directed if none of the host rules match. Conflicts with default-backend-bucket and default-backend-service.
path-rule list subresource

The list of path rules.

backend-bucket
The backend bucket resource to which traffic is directed if this rule is matched. Conflicts with backend-service and region-backend-service.
backend-service
The backend service resource to which traffic is directed if this rule is matched. Conflicts with backend-bucket and region-backend-service.
region-backend-service
The region backend service resource to which traffic is directed if this rule is matched. Conflicts with backend-bucket and backend-service.
paths list
The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #`, and those chars are not allowed here.
default-backend-bucket The default backend bucket resource to which traffic is directed if none of the host rules match. Conflicts with default-backend-service and default-region-backend-service.
default-backend-service The default backend service resource to which traffic is directed if none of the host rules match. Conflicts with default-backend-bucket and default-region-backend-service.
default-region-backend-service The default region backend service resource to which traffic is directed if none of the host rules match. Conflicts with default-backend-bucket and default-backend-service.

Outputs

Attribute Description
self-link Server-defined URL for the resource.
fingerprint The fingerprint for the URL map, which is a hash of the contents of the resource.