1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. RouterRoutePolicy
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

gcp.compute.RouterRoutePolicy

Explore with Pulumi AI

A route policy created in a router

To get more information about RouterRoutePolicy, see:

Example Usage

Router Route Policy Export

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const net = new gcp.compute.Network("net", {
    name: "my-network",
    autoCreateSubnetworks: false,
});
const subnet = new gcp.compute.Subnetwork("subnet", {
    name: "my-subnetwork",
    network: net.id,
    ipCidrRange: "10.0.0.0/16",
    region: "us-central1",
});
const router = new gcp.compute.Router("router", {
    name: "my-router",
    region: subnet.region,
    network: net.id,
});
const rp_export = new gcp.compute.RouterRoutePolicy("rp-export", {
    router: router.name,
    region: router.region,
    name: "my-rp1",
    type: "ROUTE_POLICY_TYPE_EXPORT",
    terms: [{
        priority: 1,
        match: {
            expression: "destination == '10.0.0.0/12'",
        },
        actions: [{
            expression: "accept()",
        }],
    }],
});
Copy
import pulumi
import pulumi_gcp as gcp

net = gcp.compute.Network("net",
    name="my-network",
    auto_create_subnetworks=False)
subnet = gcp.compute.Subnetwork("subnet",
    name="my-subnetwork",
    network=net.id,
    ip_cidr_range="10.0.0.0/16",
    region="us-central1")
router = gcp.compute.Router("router",
    name="my-router",
    region=subnet.region,
    network=net.id)
