oci.LoadBalancer.LoadBalancerRoutingPolicy
Explore with Pulumi AI
This resource provides the Load Balancer Routing Policy resource in Oracle Cloud Infrastructure Load Balancer service.
Adds a routing policy to a load balancer. For more information, see Managing Request Routing.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testLoadBalancerRoutingPolicy = new oci.loadbalancer.LoadBalancerRoutingPolicy("test_load_balancer_routing_policy", {
conditionLanguageVersion: loadBalancerRoutingPolicyConditionLanguageVersion,
loadBalancerId: testLoadBalancer.id,
name: loadBalancerRoutingPolicyName,
rules: [{
actions: [{
backendSetName: testBackendSet.name,
name: loadBalancerRoutingPolicyRulesActionsName,
}],
condition: loadBalancerRoutingPolicyRulesCondition,
name: loadBalancerRoutingPolicyRulesName,
}],
});
import pulumi
import pulumi_oci as oci
test_load_balancer_routing_policy = oci.load_balancer.LoadBalancerRoutingPolicy("test_load_balancer_routing_policy",
condition_language_version=load_balancer_routing_policy_condition_language_version,
load_balancer_id=test_load_balancer["id"],
name=load_balancer_routing_policy_name,
rules=[{
"actions": [{
"backend_set_name": test_backend_set["name"],
"name": load_balancer_routing_policy_rules_actions_name,
}],
"condition": load_balancer_routing_policy_rules_condition,
"name": load_balancer_routing_policy_rules_name,
}])
package main
import (
"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/LoadBalancer"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := LoadBalancer.NewLoadBalancerRoutingPolicy(ctx, "test_load_balancer_routing_policy", &LoadBalancer.LoadBalancerRoutingPolicyArgs{
ConditionLanguageVersion: pulumi.Any(loadBalancerRoutingPolicyConditionLanguageVersion),
LoadBalancerId: pulumi.Any(testLoadBalancer.Id),
Name: pulumi.Any(loadBalancerRoutingPolicyName),
Rules: loadbalancer.LoadBalancerRoutingPolicyRuleArray{
&loadbalancer.LoadBalancerRoutingPolicyRuleArgs{
Actions: loadbalancer.LoadBalancerRoutingPolicyRuleActionArray{
&loadbalancer.LoadBalancerRoutingPolicyRuleActionArgs{
BackendSetName: pulumi.Any(testBackendSet.Name),
Name: pulumi.Any(loadBalancerRoutingPolicyRulesActionsName),
},
},
Condition: pulumi.Any(loadBalancerRoutingPolicyRulesCondition),
Name: pulumi.Any(loadBalancerRoutingPolicyRulesName),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() =>
{
var testLoadBalancerRoutingPolicy = new Oci.LoadBalancer.LoadBalancerRoutingPolicy("test_load_balancer_routing_policy", new()
{
ConditionLanguageVersion = loadBalancerRoutingPolicyConditionLanguageVersion,
LoadBalancerId = testLoadBalancer.Id,
Name = loadBalancerRoutingPolicyName,
Rules = new[]
{
new Oci.LoadBalancer.Inputs.LoadBalancerRoutingPolicyRuleArgs
{
Actions = new[]
{
new Oci.LoadBalancer.Inputs.LoadBalancerRoutingPolicyRuleActionArgs
{
BackendSetName = testBackendSet.Name,
Name = loadBalancerRoutingPolicyRulesActionsName,
},
},
Condition = loadBalancerRoutingPolicyRulesCondition,
Name = loadBalancerRoutingPolicyRulesName,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.LoadBalancer.LoadBalancerRoutingPolicy;
import com.pulumi.oci.LoadBalancer.LoadBalancerRoutingPolicyArgs;
import com.pulumi.oci.LoadBalancer.inputs.LoadBalancerRoutingPolicyRuleArgs;
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 testLoadBalancerRoutingPolicy = new LoadBalancerRoutingPolicy("testLoadBalancerRoutingPolicy", LoadBalancerRoutingPolicyArgs.builder()
.conditionLanguageVersion(loadBalancerRoutingPolicyConditionLanguageVersion)
.loadBalancerId(testLoadBalancer.id())
.name(loadBalancerRoutingPolicyName)
.rules(LoadBalancerRoutingPolicyRuleArgs.builder()
.actions(LoadBalancerRoutingPolicyRuleActionArgs.builder()
.backendSetName(testBackendSet.name())
.name(loadBalancerRoutingPolicyRulesActionsName)
.build())
.condition(loadBalancerRoutingPolicyRulesCondition)
.name(loadBalancerRoutingPolicyRulesName)
.build())
.build());
}
}
resources:
testLoadBalancerRoutingPolicy:
type: oci:LoadBalancer:LoadBalancerRoutingPolicy
name: test_load_balancer_routing_policy
properties:
conditionLanguageVersion: ${loadBalancerRoutingPolicyConditionLanguageVersion}
loadBalancerId: ${testLoadBalancer.id}
name: ${loadBalancerRoutingPolicyName}
rules:
- actions:
- backendSetName: ${testBackendSet.name}
name: ${loadBalancerRoutingPolicyRulesActionsName}
condition: ${loadBalancerRoutingPolicyRulesCondition}
name: ${loadBalancerRoutingPolicyRulesName}
Create LoadBalancerRoutingPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new LoadBalancerRoutingPolicy(name: string, args: LoadBalancerRoutingPolicyArgs, opts?: CustomResourceOptions);
@overload
def LoadBalancerRoutingPolicy(resource_name: str,
args: LoadBalancerRoutingPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def LoadBalancerRoutingPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
condition_language_version: Optional[str] = None,
load_balancer_id: Optional[str] = None,
rules: Optional[Sequence[_loadbalancer.LoadBalancerRoutingPolicyRuleArgs]] = None,
name: Optional[str] = None)
func NewLoadBalancerRoutingPolicy(ctx *Context, name string, args LoadBalancerRoutingPolicyArgs, opts ...ResourceOption) (*LoadBalancerRoutingPolicy, error)
public LoadBalancerRoutingPolicy(string name, LoadBalancerRoutingPolicyArgs args, CustomResourceOptions? opts = null)
public LoadBalancerRoutingPolicy(String name, LoadBalancerRoutingPolicyArgs args)
public LoadBalancerRoutingPolicy(String name, LoadBalancerRoutingPolicyArgs args, CustomResourceOptions options)
type: oci:LoadBalancer:LoadBalancerRoutingPolicy
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 LoadBalancerRoutingPolicyArgs
- 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 LoadBalancerRoutingPolicyArgs
- 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 LoadBalancerRoutingPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LoadBalancerRoutingPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LoadBalancerRoutingPolicyArgs
- 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 loadBalancerRoutingPolicyResource = new Oci.LoadBalancer.LoadBalancerRoutingPolicy("loadBalancerRoutingPolicyResource", new()
{
ConditionLanguageVersion = "string",
LoadBalancerId = "string",
Rules = new[]
{
new Oci.LoadBalancer.Inputs.LoadBalancerRoutingPolicyRuleArgs
{
Actions = new[]
{
new Oci.LoadBalancer.Inputs.LoadBalancerRoutingPolicyRuleActionArgs
{
BackendSetName = "string",
Name = "string",
},
},
Condition = "string",
Name = "string",
},
},
Name = "string",
});
example, err := LoadBalancer.NewLoadBalancerRoutingPolicy(ctx, "loadBalancerRoutingPolicyResource", &LoadBalancer.LoadBalancerRoutingPolicyArgs{
ConditionLanguageVersion: pulumi.String("string"),
LoadBalancerId: pulumi.String("string"),
Rules: loadbalancer.LoadBalancerRoutingPolicyRuleArray{
&loadbalancer.LoadBalancerRoutingPolicyRuleArgs{
Actions: loadbalancer.LoadBalancerRoutingPolicyRuleActionArray{
&loadbalancer.LoadBalancerRoutingPolicyRuleActionArgs{
BackendSetName: pulumi.String("string"),
Name: pulumi.String("string"),
},
},
Condition: pulumi.String("string"),
Name: pulumi.String("string"),
},
},
Name: pulumi.String("string"),
})
var loadBalancerRoutingPolicyResource = new LoadBalancerRoutingPolicy("loadBalancerRoutingPolicyResource", LoadBalancerRoutingPolicyArgs.builder()
.conditionLanguageVersion("string")
.loadBalancerId("string")
.rules(LoadBalancerRoutingPolicyRuleArgs.builder()
.actions(LoadBalancerRoutingPolicyRuleActionArgs.builder()
.backendSetName("string")
.name("string")
.build())
.condition("string")
.name("string")
.build())
.name("string")
.build());
load_balancer_routing_policy_resource = oci.load_balancer.LoadBalancerRoutingPolicy("loadBalancerRoutingPolicyResource",
condition_language_version="string",
load_balancer_id="string",
rules=[{
"actions": [{
"backend_set_name": "string",
"name": "string",
}],
"condition": "string",
"name": "string",
}],
name="string")
const loadBalancerRoutingPolicyResource = new oci.loadbalancer.LoadBalancerRoutingPolicy("loadBalancerRoutingPolicyResource", {
conditionLanguageVersion: "string",
loadBalancerId: "string",
rules: [{
actions: [{
backendSetName: "string",
name: "string",
}],
condition: "string",
name: "string",
}],
name: "string",
});
type: oci:LoadBalancer:LoadBalancerRoutingPolicy
properties:
conditionLanguageVersion: string
loadBalancerId: string
name: string
rules:
- actions:
- backendSetName: string
name: string
condition: string
name: string
LoadBalancerRoutingPolicy 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 LoadBalancerRoutingPolicy resource accepts the following input properties:
- Condition
Language stringVersion - (Updatable) The version of the language in which
condition
ofrules
are composed. - Load
Balancer stringId - The OCID of the load balancer to add the routing policy rule list to.
- Rules
List<Load
Balancer Routing Policy Rule> - (Updatable) The list of routing rules.
- Name string
- The name for this list of routing rules. It must be unique and it cannot be changed. Avoid entering confidential information. Example:
example_routing_rules
- Condition
Language stringVersion - (Updatable) The version of the language in which
condition
ofrules
are composed. - Load
Balancer stringId - The OCID of the load balancer to add the routing policy rule list to.
- Rules
[]Load
Balancer Routing Policy Rule Args - (Updatable) The list of routing rules.
- Name string
- The name for this list of routing rules. It must be unique and it cannot be changed. Avoid entering confidential information. Example:
example_routing_rules
- condition
Language StringVersion - (Updatable) The version of the language in which
condition
ofrules
are composed. - load
Balancer StringId - The OCID of the load balancer to add the routing policy rule list to.
- rules
List<Routing
Policy Rule> - (Updatable) The list of routing rules.
- name String
- The name for this list of routing rules. It must be unique and it cannot be changed. Avoid entering confidential information. Example:
example_routing_rules
- condition
Language stringVersion - (Updatable) The version of the language in which
condition
ofrules
are composed. - load
Balancer stringId - The OCID of the load balancer to add the routing policy rule list to.
- rules
Load
Balancer Routing Policy Rule[] - (Updatable) The list of routing rules.
- name string
- The name for this list of routing rules. It must be unique and it cannot be changed. Avoid entering confidential information. Example:
example_routing_rules
- condition_
language_ strversion - (Updatable) The version of the language in which
condition
ofrules
are composed. - load_
balancer_ strid - The OCID of the load balancer to add the routing policy rule list to.
- rules
Sequence[loadbalancer.
Load Balancer Routing Policy Rule Args] - (Updatable) The list of routing rules.
- name str
- The name for this list of routing rules. It must be unique and it cannot be changed. Avoid entering confidential information. Example:
example_routing_rules
- condition
Language StringVersion - (Updatable) The version of the language in which
condition
ofrules
are composed. - load
Balancer StringId - The OCID of the load balancer to add the routing policy rule list to.
- rules List<Property Map>
- (Updatable) The list of routing rules.
- name String
- The name for this list of routing rules. It must be unique and it cannot be changed. Avoid entering confidential information. Example:
example_routing_rules
Outputs
All input properties are implicitly available as output properties. Additionally, the LoadBalancerRoutingPolicy resource produces the following output properties:
Look up Existing LoadBalancerRoutingPolicy Resource
Get an existing LoadBalancerRoutingPolicy 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?: LoadBalancerRoutingPolicyState, opts?: CustomResourceOptions): LoadBalancerRoutingPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
condition_language_version: Optional[str] = None,
load_balancer_id: Optional[str] = None,
name: Optional[str] = None,
rules: Optional[Sequence[_loadbalancer.LoadBalancerRoutingPolicyRuleArgs]] = None,
state: Optional[str] = None) -> LoadBalancerRoutingPolicy
func GetLoadBalancerRoutingPolicy(ctx *Context, name string, id IDInput, state *LoadBalancerRoutingPolicyState, opts ...ResourceOption) (*LoadBalancerRoutingPolicy, error)
public static LoadBalancerRoutingPolicy Get(string name, Input<string> id, LoadBalancerRoutingPolicyState? state, CustomResourceOptions? opts = null)
public static LoadBalancerRoutingPolicy get(String name, Output<String> id, LoadBalancerRoutingPolicyState 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.
- Condition
Language stringVersion - (Updatable) The version of the language in which
condition
ofrules
are composed. - Load
Balancer stringId - The OCID of the load balancer to add the routing policy rule list to.
- Name string
- The name for this list of routing rules. It must be unique and it cannot be changed. Avoid entering confidential information. Example:
example_routing_rules
- Rules
List<Load
Balancer Routing Policy Rule> - (Updatable) The list of routing rules.
- State string
- Condition
Language stringVersion - (Updatable) The version of the language in which
condition
ofrules
are composed. - Load
Balancer stringId - The OCID of the load balancer to add the routing policy rule list to.
- Name string
- The name for this list of routing rules. It must be unique and it cannot be changed. Avoid entering confidential information. Example:
example_routing_rules
- Rules
[]Load
Balancer Routing Policy Rule Args - (Updatable) The list of routing rules.
- State string
- condition
Language StringVersion - (Updatable) The version of the language in which
condition
ofrules
are composed. - load
Balancer StringId - The OCID of the load balancer to add the routing policy rule list to.
- name String
- The name for this list of routing rules. It must be unique and it cannot be changed. Avoid entering confidential information. Example:
example_routing_rules
- rules
List<Routing
Policy Rule> - (Updatable) The list of routing rules.
- state String
- condition
Language stringVersion - (Updatable) The version of the language in which
condition
ofrules
are composed. - load
Balancer stringId - The OCID of the load balancer to add the routing policy rule list to.
- name string
- The name for this list of routing rules. It must be unique and it cannot be changed. Avoid entering confidential information. Example:
example_routing_rules
- rules
Load
Balancer Routing Policy Rule[] - (Updatable) The list of routing rules.
- state string
- condition_
language_ strversion - (Updatable) The version of the language in which
condition
ofrules
are composed. - load_
balancer_ strid - The OCID of the load balancer to add the routing policy rule list to.
- name str
- The name for this list of routing rules. It must be unique and it cannot be changed. Avoid entering confidential information. Example:
example_routing_rules
- rules
Sequence[loadbalancer.
Load Balancer Routing Policy Rule Args] - (Updatable) The list of routing rules.
- state str
- condition
Language StringVersion - (Updatable) The version of the language in which
condition
ofrules
are composed. - load
Balancer StringId - The OCID of the load balancer to add the routing policy rule list to.
- name String
- The name for this list of routing rules. It must be unique and it cannot be changed. Avoid entering confidential information. Example:
example_routing_rules
- rules List<Property Map>
- (Updatable) The list of routing rules.
- state String
Supporting Types
LoadBalancerRoutingPolicyRule, LoadBalancerRoutingPolicyRuleArgs
- Actions
List<Load
Balancer Routing Policy Rule Action> - (Updatable) A list of actions to be applied when conditions of the routing rule are met.
- Condition string
- (Updatable) A routing rule to evaluate defined conditions against the incoming HTTP request and perform an action.
- Name string
(Updatable) A unique name for the routing policy rule. Avoid entering confidential information.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- Actions
[]Load
Balancer Routing Policy Rule Action - (Updatable) A list of actions to be applied when conditions of the routing rule are met.
- Condition string
- (Updatable) A routing rule to evaluate defined conditions against the incoming HTTP request and perform an action.
- Name string
(Updatable) A unique name for the routing policy rule. Avoid entering confidential information.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- actions
List<Routing
Policy Rule Action> - (Updatable) A list of actions to be applied when conditions of the routing rule are met.
- condition String
- (Updatable) A routing rule to evaluate defined conditions against the incoming HTTP request and perform an action.
- name String
(Updatable) A unique name for the routing policy rule. Avoid entering confidential information.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- actions
Load
Balancer Routing Policy Rule Action[] - (Updatable) A list of actions to be applied when conditions of the routing rule are met.
- condition string
- (Updatable) A routing rule to evaluate defined conditions against the incoming HTTP request and perform an action.
- name string
(Updatable) A unique name for the routing policy rule. Avoid entering confidential information.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- actions
Sequence[loadbalancer.
Load Balancer Routing Policy Rule Action] - (Updatable) A list of actions to be applied when conditions of the routing rule are met.
- condition str
- (Updatable) A routing rule to evaluate defined conditions against the incoming HTTP request and perform an action.
- name str
(Updatable) A unique name for the routing policy rule. Avoid entering confidential information.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- actions List<Property Map>
- (Updatable) A list of actions to be applied when conditions of the routing rule are met.
- condition String
- (Updatable) A routing rule to evaluate defined conditions against the incoming HTTP request and perform an action.
- name String
(Updatable) A unique name for the routing policy rule. Avoid entering confidential information.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
LoadBalancerRoutingPolicyRuleAction, LoadBalancerRoutingPolicyRuleActionArgs
- Backend
Set stringName - (Updatable) Name of the backend set the listener will forward the traffic to. Example:
backendSetForImages
- Name string
- (Updatable) The name can be one of these values:
FORWARD_TO_BACKENDSET
- Backend
Set stringName - (Updatable) Name of the backend set the listener will forward the traffic to. Example:
backendSetForImages
- Name string
- (Updatable) The name can be one of these values:
FORWARD_TO_BACKENDSET
- backend
Set StringName - (Updatable) Name of the backend set the listener will forward the traffic to. Example:
backendSetForImages
- name String
- (Updatable) The name can be one of these values:
FORWARD_TO_BACKENDSET
- backend
Set stringName - (Updatable) Name of the backend set the listener will forward the traffic to. Example:
backendSetForImages
- name string
- (Updatable) The name can be one of these values:
FORWARD_TO_BACKENDSET
- backend_
set_ strname - (Updatable) Name of the backend set the listener will forward the traffic to. Example:
backendSetForImages
- name str
- (Updatable) The name can be one of these values:
FORWARD_TO_BACKENDSET
- backend
Set StringName - (Updatable) Name of the backend set the listener will forward the traffic to. Example:
backendSetForImages
- name String
- (Updatable) The name can be one of these values:
FORWARD_TO_BACKENDSET
Import
LoadBalancerRoutingPolicies can be imported using the id
, e.g.
$ pulumi import oci:LoadBalancer/loadBalancerRoutingPolicy:LoadBalancerRoutingPolicy test_load_balancer_routing_policy "loadBalancers/{loadBalancerId}/routingPolicies/{routingPolicyName}"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
oci
Terraform Provider.