@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
1,120 lines • 36.8 kB
JavaScript
"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.RegionUrlMap = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* 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.
*
* ## Example Usage
*
* ### Region Url Map Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.compute.RegionHealthCheck("default", {
* region: "us-central1",
* name: "health-check",
* checkIntervalSec: 1,
* timeoutSec: 1,
* httpHealthCheck: {
* port: 80,
* requestPath: "/",
* },
* });
* const login = new gcp.compute.RegionBackendService("login", {
* region: "us-central1",
* name: "login",
* protocol: "HTTP",
* loadBalancingScheme: "INTERNAL_MANAGED",
* timeoutSec: 10,
* healthChecks: _default.id,
* });
* const home = new gcp.compute.RegionBackendService("home", {
* region: "us-central1",
* name: "home",
* protocol: "HTTP",
* loadBalancingScheme: "INTERNAL_MANAGED",
* timeoutSec: 10,
* healthChecks: _default.id,
* });
* const regionurlmap = new gcp.compute.RegionUrlMap("regionurlmap", {
* region: "us-central1",
* name: "regionurlmap",
* description: "a description",
* defaultService: home.id,
* hostRules: [{
* hosts: ["mysite.com"],
* pathMatcher: "allpaths",
* }],
* pathMatchers: [{
* name: "allpaths",
* defaultService: home.id,
* pathRules: [
* {
* paths: ["/home"],
* service: home.id,
* },
* {
* paths: ["/login"],
* service: login.id,
* },
* ],
* }],
* tests: [{
* service: home.id,
* host: "hi.com",
* path: "/home",
* }],
* });
* ```
* ### Region Url Map Default Route Action
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.compute.RegionHealthCheck("default", {
* region: "us-central1",
* name: "health-check",
* checkIntervalSec: 1,
* timeoutSec: 1,
* httpHealthCheck: {
* port: 80,
* requestPath: "/",
* },
* });
* const login = new gcp.compute.RegionBackendService("login", {
* region: "us-central1",
* name: "login",
* protocol: "HTTP",
* loadBalancingScheme: "INTERNAL_MANAGED",
* timeoutSec: 10,
* healthChecks: _default.id,
* });
* const home = new gcp.compute.RegionBackendService("home", {
* region: "us-central1",
* name: "home",
* protocol: "HTTP",
* loadBalancingScheme: "INTERNAL_MANAGED",
* timeoutSec: 10,
* healthChecks: _default.id,
* });
* const regionurlmap = new gcp.compute.RegionUrlMap("regionurlmap", {
* region: "us-central1",
* name: "regionurlmap",
* description: "a description",
* defaultRouteAction: {
* retryPolicy: {
* retryConditions: [
* "5xx",
* "gateway-error",
* ],
* numRetries: 3,
* perTryTimeout: {
* seconds: "0",
* nanos: 500,
* },
* },
* requestMirrorPolicy: {
* backendService: home.id,
* },
* weightedBackendServices: [
* {
* backendService: login.id,
* weight: 200,
* headerAction: {
* requestHeadersToAdds: [{
* headerName: "foo-request-1",
* headerValue: "bar",
* replace: true,
* }],
* requestHeadersToRemoves: ["fizz"],
* responseHeadersToAdds: [{
* headerName: "foo-response-1",
* headerValue: "bar",
* replace: true,
* }],
* responseHeadersToRemoves: ["buzz"],
* },
* },
* {
* backendService: home.id,
* weight: 100,
* headerAction: {
* requestHeadersToAdds: [
* {
* headerName: "foo-request-1",
* headerValue: "bar",
* replace: true,
* },
* {
* headerName: "foo-request-2",
* headerValue: "bar",
* replace: true,
* },
* ],
* requestHeadersToRemoves: ["fizz"],
* responseHeadersToAdds: [
* {
* headerName: "foo-response-2",
* headerValue: "bar",
* replace: true,
* },
* {
* headerName: "foo-response-1",
* headerValue: "bar",
* replace: true,
* },
* ],
* responseHeadersToRemoves: ["buzz"],
* },
* },
* ],
* urlRewrite: {
* hostRewrite: "dev.example.com",
* pathPrefixRewrite: "/v1/api/",
* },
* corsPolicy: {
* disabled: false,
* allowCredentials: true,
* allowHeaders: ["foobar"],
* allowMethods: [
* "GET",
* "POST",
* ],
* allowOrigins: ["example.com"],
* exposeHeaders: ["foobar"],
* maxAge: 60,
* },
* faultInjectionPolicy: {
* delay: {
* fixedDelay: {
* seconds: "0",
* nanos: 500,
* },
* percentage: 0.5,
* },
* abort: {
* httpStatus: 500,
* percentage: 0.5,
* },
* },
* timeout: {
* seconds: "0",
* nanos: 500,
* },
* },
* hostRules: [{
* hosts: ["mysite.com"],
* pathMatcher: "allpaths",
* }],
* pathMatchers: [{
* name: "allpaths",
* defaultService: home.id,
* pathRules: [
* {
* paths: ["/home"],
* service: home.id,
* },
* {
* paths: ["/login"],
* service: login.id,
* },
* ],
* }],
* tests: [{
* service: home.id,
* host: "hi.com",
* path: "/home",
* }],
* });
* ```
* ### Region Url Map L7 Ilb Path
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.compute.RegionHealthCheck("default", {
* name: "health-check",
* httpHealthCheck: {
* port: 80,
* },
* });
* const home = new gcp.compute.RegionBackendService("home", {
* name: "home",
* protocol: "HTTP",
* timeoutSec: 10,
* healthChecks: _default.id,
* loadBalancingScheme: "INTERNAL_MANAGED",
* });
* const regionurlmap = new gcp.compute.RegionUrlMap("regionurlmap", {
* name: "regionurlmap",
* description: "a description",
* defaultService: home.id,
* hostRules: [{
* hosts: ["mysite.com"],
* pathMatcher: "allpaths",
* }],
* pathMatchers: [{
* name: "allpaths",
* defaultService: home.id,
* pathRules: [{
* paths: ["/home"],
* routeAction: {
* corsPolicy: {
* allowCredentials: true,
* allowHeaders: ["Allowed content"],
* allowMethods: ["GET"],
* allowOrigins: ["Allowed origin"],
* exposeHeaders: ["Exposed header"],
* maxAge: 30,
* disabled: false,
* },
* faultInjectionPolicy: {
* abort: {
* httpStatus: 234,
* percentage: 5.6,
* },
* delay: {
* fixedDelay: {
* seconds: "0",
* nanos: 50000,
* },
* percentage: 7.8,
* },
* },
* requestMirrorPolicy: {
* backendService: home.id,
* },
* retryPolicy: {
* numRetries: 4,
* perTryTimeout: {
* seconds: "30",
* },
* retryConditions: [
* "5xx",
* "deadline-exceeded",
* ],
* },
* timeout: {
* seconds: "20",
* nanos: 750000000,
* },
* urlRewrite: {
* hostRewrite: "dev.example.com",
* pathPrefixRewrite: "/v1/api/",
* },
* weightedBackendServices: [{
* backendService: home.id,
* weight: 400,
* headerAction: {
* requestHeadersToRemoves: ["RemoveMe"],
* requestHeadersToAdds: [{
* headerName: "AddMe",
* headerValue: "MyValue",
* replace: true,
* }],
* responseHeadersToRemoves: ["RemoveMe"],
* responseHeadersToAdds: [{
* headerName: "AddMe",
* headerValue: "MyValue",
* replace: false,
* }],
* },
* }],
* },
* }],
* }],
* tests: [{
* service: home.id,
* host: "hi.com",
* path: "/home",
* }],
* });
* ```
* ### Region Url Map L7 Ilb Path Partial
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.compute.RegionHealthCheck("default", {
* name: "health-check",
* httpHealthCheck: {
* port: 80,
* },
* });
* const home = new gcp.compute.RegionBackendService("home", {
* name: "home",
* protocol: "HTTP",
* timeoutSec: 10,
* healthChecks: _default.id,
* loadBalancingScheme: "INTERNAL_MANAGED",
* });
* const regionurlmap = new gcp.compute.RegionUrlMap("regionurlmap", {
* name: "regionurlmap",
* description: "a description",
* defaultService: home.id,
* hostRules: [{
* hosts: ["mysite.com"],
* pathMatcher: "allpaths",
* }],
* pathMatchers: [{
* name: "allpaths",
* defaultService: home.id,
* pathRules: [{
* paths: ["/home"],
* routeAction: {
* retryPolicy: {
* numRetries: 4,
* perTryTimeout: {
* seconds: "30",
* },
* retryConditions: [
* "5xx",
* "deadline-exceeded",
* ],
* },
* timeout: {
* seconds: "20",
* nanos: 750000000,
* },
* urlRewrite: {
* hostRewrite: "dev.example.com",
* pathPrefixRewrite: "/v1/api/",
* },
* weightedBackendServices: [{
* backendService: home.id,
* weight: 400,
* headerAction: {
* responseHeadersToAdds: [{
* headerName: "AddMe",
* headerValue: "MyValue",
* replace: false,
* }],
* },
* }],
* },
* }],
* }],
* tests: [{
* service: home.id,
* host: "hi.com",
* path: "/home",
* }],
* });
* ```
* ### Region Url Map L7 Ilb Route
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.compute.RegionHealthCheck("default", {
* name: "health-check",
* httpHealthCheck: {
* port: 80,
* },
* });
* const home = new gcp.compute.RegionBackendService("home", {
* name: "home",
* protocol: "HTTP",
* timeoutSec: 10,
* healthChecks: _default.id,
* loadBalancingScheme: "INTERNAL_MANAGED",
* });
* const regionurlmap = new gcp.compute.RegionUrlMap("regionurlmap", {
* name: "regionurlmap",
* description: "a description",
* defaultService: home.id,
* hostRules: [{
* hosts: ["mysite.com"],
* pathMatcher: "allpaths",
* }],
* pathMatchers: [{
* name: "allpaths",
* defaultService: home.id,
* routeRules: [{
* priority: 1,
* headerAction: {
* requestHeadersToRemoves: ["RemoveMe2"],
* requestHeadersToAdds: [{
* headerName: "AddSomethingElse",
* headerValue: "MyOtherValue",
* replace: true,
* }],
* responseHeadersToRemoves: ["RemoveMe3"],
* responseHeadersToAdds: [{
* headerName: "AddMe",
* headerValue: "MyValue",
* replace: false,
* }],
* },
* matchRules: [{
* fullPathMatch: "a full path",
* headerMatches: [{
* headerName: "someheader",
* exactMatch: "match this exactly",
* invertMatch: true,
* }],
* ignoreCase: true,
* metadataFilters: [{
* filterMatchCriteria: "MATCH_ANY",
* filterLabels: [{
* name: "PLANET",
* value: "MARS",
* }],
* }],
* queryParameterMatches: [{
* name: "a query parameter",
* presentMatch: true,
* }],
* }],
* urlRedirect: {
* hostRedirect: "A host",
* httpsRedirect: false,
* pathRedirect: "some/path",
* redirectResponseCode: "TEMPORARY_REDIRECT",
* stripQuery: true,
* },
* }],
* }],
* tests: [{
* service: home.id,
* host: "hi.com",
* path: "/home",
* }],
* });
* ```
* ### Region Url Map L7 Ilb Route Partial
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.compute.RegionHealthCheck("default", {
* name: "health-check",
* httpHealthCheck: {
* port: 80,
* },
* });
* const home = new gcp.compute.RegionBackendService("home", {
* name: "home",
* protocol: "HTTP",
* timeoutSec: 10,
* healthChecks: _default.id,
* loadBalancingScheme: "INTERNAL_MANAGED",
* });
* const regionurlmap = new gcp.compute.RegionUrlMap("regionurlmap", {
* name: "regionurlmap",
* description: "a description",
* defaultService: home.id,
* hostRules: [{
* hosts: ["mysite.com"],
* pathMatcher: "allpaths",
* }],
* pathMatchers: [{
* name: "allpaths",
* defaultService: home.id,
* routeRules: [{
* priority: 1,
* service: home.id,
* headerAction: {
* requestHeadersToRemoves: ["RemoveMe2"],
* },
* matchRules: [{
* fullPathMatch: "a full path",
* headerMatches: [{
* headerName: "someheader",
* exactMatch: "match this exactly",
* invertMatch: true,
* }],
* queryParameterMatches: [{
* name: "a query parameter",
* presentMatch: true,
* }],
* }],
* }],
* }],
* tests: [{
* service: home.id,
* host: "hi.com",
* path: "/home",
* }],
* });
* ```
* ### Region Url Map Path Template Match
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.compute.RegionHealthCheck("default", {
* region: "us-central1",
* name: "health-check",
* checkIntervalSec: 1,
* timeoutSec: 1,
* httpHealthCheck: {
* port: 80,
* requestPath: "/",
* },
* });
* const home_backend = new gcp.compute.RegionBackendService("home-backend", {
* region: "us-central1",
* name: "home-service",
* portName: "http",
* protocol: "HTTP",
* timeoutSec: 10,
* loadBalancingScheme: "EXTERNAL_MANAGED",
* healthChecks: _default.id,
* });
* const cart_backend = new gcp.compute.RegionBackendService("cart-backend", {
* region: "us-central1",
* name: "cart-service",
* portName: "http",
* protocol: "HTTP",
* timeoutSec: 10,
* loadBalancingScheme: "EXTERNAL_MANAGED",
* healthChecks: _default.id,
* });
* const user_backend = new gcp.compute.RegionBackendService("user-backend", {
* region: "us-central1",
* name: "user-service",
* portName: "http",
* protocol: "HTTP",
* timeoutSec: 10,
* loadBalancingScheme: "EXTERNAL_MANAGED",
* healthChecks: _default.id,
* });
* const urlmap = new gcp.compute.RegionUrlMap("urlmap", {
* region: "us-central1",
* name: "urlmap",
* description: "a description",
* defaultService: home_backend.id,
* hostRules: [{
* hosts: ["mysite.com"],
* pathMatcher: "mysite",
* }],
* pathMatchers: [{
* name: "mysite",
* defaultService: home_backend.id,
* routeRules: [
* {
* matchRules: [{
* pathTemplateMatch: "/xyzwebservices/v2/xyz/users/{username=*}/carts/{cartid=**}",
* }],
* service: cart_backend.id,
* priority: 1,
* routeAction: {
* urlRewrite: {
* pathTemplateRewrite: "/{username}-{cartid}/",
* },
* },
* },
* {
* matchRules: [{
* pathTemplateMatch: "/xyzwebservices/v2/xyz/users/*/accountinfo/*",
* }],
* service: user_backend.id,
* priority: 2,
* },
* ],
* }],
* });
* ```
* ### Region Url Map Path Matcher Default Route Action
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.compute.RegionHealthCheck("default", {
* region: "us-central1",
* name: "health-check",
* checkIntervalSec: 1,
* timeoutSec: 1,
* httpHealthCheck: {
* port: 80,
* requestPath: "/",
* },
* });
* const login = new gcp.compute.RegionBackendService("login", {
* region: "us-central1",
* name: "login",
* protocol: "HTTP",
* loadBalancingScheme: "INTERNAL_MANAGED",
* timeoutSec: 10,
* healthChecks: _default.id,
* });
* const home = new gcp.compute.RegionBackendService("home", {
* region: "us-central1",
* name: "home",
* protocol: "HTTP",
* loadBalancingScheme: "INTERNAL_MANAGED",
* timeoutSec: 10,
* healthChecks: _default.id,
* });
* const regionurlmap = new gcp.compute.RegionUrlMap("regionurlmap", {
* region: "us-central1",
* name: "regionurlmap",
* description: "a description",
* defaultService: home.id,
* hostRules: [{
* hosts: ["mysite.com"],
* pathMatcher: "allpaths",
* }],
* pathMatchers: [{
* name: "allpaths",
* defaultRouteAction: {
* corsPolicy: {
* disabled: false,
* allowCredentials: true,
* allowHeaders: ["foobar"],
* allowMethods: [
* "GET",
* "POST",
* ],
* allowOrigins: ["example.com"],
* exposeHeaders: ["foobar"],
* maxAge: 60,
* },
* faultInjectionPolicy: {
* abort: {
* httpStatus: 500,
* percentage: 0.5,
* },
* delay: {
* fixedDelay: {
* nanos: 500,
* seconds: "0",
* },
* percentage: 0.5,
* },
* },
* requestMirrorPolicy: {
* backendService: home.id,
* },
* retryPolicy: {
* numRetries: 3,
* perTryTimeout: {
* nanos: 500,
* seconds: "0",
* },
* retryConditions: [
* "5xx",
* "gateway-error",
* ],
* },
* timeout: {
* nanos: 500,
* seconds: "0",
* },
* urlRewrite: {
* hostRewrite: "dev.example.com",
* pathPrefixRewrite: "/v1/api/",
* },
* weightedBackendServices: [
* {
* backendService: home.id,
* headerAction: {
* requestHeadersToAdds: [
* {
* headerName: "foo-request-1",
* headerValue: "bar",
* replace: true,
* },
* {
* headerName: "foo-request-2",
* headerValue: "bar",
* replace: true,
* },
* ],
* requestHeadersToRemoves: ["fizz"],
* responseHeadersToAdds: [
* {
* headerName: "foo-response-1",
* headerValue: "bar",
* replace: true,
* },
* {
* headerName: "foo-response-2",
* headerValue: "bar",
* replace: true,
* },
* ],
* responseHeadersToRemoves: ["buzz"],
* },
* weight: 100,
* },
* {
* backendService: login.id,
* headerAction: {
* requestHeadersToAdds: [
* {
* headerName: "foo-request-1",
* headerValue: "bar",
* replace: true,
* },
* {
* headerName: "foo-request-2",
* headerValue: "bar",
* replace: true,
* },
* ],
* requestHeadersToRemoves: ["fizz"],
* responseHeadersToAdds: [
* {
* headerName: "foo-response-1",
* headerValue: "bar",
* replace: true,
* },
* {
* headerName: "foo-response-2",
* headerValue: "bar",
* replace: true,
* },
* ],
* responseHeadersToRemoves: ["buzz"],
* },
* weight: 200,
* },
* ],
* },
* pathRules: [
* {
* paths: ["/home"],
* service: home.id,
* },
* {
* paths: ["/login"],
* service: login.id,
* },
* ],
* }],
* tests: [{
* service: home.id,
* host: "hi.com",
* path: "/home",
* }],
* });
* ```
* ### Region Url Map Default Mirror Percent
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.compute.RegionHealthCheck("default", {
* region: "us-central1",
* name: "health-check",
* httpHealthCheck: {
* port: 80,
* },
* });
* const home = new gcp.compute.RegionBackendService("home", {
* region: "us-central1",
* name: "home",
* portName: "http",
* protocol: "HTTP",
* timeoutSec: 10,
* loadBalancingScheme: "INTERNAL_MANAGED",
* healthChecks: _default.id,
* });
* const mirror = new gcp.compute.RegionBackendService("mirror", {
* region: "us-central1",
* name: "mirror",
* portName: "http",
* protocol: "HTTP",
* timeoutSec: 10,
* loadBalancingScheme: "INTERNAL_MANAGED",
* healthChecks: _default.id,
* });
* const regionurlmap = new gcp.compute.RegionUrlMap("regionurlmap", {
* region: "us-central1",
* name: "regionurlmap",
* description: "Test for default route action mirror percent",
* defaultService: home.id,
* defaultRouteAction: {
* requestMirrorPolicy: {
* backendService: mirror.id,
* mirrorPercent: 50,
* },
* },
* hostRules: [{
* hosts: ["mysite.com"],
* pathMatcher: "allpaths",
* }],
* pathMatchers: [{
* name: "allpaths",
* defaultService: home.id,
* }],
* });
* ```
* ### Region Url Map Path Matcher Default Mirror Percent
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.compute.RegionHealthCheck("default", {
* region: "us-central1",
* name: "health-check",
* httpHealthCheck: {
* port: 80,
* },
* });
* const home = new gcp.compute.RegionBackendService("home", {
* region: "us-central1",
* name: "home",
* portName: "http",
* protocol: "HTTP",
* timeoutSec: 10,
* loadBalancingScheme: "INTERNAL_MANAGED",
* healthChecks: _default.id,
* });
* const mirror = new gcp.compute.RegionBackendService("mirror", {
* region: "us-central1",
* name: "mirror",
* portName: "http",
* protocol: "HTTP",
* timeoutSec: 10,
* loadBalancingScheme: "INTERNAL_MANAGED",
* healthChecks: _default.id,
* });
* const regionurlmap = new gcp.compute.RegionUrlMap("regionurlmap", {
* region: "us-central1",
* name: "regionurlmap",
* description: "Test for default route action mirror percent",
* defaultService: home.id,
* defaultRouteAction: {
* requestMirrorPolicy: {
* backendService: mirror.id,
* mirrorPercent: 50,
* },
* },
* hostRules: [{
* hosts: ["mysite.com"],
* pathMatcher: "allpaths",
* }],
* pathMatchers: [{
* name: "allpaths",
* defaultService: home.id,
* }],
* });
* ```
* ### Region Url Map Path Rule Mirror Percent
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.compute.RegionHealthCheck("default", {
* region: "us-central1",
* name: "health-check",
* httpHealthCheck: {
* port: 80,
* },
* });
* const home = new gcp.compute.RegionBackendService("home", {
* region: "us-central1",
* name: "home",
* portName: "http",
* protocol: "HTTP",
* timeoutSec: 10,
* loadBalancingScheme: "INTERNAL_MANAGED",
* healthChecks: _default.id,
* });
* const mirror = new gcp.compute.RegionBackendService("mirror", {
* region: "us-central1",
* name: "mirror",
* portName: "http",
* protocol: "HTTP",
* timeoutSec: 10,
* loadBalancingScheme: "INTERNAL_MANAGED",
* healthChecks: _default.id,
* });
* const regionurlmap = new gcp.compute.RegionUrlMap("regionurlmap", {
* region: "us-central1",
* name: "regionurlmap",
* description: "Test for path matcher default route action mirror percent",
* defaultService: home.id,
* hostRules: [{
* hosts: ["mysite.com"],
* pathMatcher: "allpaths",
* }],
* pathMatchers: [{
* name: "allpaths",
* defaultService: home.id,
* defaultRouteAction: {
* requestMirrorPolicy: {
* backendService: mirror.id,
* mirrorPercent: 75,
* },
* },
* }],
* });
* ```
* ### Region Url Map Route Rule Mirror Percent
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.compute.RegionHealthCheck("default", {
* region: "us-central1",
* name: "health-check",
* httpHealthCheck: {
* port: 80,
* },
* });
* const home = new gcp.compute.RegionBackendService("home", {
* region: "us-central1",
* name: "home",
* portName: "http",
* protocol: "HTTP",
* timeoutSec: 10,
* loadBalancingScheme: "INTERNAL_MANAGED",
* healthChecks: _default.id,
* });
* const mirror = new gcp.compute.RegionBackendService("mirror", {
* region: "us-central1",
* name: "mirror",
* portName: "http",
* protocol: "HTTP",
* timeoutSec: 10,
* loadBalancingScheme: "INTERNAL_MANAGED",
* healthChecks: _default.id,
* });
* const regionurlmap = new gcp.compute.RegionUrlMap("regionurlmap", {
* region: "us-central1",
* name: "regionurlmap",
* description: "Test for path rule route action mirror percent",
* defaultService: home.id,
* hostRules: [{
* hosts: ["mysite.com"],
* pathMatcher: "allpaths",
* }],
* pathMatchers: [{
* name: "allpaths",
* defaultService: home.id,
* pathRules: [{
* paths: ["/home"],
* service: home.id,
* routeAction: {
* requestMirrorPolicy: {
* backendService: mirror.id,
* mirrorPercent: 25,
* },
* },
* }],
* }],
* });
* ```
*
* ## Import
*
* RegionUrlMap can be imported using any of these accepted formats:
*
* * `projects/{{project}}/regions/{{region}}/urlMaps/{{name}}`
*
* * `{{project}}/{{region}}/{{name}}`
*
* * `{{region}}/{{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, RegionUrlMap can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/regionUrlMap:RegionUrlMap default projects/{{project}}/regions/{{region}}/urlMaps/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/regionUrlMap:RegionUrlMap default {{project}}/{{region}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/regionUrlMap:RegionUrlMap default {{region}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/regionUrlMap:RegionUrlMap default {{name}}
* ```
*/
class RegionUrlMap extends pulumi.CustomResource {
/**
* Get an existing RegionUrlMap resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new RegionUrlMap(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of RegionUrlMap. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === RegionUrlMap.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["creationTimestamp"] = state?.creationTimestamp;
resourceInputs["defaultRouteAction"] = state?.defaultRouteAction;
resourceInputs["defaultService"] = state?.defaultService;
resourceInputs["defaultUrlRedirect"] = state?.defaultUrlRedirect;
resourceInputs["description"] = state?.description;
resourceInputs["fingerprint"] = state?.fingerprint;
resourceInputs["headerAction"] = state?.headerAction;
resourceInputs["hostRules"] = state?.hostRules;
resourceInputs["mapId"] = state?.mapId;
resourceInputs["name"] = state?.name;
resourceInputs["pathMatchers"] = state?.pathMatchers;
resourceInputs["project"] = state?.project;
resourceInputs["region"] = state?.region;
resourceInputs["selfLink"] = state?.selfLink;
resourceInputs["tests"] = state?.tests;
}
else {
const args = argsOrState;
resourceInputs["defaultRouteAction"] = args?.defaultRouteAction;
resourceInputs["defaultService"] = args?.defaultService;
resourceInputs["defaultUrlRedirect"] = args?.defaultUrlRedirect;
resourceInputs["description"] = args?.description;
resourceInputs["headerAction"] = args?.headerAction;
resourceInputs["hostRules"] = args?.hostRules;
resourceInputs["name"] = args?.name;
resourceInputs["pathMatchers"] = args?.pathMatchers;
resourceInputs["project"] = args?.project;
resourceInputs["region"] = args?.region;
resourceInputs["tests"] = args?.tests;
resourceInputs["creationTimestamp"] = undefined /*out*/;
resourceInputs["fingerprint"] = undefined /*out*/;
resourceInputs["mapId"] = undefined /*out*/;
resourceInputs["selfLink"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RegionUrlMap.__pulumiType, name, resourceInputs, opts);
}
}
exports.RegionUrlMap = RegionUrlMap;
/** @internal */
RegionUrlMap.__pulumiType = 'gcp:compute/regionUrlMap:RegionUrlMap';
//# sourceMappingURL=regionUrlMap.js.map