gcp.compute.RouterRoutePolicy
Explore with Pulumi AI
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()",
}],
}],
});
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()",
}],
}])
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
})
}
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()",
},
},
},
},
});
});
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());
}
}
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()
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()",
}],
}],
});
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()",
}],
}])
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
})
}
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()",
},
},
},
},
});
});
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());
}
}
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()
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 string
- The unique name of the resource.
- args RouterRoutePolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args RouterRoutePolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RouterRoutePolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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"),
})
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());
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")
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",
});
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
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 string
- The name of the Cloud Router in which this route policy will be configured.
- Terms
List<Router
Route Policy Term> - List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
- Name 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 string
- Region 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 string
- The name of the Cloud Router in which this route policy will be configured.
- Terms
[]Router
Route Policy Term Args - List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
- Name 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 string
- Region 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 String
- The name of the Cloud Router in which this route policy will be configured.
- terms
List<Router
Route Policy Term> - List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
- name 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 String
- region 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 string
- The name of the Cloud Router in which this route policy will be configured.
- terms
Router
Route Policy Term[] - List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
- name 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 string
- region 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 str
- The name of the Cloud Router in which this route policy will be configured.
- terms
Sequence[Router
Route Policy Term Args] - List of terms (the order in the list is not important, they are evaluated in order of priority). Structure is documented below.
- name 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 str
- region 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 String
- The name of the Cloud Router in which this route policy will be configured.
- terms 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 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 String
- region 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)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Fingerprint string
- The fingerprint used for optimistic locking of this resource. Used internally during updates.
- Name 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 string
- Region string
- Region where the router and NAT reside.
- Router string
- The name of the Cloud Router in which this route policy will be configured.
- Terms
List<Router
Route Policy Term> - 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 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 string
- Region string
- Region where the router and NAT reside.
- Router string
- The name of the Cloud Router in which this route policy will be configured.
- Terms
[]Router
Route Policy Term Args - 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 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 String
- region String
- Region where the router and NAT reside.
- router String
- The name of the Cloud Router in which this route policy will be configured.
- terms
List<Router
Route Policy Term> - 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 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 string
- region string
- Region where the router and NAT reside.
- router string
- The name of the Cloud Router in which this route policy will be configured.
- terms
Router
Route Policy Term[] - 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 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 str
- region str
- Region where the router and NAT reside.
- router str
- The name of the Cloud Router in which this route policy will be configured.
- terms
Sequence[Router
Route Policy Term Args] - 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 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 String
- region String
- Region where the router and NAT reside.
- router String
- The name of the Cloud Router in which this route policy will be configured.
- terms 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 int
- The evaluation priority for this term, which must be between 0 (inclusive) and 231 (exclusive), and unique within the list.
- Actions
List<Router
Route Policy Term Action> - 'CEL expressions to evaluate to modify a route when this term matches.'
Structure is documented below. - Match
Router
Route Policy Term Match - 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 int
- The evaluation priority for this term, which must be between 0 (inclusive) and 231 (exclusive), and unique within the list.
- Actions
[]Router
Route Policy Term Action - 'CEL expressions to evaluate to modify a route when this term matches.'
Structure is documented below. - Match
Router
Route Policy Term Match - 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 Integer
- The evaluation priority for this term, which must be between 0 (inclusive) and 231 (exclusive), and unique within the list.
- actions
List<Router
Route Policy Term Action> - 'CEL expressions to evaluate to modify a route when this term matches.'
Structure is documented below. - match
Router
Route Policy Term Match - 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 number
- The evaluation priority for this term, which must be between 0 (inclusive) and 231 (exclusive), and unique within the list.
- actions
Router
Route Policy Term Action[] - 'CEL expressions to evaluate to modify a route when this term matches.'
Structure is documented below. - match
Router
Route Policy Term Match - 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 int
- The evaluation priority for this term, which must be between 0 (inclusive) and 231 (exclusive), and unique within the list.
- actions
Sequence[Router
Route Policy Term Action] - 'CEL expressions to evaluate to modify a route when this term matches.'
Structure is documented below. - match
Router
Route Policy Term Match - 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 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 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 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 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 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 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 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 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 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 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 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 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 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}}
$ pulumi import gcp:compute/routerRoutePolicy:RouterRoutePolicy default {{project}}/{{region}}/{{router}}/{{name}}
$ pulumi import gcp:compute/routerRoutePolicy:RouterRoutePolicy default {{region}}/{{router}}/{{name}}
$ pulumi import gcp:compute/routerRoutePolicy:RouterRoutePolicy default {{router}}/{{name}}
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.