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
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() =>
{
var testLoadBalancerRoutingPolicy = new Oci.LoadBalancer.LoadBalancerRoutingPolicy("testLoadBalancerRoutingPolicy", new()
{
ConditionLanguageVersion = @var.Load_balancer_routing_policy_condition_language_version,
LoadBalancerId = oci_load_balancer_load_balancer.Test_load_balancer.Id,
Rules = new[]
{
new Oci.LoadBalancer.Inputs.LoadBalancerRoutingPolicyRuleArgs
{
Actions = new[]
{
new Oci.LoadBalancer.Inputs.LoadBalancerRoutingPolicyRuleActionArgs
{
BackendSetName = oci_load_balancer_backend_set.Test_backend_set.Name,
Name = @var.Load_balancer_routing_policy_rules_actions_name,
},
},
Condition = @var.Load_balancer_routing_policy_rules_condition,
Name = @var.Load_balancer_routing_policy_rules_name,
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-oci/sdk/go/oci/LoadBalancer"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := LoadBalancer.NewLoadBalancerRoutingPolicy(ctx, "testLoadBalancerRoutingPolicy", &LoadBalancer.LoadBalancerRoutingPolicyArgs{
ConditionLanguageVersion: pulumi.Any(_var.Load_balancer_routing_policy_condition_language_version),
LoadBalancerId: pulumi.Any(oci_load_balancer_load_balancer.Test_load_balancer.Id),
Rules: loadbalancer.LoadBalancerRoutingPolicyRuleArray{
&loadbalancer.LoadBalancerRoutingPolicyRuleArgs{
Actions: loadbalancer.LoadBalancerRoutingPolicyRuleActionArray{
&loadbalancer.LoadBalancerRoutingPolicyRuleActionArgs{
BackendSetName: pulumi.Any(oci_load_balancer_backend_set.Test_backend_set.Name),
Name: pulumi.Any(_var.Load_balancer_routing_policy_rules_actions_name),
},
},
Condition: pulumi.Any(_var.Load_balancer_routing_policy_rules_condition),
Name: pulumi.Any(_var.Load_balancer_routing_policy_rules_name),
},
},
})
if err != nil {
return err
}
return nil
})
}
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(var_.load_balancer_routing_policy_condition_language_version())
.loadBalancerId(oci_load_balancer_load_balancer.test_load_balancer().id())
.rules(LoadBalancerRoutingPolicyRuleArgs.builder()
.actions(LoadBalancerRoutingPolicyRuleActionArgs.builder()
.backendSetName(oci_load_balancer_backend_set.test_backend_set().name())
.name(var_.load_balancer_routing_policy_rules_actions_name())
.build())
.condition(var_.load_balancer_routing_policy_rules_condition())
.name(var_.load_balancer_routing_policy_rules_name())
.build())
.build());
}
}
import pulumi
import pulumi_oci as oci
test_load_balancer_routing_policy = oci.load_balancer.LoadBalancerRoutingPolicy("testLoadBalancerRoutingPolicy",
condition_language_version=var["load_balancer_routing_policy_condition_language_version"],
load_balancer_id=oci_load_balancer_load_balancer["test_load_balancer"]["id"],
rules=[oci.load_balancer.LoadBalancerRoutingPolicyRuleArgs(
actions=[oci.load_balancer.LoadBalancerRoutingPolicyRuleActionArgs(
backend_set_name=oci_load_balancer_backend_set["test_backend_set"]["name"],
name=var["load_balancer_routing_policy_rules_actions_name"],
)],
condition=var["load_balancer_routing_policy_rules_condition"],
name=var["load_balancer_routing_policy_rules_name"],
)])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testLoadBalancerRoutingPolicy = new oci.loadbalancer.LoadBalancerRoutingPolicy("testLoadBalancerRoutingPolicy", {
conditionLanguageVersion: _var.load_balancer_routing_policy_condition_language_version,
loadBalancerId: oci_load_balancer_load_balancer.test_load_balancer.id,
rules: [{
actions: [{
backendSetName: oci_load_balancer_backend_set.test_backend_set.name,
name: _var.load_balancer_routing_policy_rules_actions_name,
}],
condition: _var.load_balancer_routing_policy_rules_condition,
name: _var.load_balancer_routing_policy_rules_name,
}],
});
resources:
testLoadBalancerRoutingPolicy:
type: oci:LoadBalancer:LoadBalancerRoutingPolicy
properties:
#Required
conditionLanguageVersion: ${var.load_balancer_routing_policy_condition_language_version}
loadBalancerId: ${oci_load_balancer_load_balancer.test_load_balancer.id}
rules:
- actions:
- backendSetName: ${oci_load_balancer_backend_set.test_backend_set.name}
name: ${var.load_balancer_routing_policy_rules_actions_name}
condition: ${var.load_balancer_routing_policy_rules_condition}
name: ${var.load_balancer_routing_policy_rules_name}
Create LoadBalancerRoutingPolicy Resource
new LoadBalancerRoutingPolicy(name: string, args: LoadBalancerRoutingPolicyArgs, opts?: CustomResourceOptions);
@overload
def LoadBalancerRoutingPolicy(resource_name: 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)
@overload
def LoadBalancerRoutingPolicy(resource_name: str,
args: LoadBalancerRoutingPolicyArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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
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
(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
- 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
(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
- 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
(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
- 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
(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
- 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
Load
Balancer Routing Policy Rule Args] (Updatable) The list of routing rules.
- 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
- 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
(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
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
(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
- 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
(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
- 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
(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
- 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
(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
- 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
(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
- rules
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
(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
- 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
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) 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
- Backend
Set stringName (Updatable) Name of the backend set the listener will forward the traffic to. Example:
backendSetForImages
- 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
- backend
Set StringName (Updatable) Name of the backend set the listener will forward the traffic to. Example:
backendSetForImages
- 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
- backend
Set stringName (Updatable) Name of the backend set the listener will forward the traffic to. Example:
backendSetForImages
- 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
- backend_
set_ strname (Updatable) Name of the backend set the listener will forward the traffic to. Example:
backendSetForImages
- 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
- backend
Set StringName (Updatable) Name of the backend set the listener will forward the traffic to. Example:
backendSetForImages
- 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
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}"
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
oci
Terraform Provider.