1. Packages
  2. Scaleway
  3. API Docs
  4. getLbRoute
Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse

scaleway.getLbRoute

Explore with Pulumi AI

scaleway logo
Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse

    Get information about Scaleway Load-Balancer Routes. For more information, see the documentation.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumi/scaleway";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const ip01 = new scaleway.LoadbalancerIp("ip01", {});
    const lb01 = new scaleway.Loadbalancer("lb01", {
        ipId: ip01.id,
        type: "lb-s",
    });
    const bkd01 = new scaleway.LoadbalancerBackend("bkd01", {
        lbId: lb01.id,
        forwardProtocol: "tcp",
        forwardPort: 80,
        proxyProtocol: "none",
    });
    const frt01 = new scaleway.LoadbalancerFrontend("frt01", {
        lbId: lb01.id,
        backendId: bkd01.id,
        inboundPort: 80,
    });
    const rt01 = new scaleway.LoadbalancerRoute("rt01", {
        frontendId: frt01.id,
        backendId: bkd01.id,
        matchSni: "sni.scaleway.com",
    });
    const byID = scaleway.getLbRouteOutput({
        routeId: rt01.id,
    });
    
    import pulumi
    import pulumi_scaleway as scaleway
    import pulumiverse_scaleway as scaleway
    
    ip01 = scaleway.LoadbalancerIp("ip01")
    lb01 = scaleway.Loadbalancer("lb01",
        ip_id=ip01.id,
        type="lb-s")
    bkd01 = scaleway.LoadbalancerBackend("bkd01",
        lb_id=lb01.id,
        forward_protocol="tcp",
        forward_port=80,
        proxy_protocol="none")
    frt01 = scaleway.LoadbalancerFrontend("frt01",
        lb_id=lb01.id,
        backend_id=bkd01.id,
        inbound_port=80)
    rt01 = scaleway.LoadbalancerRoute("rt01",
        frontend_id=frt01.id,
        backend_id=bkd01.id,
        match_sni="sni.scaleway.com")
    by_id = scaleway.get_lb_route_output(route_id=rt01.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ip01, err := scaleway.NewLoadbalancerIp(ctx, "ip01", nil)
    		if err != nil {
    			return err
    		}
    		lb01, err := scaleway.NewLoadbalancer(ctx, "lb01", &scaleway.LoadbalancerArgs{
    			IpId: ip01.ID(),
    			Type: pulumi.String("lb-s"),
    		})
    		if err != nil {
    			return err
    		}
    		bkd01, err := scaleway.NewLoadbalancerBackend(ctx, "bkd01", &scaleway.LoadbalancerBackendArgs{
    			LbId:            lb01.ID(),
    			ForwardProtocol: pulumi.String("tcp"),
    			ForwardPort:     pulumi.Int(80),
    			ProxyProtocol:   pulumi.String("none"),
    		})
    		if err != nil {
    			return err
    		}
    		frt01, err := scaleway.NewLoadbalancerFrontend(ctx, "frt01", &scaleway.LoadbalancerFrontendArgs{
    			LbId:        lb01.ID(),
    			BackendId:   bkd01.ID(),
    			InboundPort: pulumi.Int(80),
    		})
    		if err != nil {
    			return err
    		}
    		rt01, err := scaleway.NewLoadbalancerRoute(ctx, "rt01", &scaleway.LoadbalancerRouteArgs{
    			FrontendId: frt01.ID(),
    			BackendId:  bkd01.ID(),
    			MatchSni:   pulumi.String("sni.scaleway.com"),
    		})
    		if err != nil {
    			return err
    		}
    		_ = scaleway.GetLbRouteOutput(ctx, scaleway.GetLbRouteOutputArgs{
    			RouteId: rt01.ID(),
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumi.Scaleway;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var ip01 = new Scaleway.LoadbalancerIp("ip01");
    
        var lb01 = new Scaleway.Loadbalancer("lb01", new()
        {
            IpId = ip01.Id,
            Type = "lb-s",
        });
    
        var bkd01 = new Scaleway.LoadbalancerBackend("bkd01", new()
        {
            LbId = lb01.Id,
            ForwardProtocol = "tcp",
            ForwardPort = 80,
            ProxyProtocol = "none",
        });
    
        var frt01 = new Scaleway.LoadbalancerFrontend("frt01", new()
        {
            LbId = lb01.Id,
            BackendId = bkd01.Id,
            InboundPort = 80,
        });
    
        var rt01 = new Scaleway.LoadbalancerRoute("rt01", new()
        {
            FrontendId = frt01.Id,
            BackendId = bkd01.Id,
            MatchSni = "sni.scaleway.com",
        });
    
        var byID = Scaleway.GetLbRoute.Invoke(new()
        {
            RouteId = rt01.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.LoadbalancerIp;
    import com.pulumi.scaleway.Loadbalancer;
    import com.pulumi.scaleway.LoadbalancerArgs;
    import com.pulumi.scaleway.LoadbalancerBackend;
    import com.pulumi.scaleway.LoadbalancerBackendArgs;
    import com.pulumi.scaleway.LoadbalancerFrontend;
    import com.pulumi.scaleway.LoadbalancerFrontendArgs;
    import com.pulumi.scaleway.LoadbalancerRoute;
    import com.pulumi.scaleway.LoadbalancerRouteArgs;
    import com.pulumi.scaleway.ScalewayFunctions;
    import com.pulumi.scaleway.inputs.GetLbRouteArgs;
    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 ip01 = new LoadbalancerIp("ip01");
    
            var lb01 = new Loadbalancer("lb01", LoadbalancerArgs.builder()        
                .ipId(ip01.id())
                .type("lb-s")
                .build());
    
            var bkd01 = new LoadbalancerBackend("bkd01", LoadbalancerBackendArgs.builder()        
                .lbId(lb01.id())
                .forwardProtocol("tcp")
                .forwardPort(80)
                .proxyProtocol("none")
                .build());
    
            var frt01 = new LoadbalancerFrontend("frt01", LoadbalancerFrontendArgs.builder()        
                .lbId(lb01.id())
                .backendId(bkd01.id())
                .inboundPort(80)
                .build());
    
            var rt01 = new LoadbalancerRoute("rt01", LoadbalancerRouteArgs.builder()        
                .frontendId(frt01.id())
                .backendId(bkd01.id())
                .matchSni("sni.scaleway.com")
                .build());
    
            final var byID = ScalewayFunctions.getLbRoute(GetLbRouteArgs.builder()
                .routeId(rt01.id())
                .build());
    
        }
    }
    
    resources:
      ip01:
        type: scaleway:LoadbalancerIp
      lb01:
        type: scaleway:Loadbalancer
        properties:
          ipId: ${ip01.id}
          type: lb-s
      bkd01:
        type: scaleway:LoadbalancerBackend
        properties:
          lbId: ${lb01.id}
          forwardProtocol: tcp
          forwardPort: 80
          proxyProtocol: none
      frt01:
        type: scaleway:LoadbalancerFrontend
        properties:
          lbId: ${lb01.id}
          backendId: ${bkd01.id}
          inboundPort: 80
      rt01:
        type: scaleway:LoadbalancerRoute
        properties:
          frontendId: ${frt01.id}
          backendId: ${bkd01.id}
          matchSni: sni.scaleway.com
    variables:
      byID:
        fn::invoke:
          Function: scaleway:getLbRoute
          Arguments:
            routeId: ${rt01.id}
    

    Using getLbRoute

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getLbRoute(args: GetLbRouteArgs, opts?: InvokeOptions): Promise<GetLbRouteResult>
    function getLbRouteOutput(args: GetLbRouteOutputArgs, opts?: InvokeOptions): Output<GetLbRouteResult>
    def get_lb_route(route_id: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetLbRouteResult
    def get_lb_route_output(route_id: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetLbRouteResult]
    func GetLbRoute(ctx *Context, args *GetLbRouteArgs, opts ...InvokeOption) (*GetLbRouteResult, error)
    func GetLbRouteOutput(ctx *Context, args *GetLbRouteOutputArgs, opts ...InvokeOption) GetLbRouteResultOutput

    > Note: This function is named GetLbRoute in the Go SDK.

    public static class GetLbRoute 
    {
        public static Task<GetLbRouteResult> InvokeAsync(GetLbRouteArgs args, InvokeOptions? opts = null)
        public static Output<GetLbRouteResult> Invoke(GetLbRouteInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLbRouteResult> getLbRoute(GetLbRouteArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: scaleway:index/getLbRoute:getLbRoute
      arguments:
        # arguments dictionary

    The following arguments are supported:

    RouteId string
    The route id.
    RouteId string
    The route id.
    routeId String
    The route id.
    routeId string
    The route id.
    route_id str
    The route id.
    routeId String
    The route id.

    getLbRoute Result

    The following output properties are available:

    BackendId string
    CreatedAt string
    FrontendId string
    Id string
    The provider-assigned unique ID for this managed resource.
    MatchHostHeader string
    MatchSni string
    RouteId string
    UpdatedAt string
    BackendId string
    CreatedAt string
    FrontendId string
    Id string
    The provider-assigned unique ID for this managed resource.
    MatchHostHeader string
    MatchSni string
    RouteId string
    UpdatedAt string
    backendId String
    createdAt String
    frontendId String
    id String
    The provider-assigned unique ID for this managed resource.
    matchHostHeader String
    matchSni String
    routeId String
    updatedAt String
    backendId string
    createdAt string
    frontendId string
    id string
    The provider-assigned unique ID for this managed resource.
    matchHostHeader string
    matchSni string
    routeId string
    updatedAt string
    backend_id str
    created_at str
    frontend_id str
    id str
    The provider-assigned unique ID for this managed resource.
    match_host_header str
    match_sni str
    route_id str
    updated_at str
    backendId String
    createdAt String
    frontendId String
    id String
    The provider-assigned unique ID for this managed resource.
    matchHostHeader String
    matchSni String
    routeId String
    updatedAt String

    Package Details

    Repository
    scaleway pulumiverse/pulumi-scaleway
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the scaleway Terraform Provider.
    scaleway logo
    Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse