1. Packages
  2. OVH
  3. API Docs
  4. IpLoadBalancing
  5. Refresh
OVHCloud v0.50.1 published on Friday, Sep 27, 2024 by OVHcloud

ovh.IpLoadBalancing.Refresh

Explore with Pulumi AI

ovh logo
OVHCloud v0.50.1 published on Friday, Sep 27, 2024 by OVHcloud

    Applies changes from other ovh_iploadbalancing_* resources to the production configuration of loadbalancers.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    import * as ovh from "@pulumi/ovh";
    
    const lb = ovh.IpLoadBalancing.getIpLoadBalancing({
        serviceName: "ip-1.2.3.4",
        state: "ok",
    });
    const farmname = new ovh.iploadbalancing.TcpFarm("farmname", {
        port: 8080,
        serviceName: lb.then(lb => lb.serviceName),
        zone: "all",
    });
    const backend = new ovh.iploadbalancing.TcpFarmServer("backend", {
        address: "4.5.6.7",
        backup: true,
        displayName: "mybackend",
        farmId: farmname.id,
        port: 80,
        probe: true,
        proxyProtocolVersion: "v2",
        serviceName: lb.then(lb => lb.serviceName),
        ssl: false,
        status: "active",
        weight: 2,
    });
    const mylb = new ovh.iploadbalancing.Refresh("mylb", {
        keepers: [[backend].map(__item => __item.address)],
        serviceName: lb.then(lb => lb.serviceName),
    });
    
    import pulumi
    import pulumi_ovh as ovh
    
    lb = ovh.IpLoadBalancing.get_ip_load_balancing(service_name="ip-1.2.3.4",
        state="ok")
    farmname = ovh.ip_load_balancing.TcpFarm("farmname",
        port=8080,
        service_name=lb.service_name,
        zone="all")
    backend = ovh.ip_load_balancing.TcpFarmServer("backend",
        address="4.5.6.7",
        backup=True,
        display_name="mybackend",
        farm_id=farmname.id,
        port=80,
        probe=True,
        proxy_protocol_version="v2",
        service_name=lb.service_name,
        ssl=False,
        status="active",
        weight=2)
    mylb = ovh.ip_load_balancing.Refresh("mylb",
        keepers=[[__item.address for __item in [backend]]],
        service_name=lb.service_name)
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/go/ovh/IpLoadBalancing"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    lb, err := IpLoadBalancing.GetIpLoadBalancing(ctx, &iploadbalancing.GetIpLoadBalancingArgs{
    ServiceName: pulumi.StringRef("ip-1.2.3.4"),
    State: pulumi.StringRef("ok"),
    }, nil);
    if err != nil {
    return err
    }
    farmname, err := IpLoadBalancing.NewTcpFarm(ctx, "farmname", &IpLoadBalancing.TcpFarmArgs{
    Port: pulumi.Int(8080),
    ServiceName: pulumi.String(lb.ServiceName),
    Zone: pulumi.String("all"),
    })
    if err != nil {
    return err
    }
    backend, err := IpLoadBalancing.NewTcpFarmServer(ctx, "backend", &IpLoadBalancing.TcpFarmServerArgs{
    Address: pulumi.String("4.5.6.7"),
    Backup: pulumi.Bool(true),
    DisplayName: pulumi.String("mybackend"),
    FarmId: farmname.ID(),
    Port: pulumi.Int(80),
    Probe: pulumi.Bool(true),
    ProxyProtocolVersion: pulumi.String("v2"),
    ServiceName: pulumi.String(lb.ServiceName),
    Ssl: pulumi.Bool(false),
    Status: pulumi.String("active"),
    Weight: pulumi.Int(2),
    })
    if err != nil {
    return err
    }
    _, err = IpLoadBalancing.NewRefresh(ctx, "mylb", &IpLoadBalancing.RefreshArgs{
    Keepers: pulumi.StringArray{
    pulumi.String(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ #-resources-ovh:IpLoadBalancing-refresh:Refresh.pp:23,16-35)),
    },
    ServiceName: pulumi.String(lb.ServiceName),
    })
    if err != nil {
    return err
    }
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var lb = Ovh.IpLoadBalancing.GetIpLoadBalancing.Invoke(new()
        {
            ServiceName = "ip-1.2.3.4",
            State = "ok",
        });
    
        var farmname = new Ovh.IpLoadBalancing.TcpFarm("farmname", new()
        {
            Port = 8080,
            ServiceName = lb.Apply(getIpLoadBalancingResult => getIpLoadBalancingResult.ServiceName),
            Zone = "all",
        });
    
        var backend = new Ovh.IpLoadBalancing.TcpFarmServer("backend", new()
        {
            Address = "4.5.6.7",
            Backup = true,
            DisplayName = "mybackend",
            FarmId = farmname.Id,
            Port = 80,
            Probe = true,
            ProxyProtocolVersion = "v2",
            ServiceName = lb.Apply(getIpLoadBalancingResult => getIpLoadBalancingResult.ServiceName),
            Ssl = false,
            Status = "active",
            Weight = 2,
        });
    
        var mylb = new Ovh.IpLoadBalancing.Refresh("mylb", new()
        {
            Keepers = new[]
            {
                new[]
                {
                    backend,
                }.Select(__item => __item.Address).ToList(),
            },
            ServiceName = lb.Apply(getIpLoadBalancingResult => getIpLoadBalancingResult.ServiceName),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.IpLoadBalancing.IpLoadBalancingFunctions;
    import com.pulumi.ovh.IpLoadBalancing.inputs.GetIpLoadBalancingArgs;
    import com.pulumi.ovh.IpLoadBalancing.TcpFarm;
    import com.pulumi.ovh.IpLoadBalancing.TcpFarmArgs;
    import com.pulumi.ovh.IpLoadBalancing.TcpFarmServer;
    import com.pulumi.ovh.IpLoadBalancing.TcpFarmServerArgs;
    import com.pulumi.ovh.IpLoadBalancing.Refresh;
    import com.pulumi.ovh.IpLoadBalancing.RefreshArgs;
    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) {
            final var lb = IpLoadBalancingFunctions.getIpLoadBalancing(GetIpLoadBalancingArgs.builder()
                .serviceName("ip-1.2.3.4")
                .state("ok")
                .build());
    
            var farmname = new TcpFarm("farmname", TcpFarmArgs.builder()
                .port(8080)
                .serviceName(lb.applyValue(getIpLoadBalancingResult -> getIpLoadBalancingResult.serviceName()))
                .zone("all")
                .build());
    
            var backend = new TcpFarmServer("backend", TcpFarmServerArgs.builder()
                .address("4.5.6.7")
                .backup(true)
                .displayName("mybackend")
                .farmId(farmname.id())
                .port(80)
                .probe(true)
                .proxyProtocolVersion("v2")
                .serviceName(lb.applyValue(getIpLoadBalancingResult -> getIpLoadBalancingResult.serviceName()))
                .ssl(false)
                .status("active")
                .weight(2)
                .build());
    
            var mylb = new Refresh("mylb", RefreshArgs.builder()
                .keepers(backend.stream().map(element -> element.address()).collect(toList()))
                .serviceName(lb.applyValue(getIpLoadBalancingResult -> getIpLoadBalancingResult.serviceName()))
                .build());
    
        }
    }
    
    Coming soon!
    

    Create Refresh Resource

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

    Constructor syntax

    new Refresh(name: string, args: RefreshArgs, opts?: CustomResourceOptions);
    @overload
    def Refresh(resource_name: str,
                args: RefreshArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Refresh(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                keepers: Optional[Sequence[str]] = None,
                service_name: Optional[str] = None)
    func NewRefresh(ctx *Context, name string, args RefreshArgs, opts ...ResourceOption) (*Refresh, error)
    public Refresh(string name, RefreshArgs args, CustomResourceOptions? opts = null)
    public Refresh(String name, RefreshArgs args)
    public Refresh(String name, RefreshArgs args, CustomResourceOptions options)
    
    type: ovh:IpLoadBalancing:Refresh
    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 RefreshArgs
    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 RefreshArgs
    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 RefreshArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RefreshArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RefreshArgs
    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 refreshResource = new Ovh.IpLoadBalancing.Refresh("refreshResource", new()
    {
        Keepers = new[]
        {
            "string",
        },
        ServiceName = "string",
    });
    
    example, err := IpLoadBalancing.NewRefresh(ctx, "refreshResource", &IpLoadBalancing.RefreshArgs{
    	Keepers: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ServiceName: pulumi.String("string"),
    })
    
    var refreshResource = new Refresh("refreshResource", RefreshArgs.builder()
        .keepers("string")
        .serviceName("string")
        .build());
    
    refresh_resource = ovh.ip_load_balancing.Refresh("refreshResource",
        keepers=["string"],
        service_name="string")
    
    const refreshResource = new ovh.iploadbalancing.Refresh("refreshResource", {
        keepers: ["string"],
        serviceName: "string",
    });
    
    type: ovh:IpLoadBalancing:Refresh
    properties:
        keepers:
            - string
        serviceName: string
    

    Refresh 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 Refresh resource accepts the following input properties:

    Keepers List<string>
    List of values tracked to trigger refresh, used also to form implicit dependencies
    ServiceName string
    The internal name of your IP load balancing
    Keepers []string
    List of values tracked to trigger refresh, used also to form implicit dependencies
    ServiceName string
    The internal name of your IP load balancing
    keepers List<String>
    List of values tracked to trigger refresh, used also to form implicit dependencies
    serviceName String
    The internal name of your IP load balancing
    keepers string[]
    List of values tracked to trigger refresh, used also to form implicit dependencies
    serviceName string
    The internal name of your IP load balancing
    keepers Sequence[str]
    List of values tracked to trigger refresh, used also to form implicit dependencies
    service_name str
    The internal name of your IP load balancing
    keepers List<String>
    List of values tracked to trigger refresh, used also to form implicit dependencies
    serviceName String
    The internal name of your IP load balancing

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Refresh Resource

    Get an existing Refresh 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?: RefreshState, opts?: CustomResourceOptions): Refresh
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            keepers: Optional[Sequence[str]] = None,
            service_name: Optional[str] = None) -> Refresh
    func GetRefresh(ctx *Context, name string, id IDInput, state *RefreshState, opts ...ResourceOption) (*Refresh, error)
    public static Refresh Get(string name, Input<string> id, RefreshState? state, CustomResourceOptions? opts = null)
    public static Refresh get(String name, Output<String> id, RefreshState 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.
    The following state arguments are supported:
    Keepers List<string>
    List of values tracked to trigger refresh, used also to form implicit dependencies
    ServiceName string
    The internal name of your IP load balancing
    Keepers []string
    List of values tracked to trigger refresh, used also to form implicit dependencies
    ServiceName string
    The internal name of your IP load balancing
    keepers List<String>
    List of values tracked to trigger refresh, used also to form implicit dependencies
    serviceName String
    The internal name of your IP load balancing
    keepers string[]
    List of values tracked to trigger refresh, used also to form implicit dependencies
    serviceName string
    The internal name of your IP load balancing
    keepers Sequence[str]
    List of values tracked to trigger refresh, used also to form implicit dependencies
    service_name str
    The internal name of your IP load balancing
    keepers List<String>
    List of values tracked to trigger refresh, used also to form implicit dependencies
    serviceName String
    The internal name of your IP load balancing

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    OVHCloud v0.50.1 published on Friday, Sep 27, 2024 by OVHcloud