Skip to main content

Static Asset Route

StaticAssetRoute​

Serves static content through the public ingress.

Maps URL path prefixes on a host to a Bucket or a SiteConfig (target: CDN) behind the ingress load balancer, with Cloud CDN. The content is public: a backend bucket cannot use IAP, GCIP or identity checks (see BucketRouteConfig.authentication).

PropertyTypeDescription
apiVersionstringAPI schema version. Must be lowops.manifests.v1.
kindstringResource kind. Must be StaticAssetRoute.
metadatamapReserved keys such as name and project resolve the manifest identity and its parent ingress (PublicIngress or PrivateIngress).
specSpecUser-authored specification of the route. See Spec.

Spec​

User-defined static content routes.

Maps URL path prefixes to buckets or CDN applications. The engine adds them to the load balancer of the parent ingress.

PropertyTypeDescription
descriptionstringOptional free-text description. It does not affect provisioning.
pathslist of PathsEntryMap of URL path prefix to the content that serves it. The key is the prefix, for example / for a single-page app or /images for assets. Each path names exactly one Bucket (name) or SiteConfig (site_config). It must exist in the parent Project. See BucketRouteConfig.
apexboolServe this route at the BARE domain instead of <metadata.name>.<domain>. The engine creates an A record at the zone apex and a certificate-map entry for the bare hostname. Only one route per ingress can claim the apex, and only on an ingress that sets spec.domain. Validation enforces both rules. metadata.name must stay unique among sibling routes, but it does not appear in the host. A same-named HttpRoute or GrpcRoute stays on <metadata.name>.<ingress-domain>, so the app and its API are on different origins (CORS applies).
responseHeaderslist of stringResponse headers that the load balancer adds to every response of this route. This includes cache hits. One Name: value string per header, for example "Cache-Control: public, max-age=300". In YAML, quote the whole string: an unquoted - X-Frame-Options: DENY is a map and the engine rejects it. Use this field for headers that Cloud Storage cannot send, such as Strict-Transport-Security and Content-Security-Policy. A custom error page (not_found_page, and the /index.html fallback of a site_config path) can lack these headers. Check it with curl -I. A header named here replaces the security_headers preset header of the same name (names are case-insensitive).
securityHeadersstringNamed set of security response headers added to every response of this route. The only value is DEFAULT. Empty (the default) adds none. DEFAULT adds Strict-Transport-Security: max-age=31536000 (one year), X-Content-Type-Options: nosniff, Referrer-Policy: strict-origin-when-cross-origin, Permissions-Policy: camera=(), microphone=(), geolocation=(), payment=(), usb=(), bluetooth=() and X-Frame-Options: DENY. The HSTS header covers this host only. It does NOT include includeSubDomains or preload. To add them, set Strict-Transport-Security in response_headers. The preset sets no Content-Security-Policy. Add one in response_headers if the site needs it.

PathsEntry​

PropertyTypeDescription
keystring
valueBucketRouteConfig

BucketRouteConfig​

Target and behavior of one static path.

Serves a URL path prefix of a StaticAssetRoute from a Bucket (name) or a CDN application (site_config), with Cloud CDN. The load balancer cannot gate a bucket with IAP, GCIP or identity auth, so static paths are public.

PropertyTypeDescription
namestringName of the Bucket manifest that this path serves. Mutually exclusive with site_config: set exactly one. Must exist in the parent Project.
authenticationlist of RouteRuleAuthenticationConfigNOT ENFORCED for static (bucket-backed) paths. A bucket backend cannot use IAP, IDENTITY_PROVIDER or INTERNAL auth, so the engine ignores this field and serves the content publicly. To gate a single-page app, authenticate on the client side.
authorizationlist of ComputedAuthorizationAccessRuleCheckNOT ENFORCED for static (bucket-backed) paths. As with authentication, the engine ignores it and serves the content publicly.
siteConfigstringName of a SiteConfig manifest (a target: CDN application) whose bucket backs this path. Mutually exclusive with name: set exactly one. Must exist in the parent Project.
notFoundPagestringBucket object to serve when the bucket returns 404 (single-page-app fallback). The response keeps the URL and has status 200, not a redirect. Set it to the entry file of the app, for example /index.html or /admin/index.html. Leave it empty on a plain asset host such as /images to return real 404 errors. To keep the real 404 status, set not_found_status: 404. Defaults to /index.html for site_config targets.
notFoundStatusint32200 (the default) serves not_found_page with status 200, which suits a single-page app. 404 keeps the real 404 status, which suits a content site, because crawlers drop 404 URLs from their index. With 404, the bucket caches the error. A URL that you request just before you publish its page can answer 404 for about two minutes. It applies only if not_found_page has a value or the target is a site_config. The engine rejects it on a name path without not_found_page.

ComputedAuthorizationAccessRuleCheck​

Computed access check for a route rule.

The identity tuple (namespace, relation, object) that the authorization extension checks.

PropertyTypeDescription
namespacestringCopy of spec.authorization.namespace of the child HttpRoute or GrpcRoute manifest.
relationstringCopy of spec.authorization.relation of the child HttpRoute or GrpcRoute manifest.
objectstringCopy of spec.authorization.object of the child HttpRoute or GrpcRoute manifest.

RouteRuleAuthenticationConfig​

Authentication exceptions for a route rule.

Sets how authentication works for the paths that the rule matches.

PropertyTypeDescription
typestringIDENTITY_PROVIDER limits access to the identity providers in tenants. INTERNAL limits access to internal callers. Validation checks it against the declared identity providers.
tenantslist of stringIdentityProvider names that can access this route. Only for type IDENTITY_PROVIDER. Each entry must reference a provider that exists.