rp_export = gcp.compute.RouterRoutePolicy("rp-export",
    router=router.name,
    region=router.region,
    name="my-rp1",
    type="ROUTE_POLICY_TYPE_EXPORT",
    terms=[{
        "priority": 1,
        "match": {
            "expression": "destination == '10.0.0.0/12'",
        },
        "actions": [{
            "expression": "accept()",
        }],
    }])
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		net, err := compute.NewNetwork(ctx, "net", &compute.NetworkArgs{
			Name:                  pulumi.String("my-network"),
			AutoCreateSubnetworks: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		subnet, err := compute.NewSubnetwork(ctx, "subnet", &compute.SubnetworkArgs{
			Name:        pulumi.String("my-subnetwork"),
			Network:     net.ID(),
			IpCidrRange: pulumi.String("10.0.0.0/16"),
			Region:      pulumi.String("us-central1"),
		})
		if err != nil {
			return err
		}
		router, err := compute.NewRouter(ctx, "router", &compute.RouterArgs{
			Name:    pulumi.String("my-router"),
			Region:  subnet.Region,
			Network: net.ID(),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewRouterRoutePolicy(ctx, "rp-export", &compute.RouterRoutePolicyArgs{
			Router: router.Name,
			Region: router.Region,
			Name:   pulumi.String("my-rp1"),
			Type:   pulumi.String("ROUTE_POLICY_TYPE_EXPORT"),
			Terms: compute.RouterRoutePolicyTermArray{
				&compute.RouterRoutePolicyTermArgs{
					Priority: pulumi.Int(1),
					Match: &compute.RouterRoutePolicyTermMatchArgs{
						Expression: pulumi.String("destination == '10.0.0.0/12'"),
					},
					Actions: compute.RouterRoutePolicyTermActionArray{
						&compute.RouterRoutePolicyTermActionArgs{
							Expression: pulumi.String("accept()"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var net = new Gcp.Compute.Network("net", new()
    {
        Name = "my-network",
        AutoCreateSubnetworks = false,
    });

    var subnet = new Gcp.Compute.Subnetwork("subnet", new()
    {
        Name = "my-subnetwork",
        Network = net.Id,
        IpCidrRange = "10.0.0.0/16",
        Region = "us-central1",
    });

    var router = new Gcp.Compute.Router("router", new()
    {
        Name = "my-router",
        Region = subnet.Region,
        Network = net.Id,
    });

    var rp_export = new Gcp.Compute.RouterRoutePolicy("rp-export", new()
    {
        Router = router.Name,
        Region = router.Region,
        Name = "my-rp1",
        Type = "ROUTE_POLICY_TYPE_EXPORT",
        Terms = new[]
        {
            new Gcp.Compute.Inputs.RouterRoutePolicyTermArgs
            {
                Priority = 1,
                Match = new Gcp.Compute.Inputs.RouterRoutePolicyTermMatchArgs
                {
                    Expression = "destination == '10.0.0.0/12'",
                },
                Actions = new[]
                {
                    new Gcp.Compute.Inputs.RouterRoutePolicyTermActionArgs
                    {
                        Expression = "accept()",
                    },
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.compute.Subnetwork;
import com.pulumi.gcp.compute.SubnetworkArgs;
import com.pulumi.gcp.compute.Router;
import com.pulumi.gcp.compute.RouterArgs;
import com.pulumi.gcp.compute.RouterRoutePolicy;
import com.pulumi.gcp.compute.RouterRoutePolicyArgs;
import com.pulumi.gcp.compute.inputs.RouterRoutePolicyTermArgs;
import com.pulumi.gcp.compute.inputs.RouterRoutePolicyTermMatchArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var net = new Network("net", NetworkArgs.builder()
            .name("my-network")
            .autoCreateSubnetworks(false)
            .build());

        var subnet = new Subnetwork("subnet", SubnetworkArgs.builder()
            .name("my-subnetwork")
            .network(net.id())
            .ipCidrRange("10.0.0.0/16")
            .region("us-central1")
            .build());

        var router = new Router("router", RouterArgs.builder()
            .name("my-router")
            .region(subnet.region())
            .network(net.id())
            .build());

        var rp_export = new RouterRoutePolicy("rp-export", RouterRoutePolicyArgs.builder()
            .router(router.name())
            .region(router.region())
            .name("my-rp1")
            .type("ROUTE_POLICY_TYPE_EXPORT")
            .terms(RouterRoutePolicyTermArgs.builder()
                .priority(1)
                .match(RouterRoutePolicyTermMatchArgs.builder()
                    .expression("destination == '10.0.0.0/12'")
                    .build())
                .actions(RouterRoutePolicyTermActionArgs.builder()
                    .expression("accept()")
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  net:
    type: gcp:compute:Network
    properties:
      name: my-network
      autoCreateSubnetworks: false
  subnet:
    type: gcp:compute:Subnetwork
    properties:
      name: my-subnetwork
      network: ${net.id}
      ipCidrRange: 10.0.0.0/16
      region: us-central1
  router:
    type: gcp:compute:Router
    properties:
      name: my-router
      region: ${subnet.region}
      network: ${net.id}
  rp-export:
    type: gcp:compute:RouterRoutePolicy
    properties:
      router: ${router.name}
      region: ${router.region}
      name: my-rp1
      type: ROUTE_POLICY_TYPE_EXPORT
      terms:
        - priority: 1
          match:
            expression: destination == '10.0.0.0/12'
          actions:
            - expression: accept()
Copy

Router Route Policy Import

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const net = new gcp.compute.Network("net", {
    name: "my-network",
    autoCreateSubnetworks: false,
});
const subnet = new gcp.compute.Subnetwork("subnet", {
    name: "my-subnetwork",
    network: net.id,
    ipCidrRange: "10.0.0.0/16",
    region: "us-central1",
});
const router = new gcp.compute.Router("router", {
    name: "my-router",
    region: subnet.region,
    network: net.id,
});
const rp_import = new gcp.compute.RouterRoutePolicy("rp-import", {
    name: "my-rp2",
    router: router.name,
    region: router.region,
    type: "ROUTE_POLICY_TYPE_IMPORT",
    terms: [{
        priority: 2,
        match: {
            expression: "destination == '10.0.0.0/12'",
        },
        actions: [{
            expression: "accept()",
        }],
    }],
});
Copy
import pulumi
import pulumi_gcp as gcp

net = gcp.compute.Network("net",
    name="my-network",
    auto_create_subnetworks=False)
subnet = gcp.compute.Subnetwork("subnet",
    name="my-subnetwork",
    network=net.id,
    ip_cidr_range="10.0.0.0/16",
    region="us-central1")
router = gcp.compute.Router("router",
    name="my-router",
    region=subnet.region,
    network=net.id)
rp_import = gcp.compute.RouterRoutePolicy("rp-import",
    name="my-rp2",
    router=router.name,
    region=router.region,
    type="ROUTE_POLICY_TYPE_IMPORT",
    terms=[{
        "priority": 2,
        "match": {
            "expression": "destination == '10.0.0.0/12'",
        },
        "actions": [{
            "expression": "accept()",
        }],
    }])
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		net, err := compute.NewNetwork(ctx, "net", &compute.NetworkArgs{
			Name:                  pulumi.String("my-network"),
			AutoCreateSubnetworks: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		subnet, err := compute.NewSubnetwork(ctx, "subnet", &compute.SubnetworkArgs{
			Name:        pulumi.String("my-subnetwork"),
			Network:     net.ID(),
			IpCidrRange: pulumi.String("10.0.0.0/16"),
			Region:      pulumi.String("us-central1"),
		})
		if err != nil {
			return err
		}
		router, err := compute.NewRouter(ctx, "router", &compute.RouterArgs{
			Name:    pulumi.String("my-router"),
			Region:  subnet.Region,
			Network: net.ID(),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewRouterRoutePolicy(ctx, "rp-import", &compute.RouterRoutePolicyArgs{
			Name:   pulumi.String("my-rp2"),
			Router: router.Name,
			Region: router.Region,
			Type:   pulumi.String("ROUTE_POLICY_TYPE_IMPORT"),
			Terms: compute.RouterRoutePolicyTermArray{
				&compute.RouterRoutePolicyTermArgs{
					Priority: pulumi.Int(2),
					Match: &compute.RouterRoutePolicyTermMatchArgs{
						Expression: pulumi.String("destination == '10.0.0.0/12'"),
					},
					Actions: compute.RouterRoutePolicyTermActionArray{
						&compute.RouterRoutePolicyTermActionArgs{
							Expression: pulumi.String("accept()"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var net = new Gcp.Compute.Network("net", new()
    {
        Name = "my-network",
        AutoCreateSubnetworks = false,
    });

    var subnet = new Gcp.Compute.Subnetwork("subnet", new()
    {
        Name = "my-subnetwork",
        Network = net.Id,
        IpCidrRange = "10.0.0.0/16",
        Region = "us-central1",
    });

    var router = new Gcp.Compute.Router("router", new()
    {
        Name = "my-router",
        Region = subnet.Region,
        Network = net.Id,
    });

    var rp_import = new Gcp.Compute.RouterRoutePolicy("rp-import", new()
    {
        Name = "my-rp2",
        Router = router.Name,
        Region = router.Region,
        Type = "ROUTE_POLICY_TYPE_IMPORT",
        Terms = new[]
        {
            new Gcp.Compute.Inputs.RouterRoutePolicyTermArgs
            {
                Priority = 2,
                Match = new Gcp.Compute.Inputs.RouterRoutePolicyTermMatchArgs
                {
                    Expression = "destination == '10.0.0.0/12'",
                },
                Actions = new[]
                {
                    new Gcp.Compute.Inputs.RouterRoutePolicyTermActionArgs
                    {
                        Expression = "accept()",
                    },
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.compute.Subnetwork;
import com.pulumi.gcp.compute.SubnetworkArgs;
import com.pulumi.gcp.compute.Router;
import com.pulumi.gcp.compute.RouterArgs;
import com.pulumi.gcp.compute.RouterRoutePolicy;
import com.pulumi.gcp.compute.RouterRoutePolicyArgs;
import com.pulumi.gcp.compute.inputs.RouterRoutePolicyTermArgs;
import com.pulumi.gcp.compute.inputs.RouterRoutePolicyTermMatchArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var net = new Network("net", NetworkArgs.builder()
            .name("my-network")
            .autoCreateSubnetworks(false)
            .build());

        var subnet = new Subnetwork("subnet", SubnetworkArgs.builder()
            .name("my-subnetwork")
            .network(net.id())
            .ipCidrRange("10.0.0.0/16")
            .region("us-central1")
            .build());

        var router = new Router("router", RouterArgs.builder()
            .name("my-router")
            .region(subnet.region())
            .network(net.id())
            .build());

        var rp_import = new RouterRoutePolicy("rp-import", RouterRoutePolicyArgs.builder()
            .name("my-rp2")
            .router(router.name())
            .region(router.region())
            .type("ROUTE_POLICY_TYPE_IMPORT")
            .terms(RouterRoutePolicyTermArgs.builder()
                .priority(2)
                .match(RouterRoutePolicyTermMatchArgs.builder()
                    .expression("destination == '10.0.0.0/12'")
                    .build())
                .actions(RouterRoutePolicyTermActionArgs.builder()
                    .expression("accept()")
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  net:
    type: gcp:compute:Network
    properties:
      name: my-network
      autoCreateSubnetworks: false
  subnet:
    type: gcp:compute:Subnetwork
    properties:
      name: my-subnetwork
      network: ${net.id}
      ipCidrRange: 10.0.0.0/16
      region: us-central1
  router:
    type: gcp:compute:Router
    properties:
      name: my-router
      region: ${subnet.region}
      network: ${net.id}
  rp-import:
    type: gcp:compute:RouterRoutePolicy
    properties:
      name: my-rp2
      router: ${router.name}
      region: ${router.region}
      type: ROUTE_POLICY_TYPE_IMPORT
      terms:
        - priority: 2
          match:
            expression: destination == '10.0.0.0/12'
          actions:
            - expression: accept()
Copy

Create RouterRoutePolicy Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new RouterRoutePolicy(name: string, args: RouterRoutePolicyArgs, opts?: CustomResourceOptions);
@overload
def RouterRoutePolicy(resource_name: str,
                      args: RouterRoutePolicyArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def RouterRoutePolicy(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      router: Optional[str] = None,
                      terms: Optional[Sequence[RouterRoutePolicyTermArgs]] = None,
                      name: Optional[str] = None,
                      project: Optional[str] = None,
                      region: Optional[str] = None,
                      type: Optional[str] = None)
func NewRouterRoutePolicy(ctx *Context, name string, args RouterRoutePolicyArgs, opts ...ResourceOption) (*RouterRoutePolicy, error)
public RouterRoutePolicy(string name, RouterRoutePolicyArgs args, CustomResourceOptions? opts = null)
public RouterRoutePolicy(String name, RouterRoutePolicyArgs args)
public RouterRoutePolicy(String name, RouterRoutePolicyArgs args, CustomResourceOptions options)
type: gcp:compute:RouterRoutePolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RouterRoutePolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RouterRoutePolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RouterRoutePolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RouterRoutePolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RouterRoutePolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var routerRoutePolicyResource = new Gcp.Compute.RouterRoutePolicy("routerRoutePolicyResource", new()
{
    Router = "string",
    Terms = new[]
    {
        new Gcp.Compute.Inputs.RouterRoutePolicyTermArgs
        {
            Priority = 0,
            Actions = new[]
            {
                new Gcp.Compute.Inputs.RouterRoutePolicyTermActionArgs
                {
                    Expression = "string",
                    Description = "string",
                    Location = "string",
                    Title = "string",
                },
            },
            Match = new Gcp.Compute.Inputs.RouterRoutePolicyTermMatchArgs
            {
                Expression = "string",
                Description = "string",
                Location = "string",
                Title = "string",
            },
        },
    },
    Name = "string",
    Project = "string",
    Region = "string",
    Type = "string",
});
Copy
example, err := compute.NewRouterRoutePolicy(ctx, "routerRoutePolicyResource", &compute.RouterRoutePolicyArgs{
	Router: pulumi.String("string"),
	Terms: compute.RouterRoutePolicyTermArray{
		&compute.RouterRoutePolicyTermArgs{
			Priority: pulumi.Int(0),
			Actions: compute.RouterRoutePolicyTermActionArray{
				&compute.RouterRoutePolicyTermActionArgs{
					Expression:  pulumi.String("string"),
					Description: pulumi.String("string"),
					Location:    pulumi.String("string"),
					Title:       pulumi.String("string"),
				},
			},
			Match: &compute.RouterRoutePolicyTermMatchArgs{
				Expression:  pulumi.String("string"),
				Description: pulumi.String("string"),
				Location:    pulumi.String("string"),
				Title:       pulumi.String("string"),
			},
		},
	},
	Name:    pulumi.String("string"),
	Project: pulumi.String("string"),
	Region:  pulumi.String("string"),
	Type:    pulumi.String("string"),
})
Copy
var routerRoutePolicyResource = new RouterRoutePolicy("routerRoutePolicyResource", RouterRoutePolicyArgs.builder()
    .router("string")
    .terms(RouterRoutePolicyTermArgs.builder()
        .priority(0)
        .actions(RouterRoutePolicyTermActionArgs.builder()
            .expression("string")
            .description("string")
            .location("string")
            .title("string")
            .build())
        .match(RouterRoutePolicyTermMatchArgs.builder()
            .expression("string")
            .description("string")
            .location("string")
            .title("string")
            .build())
        .build())
    .name("string")
    .project("string")
    .region("string")
    .type("string")
    .build());
Copy
router_route_policy_resource = gcp.compute.RouterRoutePolicy("routerRoutePolicyResource",
    router="string",
    terms=[{
        "priority": 0,
        "actions": [{
            "expression": "string",
            "description": "string",
            "location": "string",
            "title": "string",
        }],
        "match": {
            "expression": "string",
            "description": "string",
            "location": "string",
            "title": "string",
        },
    }],
    name="string",
    project="string",
    region="string",
    type="string")
Copy
const routerRoutePolicyResource = new gcp.compute.RouterRoutePolicy("routerRoutePolicyResource", {
    router: "string",
    terms: [{
        priority: 0,
        actions: [{
            expression: "string",
            description: "string",
            location: "string",
            title: "string",
        }],
        match: {
            expression: "string",
            description: "string",
            location: "string",
            title: "string",
        },
    }],
    name: "string",
    project: "string",
    region: "string",
    type: "string",
});
Copy
type: gcp:compute:RouterRoutePolicy
properties:
    name: string
    project: string
    region: string
    router: string
    terms:
        - actions:
            - description: string
              expression: string
              location: string
              title: string
          match:
            description: string
            expression: string
            location: string
            title: string
          priority: 0
    type: string
Copy

RouterRoutePolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The RouterRoutePolicy resource accepts the following input properties:

Router
This property is required.
Changes to this property will trigger replacement.
string
The name of the Cloud Router in which this route policy will be configured.
Terms
This property is required.
Changes to this property will trigger replacement.
List<RouterRoutePolicyTerm>
List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
Name Changes to this property will trigger replacement. string
Name of the route policy. This policy's name, which must be a resource ID segment and unique within all policies owned by the Router
Project Changes to this property will trigger replacement. string
Region Changes to this property will trigger replacement. string
Region where the router and NAT reside.
Type string
This is policy's type, which is one of IMPORT or EXPORT Possible values: ["ROUTE_POLICY_TYPE_IMPORT", "ROUTE_POLICY_TYPE_EXPORT"]
Router
This property is required.
Changes to this property will trigger replacement.
string
The name of the Cloud Router in which this route policy will be configured.
Terms
This property is required.
Changes to this property will trigger replacement.
[]RouterRoutePolicyTermArgs
List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
Name Changes to this property will trigger replacement. string
Name of the route policy. This policy's name, which must be a resource ID segment and unique within all policies owned by the Router
Project Changes to this property will trigger replacement. string
Region Changes to this property will trigger replacement. string
Region where the router and NAT reside.
Type string
This is policy's type, which is one of IMPORT or EXPORT Possible values: ["ROUTE_POLICY_TYPE_IMPORT", "ROUTE_POLICY_TYPE_EXPORT"]
router
This property is required.
Changes to this property will trigger replacement.
String
The name of the Cloud Router in which this route policy will be configured.
terms
This property is required.
Changes to this property will trigger replacement.
List<RouterRoutePolicyTerm>
List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
name Changes to this property will trigger replacement. String
Name of the route policy. This policy's name, which must be a resource ID segment and unique within all policies owned by the Router
project Changes to this property will trigger replacement. String
region Changes to this property will trigger replacement. String
Region where the router and NAT reside.
type String
This is policy's type, which is one of IMPORT or EXPORT Possible values: ["ROUTE_POLICY_TYPE_IMPORT", "ROUTE_POLICY_TYPE_EXPORT"]
router
This property is required.
Changes to this property will trigger replacement.
string
The name of the Cloud Router in which this route policy will be configured.
terms
This property is required.
Changes to this property will trigger replacement.
RouterRoutePolicyTerm[]
List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
name Changes to this property will trigger replacement. string
Name of the route policy. This policy's name, which must be a resource ID segment and unique within all policies owned by the Router
project Changes to this property will trigger replacement. string
region Changes to this property will trigger replacement. string
Region where the router and NAT reside.
type string
This is policy's type, which is one of IMPORT or EXPORT Possible values: ["ROUTE_POLICY_TYPE_IMPORT", "ROUTE_POLICY_TYPE_EXPORT"]
router
This property is required.
Changes to this property will trigger replacement.
str
The name of the Cloud Router in which this route policy will be configured.
terms
This property is required.
Changes to this property will trigger replacement.
Sequence[RouterRoutePolicyTermArgs]
List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
name Changes to this property will trigger replacement. str
Name of the route policy. This policy's name, which must be a resource ID segment and unique within all policies owned by the Router
project Changes to this property will trigger replacement. str
region Changes to this property will trigger replacement. str
Region where the router and NAT reside.
type str
This is policy's type, which is one of IMPORT or EXPORT Possible values: ["ROUTE_POLICY_TYPE_IMPORT", "ROUTE_POLICY_TYPE_EXPORT"]
router
This property is required.
Changes to this property will trigger replacement.
String
The name of the Cloud Router in which this route policy will be configured.
terms
This property is required.
Changes to this property will trigger replacement.
List<Property Map>
List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
name Changes to this property will trigger replacement. String
Name of the route policy. This policy's name, which must be a resource ID segment and unique within all policies owned by the Router
project Changes to this property will trigger replacement. String
region Changes to this property will trigger replacement. String
Region where the router and NAT reside.
type String
This is policy's type, which is one of IMPORT or EXPORT Possible values: ["ROUTE_POLICY_TYPE_IMPORT", "ROUTE_POLICY_TYPE_EXPORT"]

Outputs

All input properties are implicitly available as output properties. Additionally, the RouterRoutePolicy resource produces the following output properties:

Fingerprint string
The fingerprint used for optimistic locking of this resource. Used internally during updates.
Id string
The provider-assigned unique ID for this managed resource.
Fingerprint string
The fingerprint used for optimistic locking of this resource. Used internally during updates.
Id string
The provider-assigned unique ID for this managed resource.
fingerprint String
The fingerprint used for optimistic locking of this resource. Used internally during updates.
id String
The provider-assigned unique ID for this managed resource.
fingerprint string
The fingerprint used for optimistic locking of this resource. Used internally during updates.
id string
The provider-assigned unique ID for this managed resource.
fingerprint str
The fingerprint used for optimistic locking of this resource. Used internally during updates.
id str
The provider-assigned unique ID for this managed resource.
fingerprint String
The fingerprint used for optimistic locking of this resource. Used internally during updates.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing RouterRoutePolicy Resource

Get an existing RouterRoutePolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: RouterRoutePolicyState, opts?: CustomResourceOptions): RouterRoutePolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        fingerprint: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        region: Optional[str] = None,
        router: Optional[str] = None,
        terms: Optional[Sequence[RouterRoutePolicyTermArgs]] = None,
        type: Optional[str] = None) -> RouterRoutePolicy
func GetRouterRoutePolicy(ctx *Context, name string, id IDInput, state *RouterRoutePolicyState, opts ...ResourceOption) (*RouterRoutePolicy, error)
public static RouterRoutePolicy Get(string name, Input<string> id, RouterRoutePolicyState? state, CustomResourceOptions? opts = null)
public static RouterRoutePolicy get(String name, Output<String> id, RouterRoutePolicyState state, CustomResourceOptions options)
resources:  _:    type: gcp:compute:RouterRoutePolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Fingerprint string
The fingerprint used for optimistic locking of this resource. Used internally during updates.
Name Changes to this property will trigger replacement. string
Name of the route policy. This policy's name, which must be a resource ID segment and unique within all policies owned by the Router
Project Changes to this property will trigger replacement. string
Region Changes to this property will trigger replacement. string
Region where the router and NAT reside.
Router Changes to this property will trigger replacement. string
The name of the Cloud Router in which this route policy will be configured.
Terms Changes to this property will trigger replacement. List<RouterRoutePolicyTerm>
List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
Type string
This is policy's type, which is one of IMPORT or EXPORT Possible values: ["ROUTE_POLICY_TYPE_IMPORT", "ROUTE_POLICY_TYPE_EXPORT"]
Fingerprint string
The fingerprint used for optimistic locking of this resource. Used internally during updates.
Name Changes to this property will trigger replacement. string
Name of the route policy. This policy's name, which must be a resource ID segment and unique within all policies owned by the Router
Project Changes to this property will trigger replacement. string
Region Changes to this property will trigger replacement. string
Region where the router and NAT reside.
Router Changes to this property will trigger replacement. string
The name of the Cloud Router in which this route policy will be configured.
Terms Changes to this property will trigger replacement. []RouterRoutePolicyTermArgs
List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
Type string
This is policy's type, which is one of IMPORT or EXPORT Possible values: ["ROUTE_POLICY_TYPE_IMPORT", "ROUTE_POLICY_TYPE_EXPORT"]
fingerprint String
The fingerprint used for optimistic locking of this resource. Used internally during updates.
name Changes to this property will trigger replacement. String
Name of the route policy. This policy's name, which must be a resource ID segment and unique within all policies owned by the Router
project Changes to this property will trigger replacement. String
region Changes to this property will trigger replacement. String
Region where the router and NAT reside.
router Changes to this property will trigger replacement. String
The name of the Cloud Router in which this route policy will be configured.
terms Changes to this property will trigger replacement. List<RouterRoutePolicyTerm>
List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
type String
This is policy's type, which is one of IMPORT or EXPORT Possible values: ["ROUTE_POLICY_TYPE_IMPORT", "ROUTE_POLICY_TYPE_EXPORT"]
fingerprint string
The fingerprint used for optimistic locking of this resource. Used internally during updates.
name Changes to this property will trigger replacement. string
Name of the route policy. This policy's name, which must be a resource ID segment and unique within all policies owned by the Router
project Changes to this property will trigger replacement. string
region Changes to this property will trigger replacement. string
Region where the router and NAT reside.
router Changes to this property will trigger replacement. string
The name of the Cloud Router in which this route policy will be configured.
terms Changes to this property will trigger replacement. RouterRoutePolicyTerm[]
List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
type string
This is policy's type, which is one of IMPORT or EXPORT Possible values: ["ROUTE_POLICY_TYPE_IMPORT", "ROUTE_POLICY_TYPE_EXPORT"]
fingerprint str
The fingerprint used for optimistic locking of this resource. Used internally during updates.
name Changes to this property will trigger replacement. str
Name of the route policy. This policy's name, which must be a resource ID segment and unique within all policies owned by the Router
project Changes to this property will trigger replacement. str
region Changes to this property will trigger replacement. str
Region where the router and NAT reside.
router Changes to this property will trigger replacement. str
The name of the Cloud Router in which this route policy will be configured.
terms Changes to this property will trigger replacement. Sequence[RouterRoutePolicyTermArgs]
List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
type str
This is policy's type, which is one of IMPORT or EXPORT Possible values: ["ROUTE_POLICY_TYPE_IMPORT", "ROUTE_POLICY_TYPE_EXPORT"]
fingerprint String
The fingerprint used for optimistic locking of this resource. Used internally during updates.
name Changes to this property will trigger replacement. String
Name of the route policy. This policy's name, which must be a resource ID segment and unique within all policies owned by the Router
project Changes to this property will trigger replacement. String
region Changes to this property will trigger replacement. String
Region where the router and NAT reside.
router Changes to this property will trigger replacement. String
The name of the Cloud Router in which this route policy will be configured.
terms Changes to this property will trigger replacement. List<Property Map>
List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
type String
This is policy's type, which is one of IMPORT or EXPORT Possible values: ["ROUTE_POLICY_TYPE_IMPORT", "ROUTE_POLICY_TYPE_EXPORT"]

Supporting Types

RouterRoutePolicyTerm
, RouterRoutePolicyTermArgs

Priority This property is required. int
The evaluation priority for this term, which must be between 0 (inclusive) and 231 (exclusive), and unique within the list.
Actions List<RouterRoutePolicyTermAction>
'CEL expressions to evaluate to modify a route when this term matches.'
Structure is documented below.
Match RouterRoutePolicyTermMatch
CEL expression evaluated against a route to determine if this term applies (see Policy Language). When not set, the term applies to all routes. Structure is documented below.
Priority This property is required. int
The evaluation priority for this term, which must be between 0 (inclusive) and 231 (exclusive), and unique within the list.
Actions []RouterRoutePolicyTermAction
'CEL expressions to evaluate to modify a route when this term matches.'
Structure is documented below.
Match RouterRoutePolicyTermMatch
CEL expression evaluated against a route to determine if this term applies (see Policy Language). When not set, the term applies to all routes. Structure is documented below.
priority This property is required. Integer
The evaluation priority for this term, which must be between 0 (inclusive) and 231 (exclusive), and unique within the list.
actions List<RouterRoutePolicyTermAction>
'CEL expressions to evaluate to modify a route when this term matches.'
Structure is documented below.
match RouterRoutePolicyTermMatch
CEL expression evaluated against a route to determine if this term applies (see Policy Language). When not set, the term applies to all routes. Structure is documented below.
priority This property is required. number
The evaluation priority for this term, which must be between 0 (inclusive) and 231 (exclusive), and unique within the list.
actions RouterRoutePolicyTermAction[]
'CEL expressions to evaluate to modify a route when this term matches.'
Structure is documented below.
match RouterRoutePolicyTermMatch
CEL expression evaluated against a route to determine if this term applies (see Policy Language). When not set, the term applies to all routes. Structure is documented below.
priority This property is required. int
The evaluation priority for this term, which must be between 0 (inclusive) and 231 (exclusive), and unique within the list.
actions Sequence[RouterRoutePolicyTermAction]
'CEL expressions to evaluate to modify a route when this term matches.'
Structure is documented below.
match RouterRoutePolicyTermMatch
CEL expression evaluated against a route to determine if this term applies (see Policy Language). When not set, the term applies to all routes. Structure is documented below.
priority This property is required. Number
The evaluation priority for this term, which must be between 0 (inclusive) and 231 (exclusive), and unique within the list.
actions List<Property Map>
'CEL expressions to evaluate to modify a route when this term matches.'
Structure is documented below.
match Property Map
CEL expression evaluated against a route to determine if this term applies (see Policy Language). When not set, the term applies to all routes. Structure is documented below.

RouterRoutePolicyTermAction
, RouterRoutePolicyTermActionArgs

Expression This property is required. string
Textual representation of an expression in Common Expression Language syntax.
Description string
Description of the expression
Location string
String indicating the location of the expression for error reporting, e.g. a file name and a position in the file


Title string
Title for the expression, i.e. a short string describing its purpose.
Expression This property is required. string
Textual representation of an expression in Common Expression Language syntax.
Description string
Description of the expression
Location string
String indicating the location of the expression for error reporting, e.g. a file name and a position in the file


Title string
Title for the expression, i.e. a short string describing its purpose.
expression This property is required. String
Textual representation of an expression in Common Expression Language syntax.
description String
Description of the expression
location String
String indicating the location of the expression for error reporting, e.g. a file name and a position in the file


title String
Title for the expression, i.e. a short string describing its purpose.
expression This property is required. string
Textual representation of an expression in Common Expression Language syntax.
description string
Description of the expression
location string
String indicating the location of the expression for error reporting, e.g. a file name and a position in the file


title string
Title for the expression, i.e. a short string describing its purpose.
expression This property is required. str
Textual representation of an expression in Common Expression Language syntax.
description str
Description of the expression
location str
String indicating the location of the expression for error reporting, e.g. a file name and a position in the file


title str
Title for the expression, i.e. a short string describing its purpose.
expression This property is required. String
Textual representation of an expression in Common Expression Language syntax.
description String
Description of the expression
location String
String indicating the location of the expression for error reporting, e.g. a file name and a position in the file


title String
Title for the expression, i.e. a short string describing its purpose.

RouterRoutePolicyTermMatch
, RouterRoutePolicyTermMatchArgs

Expression This property is required. string
Textual representation of an expression in Common Expression Language syntax.
Description string
Description of the expression
Location string
String indicating the location of the expression for error reporting, e.g. a file name and a position in the file
Title string
Title for the expression, i.e. a short string describing its purpose.
Expression This property is required. string
Textual representation of an expression in Common Expression Language syntax.
Description string
Description of the expression
Location string
String indicating the location of the expression for error reporting, e.g. a file name and a position in the file
Title string
Title for the expression, i.e. a short string describing its purpose.
expression This property is required. String
Textual representation of an expression in Common Expression Language syntax.
description String
Description of the expression
location String
String indicating the location of the expression for error reporting, e.g. a file name and a position in the file
title String
Title for the expression, i.e. a short string describing its purpose.
expression This property is required. string
Textual representation of an expression in Common Expression Language syntax.
description string
Description of the expression
location string
String indicating the location of the expression for error reporting, e.g. a file name and a position in the file
title string
Title for the expression, i.e. a short string describing its purpose.
expression This property is required. str
Textual representation of an expression in Common Expression Language syntax.
description str
Description of the expression
location str
String indicating the location of the expression for error reporting, e.g. a file name and a position in the file
title str
Title for the expression, i.e. a short string describing its purpose.
expression This property is required. String
Textual representation of an expression in Common Expression Language syntax.
description String
Description of the expression
location String
String indicating the location of the expression for error reporting, e.g. a file name and a position in the file
title String
Title for the expression, i.e. a short string describing its purpose.

Import

RouterRoutePolicy can be imported using any of these accepted formats:

  • {{project}}/{{region}}/{{router}}/routePolicies/{{name}}

  • {{project}}/{{region}}/{{router}}/{{name}}

  • {{region}}/{{router}}/{{name}}

  • {{router}}/{{name}}

When using the pulumi import command, RouterRoutePolicy can be imported using one of the formats above. For example:

$ pulumi import gcp:compute/routerRoutePolicy:RouterRoutePolicy default {{project}}/{{region}}/{{router}}/routePolicies/{{name}}
Copy
$ pulumi import gcp:compute/routerRoutePolicy:RouterRoutePolicy default {{project}}/{{region}}/{{router}}/{{name}}
Copy
$ pulumi import gcp:compute/routerRoutePolicy:RouterRoutePolicy default {{region}}/{{router}}/{{name}}
Copy
$ pulumi import gcp:compute/routerRoutePolicy:RouterRoutePolicy default {{router}}/{{name}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.