outscale.LoadBalancerVms
Explore with Pulumi AI
Manages load balancer VMs.
For more information on this resource, see the User Guide.
For more information on this resource actions, see the API documentation.
Example Usage
Required resources
import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";
const outscaleVm01 = new outscale.Vm("outscaleVm01", {
imageId: "ami-12345678",
vmType: "tinav5.c1r1p2",
keypairName: _var.keypair_name,
});
const outscaleVm02 = new outscale.Vm("outscaleVm02", {
imageId: _var.image_id,
vmType: _var.vm_type,
keypairName: _var.keypair_name,
});
const loadBalancer01 = new outscale.LoadBalancer("loadBalancer01", {
loadBalancerName: "load-balancer-for-backend-vms",
subregionNames: [`${_var.region}a`],
listeners: [{
backendPort: 80,
backendProtocol: "TCP",
loadBalancerProtocol: "TCP",
loadBalancerPort: 80,
}],
tags: [{
key: "name",
value: "outscale_load_balancer01",
}],
});
import pulumi
import pulumi_outscale as outscale
outscale_vm01 = outscale.Vm("outscaleVm01",
image_id="ami-12345678",
vm_type="tinav5.c1r1p2",
keypair_name=var["keypair_name"])
outscale_vm02 = outscale.Vm("outscaleVm02",
image_id=var["image_id"],
vm_type=var["vm_type"],
keypair_name=var["keypair_name"])
load_balancer01 = outscale.LoadBalancer("loadBalancer01",
load_balancer_name="load-balancer-for-backend-vms",
subregion_names=[f"{var['region']}a"],
listeners=[{
"backend_port": 80,
"backend_protocol": "TCP",
"load_balancer_protocol": "TCP",
"load_balancer_port": 80,
}],
tags=[{
"key": "name",
"value": "outscale_load_balancer01",
}])
package main
import (
"fmt"
"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := outscale.NewVm(ctx, "outscaleVm01", &outscale.VmArgs{
ImageId: pulumi.String("ami-12345678"),
VmType: pulumi.String("tinav5.c1r1p2"),
KeypairName: pulumi.Any(_var.Keypair_name),
})
if err != nil {
return err
}
_, err = outscale.NewVm(ctx, "outscaleVm02", &outscale.VmArgs{
ImageId: pulumi.Any(_var.Image_id),
VmType: pulumi.Any(_var.Vm_type),
KeypairName: pulumi.Any(_var.Keypair_name),
})
if err != nil {
return err
}
_, err = outscale.NewLoadBalancer(ctx, "loadBalancer01", &outscale.LoadBalancerArgs{
LoadBalancerName: pulumi.String("load-balancer-for-backend-vms"),
SubregionNames: pulumi.StringArray{
pulumi.Sprintf("%va", _var.Region),
},
Listeners: outscale.LoadBalancerListenerArray{
&outscale.LoadBalancerListenerArgs{
BackendPort: pulumi.Float64(80),
BackendProtocol: pulumi.String("TCP"),
LoadBalancerProtocol: pulumi.String("TCP"),
LoadBalancerPort: pulumi.Float64(80),
},
},
Tags: outscale.LoadBalancerTagArray{
&outscale.LoadBalancerTagArgs{
Key: pulumi.String("name"),
Value: pulumi.String("outscale_load_balancer01"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;
return await Deployment.RunAsync(() =>
{
var outscaleVm01 = new Outscale.Vm("outscaleVm01", new()
{
ImageId = "ami-12345678",
VmType = "tinav5.c1r1p2",
KeypairName = @var.Keypair_name,
});
var outscaleVm02 = new Outscale.Vm("outscaleVm02", new()
{
ImageId = @var.Image_id,
VmType = @var.Vm_type,
KeypairName = @var.Keypair_name,
});
var loadBalancer01 = new Outscale.LoadBalancer("loadBalancer01", new()
{
LoadBalancerName = "load-balancer-for-backend-vms",
SubregionNames = new[]
{
$"{@var.Region}a",
},
Listeners = new[]
{
new Outscale.Inputs.LoadBalancerListenerArgs
{
BackendPort = 80,
BackendProtocol = "TCP",
LoadBalancerProtocol = "TCP",
LoadBalancerPort = 80,
},
},
Tags = new[]
{
new Outscale.Inputs.LoadBalancerTagArgs
{
Key = "name",
Value = "outscale_load_balancer01",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.Vm;
import com.pulumi.outscale.VmArgs;
import com.pulumi.outscale.LoadBalancer;
import com.pulumi.outscale.LoadBalancerArgs;
import com.pulumi.outscale.inputs.LoadBalancerListenerArgs;
import com.pulumi.outscale.inputs.LoadBalancerTagArgs;
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 outscaleVm01 = new Vm("outscaleVm01", VmArgs.builder()
.imageId("ami-12345678")
.vmType("tinav5.c1r1p2")
.keypairName(var_.keypair_name())
.build());
var outscaleVm02 = new Vm("outscaleVm02", VmArgs.builder()
.imageId(var_.image_id())
.vmType(var_.vm_type())
.keypairName(var_.keypair_name())
.build());
var loadBalancer01 = new LoadBalancer("loadBalancer01", LoadBalancerArgs.builder()
.loadBalancerName("load-balancer-for-backend-vms")
.subregionNames(String.format("%sa", var_.region()))
.listeners(LoadBalancerListenerArgs.builder()
.backendPort(80)
.backendProtocol("TCP")
.loadBalancerProtocol("TCP")
.loadBalancerPort(80)
.build())
.tags(LoadBalancerTagArgs.builder()
.key("name")
.value("outscale_load_balancer01")
.build())
.build());
}
}
resources:
outscaleVm01:
type: outscale:Vm
properties:
imageId: ami-12345678
vmType: tinav5.c1r1p2
keypairName: ${var.keypair_name}
outscaleVm02:
type: outscale:Vm
properties:
imageId: ${var.image_id}
vmType: ${var.vm_type}
keypairName: ${var.keypair_name}
loadBalancer01:
type: outscale:LoadBalancer
properties:
loadBalancerName: load-balancer-for-backend-vms
subregionNames:
- ${var.region}a
listeners:
- backendPort: 80
backendProtocol: TCP
loadBalancerProtocol: TCP
loadBalancerPort: 80
tags:
- key: name
value: outscale_load_balancer01
Register VMs with a load balancer
import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";
const outscaleLoadBalancerVms01 = new outscale.LoadBalancerVms("outscaleLoadBalancerVms01", {
loadBalancerName: "load-balancer-for-backend-vms",
backendVmIds: [
outscale_vm.outscale_vm01.vm_id,
outscale_vm.outscale_vm_02.vm_id,
],
});
import pulumi
import pulumi_outscale as outscale
outscale_load_balancer_vms01 = outscale.LoadBalancerVms("outscaleLoadBalancerVms01",
load_balancer_name="load-balancer-for-backend-vms",
backend_vm_ids=[
outscale_vm["outscale_vm01"]["vm_id"],
outscale_vm["outscale_vm_02"]["vm_id"],
])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := outscale.NewLoadBalancerVms(ctx, "outscaleLoadBalancerVms01", &outscale.LoadBalancerVmsArgs{
LoadBalancerName: pulumi.String("load-balancer-for-backend-vms"),
BackendVmIds: pulumi.StringArray{
outscale_vm.Outscale_vm01.Vm_id,
outscale_vm.Outscale_vm_02.Vm_id,
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;
return await Deployment.RunAsync(() =>
{
var outscaleLoadBalancerVms01 = new Outscale.LoadBalancerVms("outscaleLoadBalancerVms01", new()
{
LoadBalancerName = "load-balancer-for-backend-vms",
BackendVmIds = new[]
{
outscale_vm.Outscale_vm01.Vm_id,
outscale_vm.Outscale_vm_02.Vm_id,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.LoadBalancerVms;
import com.pulumi.outscale.LoadBalancerVmsArgs;
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 outscaleLoadBalancerVms01 = new LoadBalancerVms("outscaleLoadBalancerVms01", LoadBalancerVmsArgs.builder()
.loadBalancerName("load-balancer-for-backend-vms")
.backendVmIds(
outscale_vm.outscale_vm01().vm_id(),
outscale_vm.outscale_vm_02().vm_id())
.build());
}
}
resources:
outscaleLoadBalancerVms01:
type: outscale:LoadBalancerVms
properties:
loadBalancerName: load-balancer-for-backend-vms
backendVmIds:
- ${outscale_vm.outscale_vm01.vm_id}
- ${outscale_vm.outscale_vm_02.vm_id}
Register IPs with a load balancer
import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";
const outscaleLoadBalancerVms01 = new outscale.LoadBalancerVms("outscaleLoadBalancerVms01", {
loadBalancerName: "load-balancer-for-backend-vms",
backendIps: [
outscale_vm.outscale_vm01.public_ip,
outscale_vm.outscale_vm02.public_ip,
],
});
import pulumi
import pulumi_outscale as outscale
outscale_load_balancer_vms01 = outscale.LoadBalancerVms("outscaleLoadBalancerVms01",
load_balancer_name="load-balancer-for-backend-vms",
backend_ips=[
outscale_vm["outscale_vm01"]["public_ip"],
outscale_vm["outscale_vm02"]["public_ip"],
])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := outscale.NewLoadBalancerVms(ctx, "outscaleLoadBalancerVms01", &outscale.LoadBalancerVmsArgs{
LoadBalancerName: pulumi.String("load-balancer-for-backend-vms"),
BackendIps: pulumi.StringArray{
outscale_vm.Outscale_vm01.Public_ip,
outscale_vm.Outscale_vm02.Public_ip,
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;
return await Deployment.RunAsync(() =>
{
var outscaleLoadBalancerVms01 = new Outscale.LoadBalancerVms("outscaleLoadBalancerVms01", new()
{
LoadBalancerName = "load-balancer-for-backend-vms",
BackendIps = new[]
{
outscale_vm.Outscale_vm01.Public_ip,
outscale_vm.Outscale_vm02.Public_ip,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.LoadBalancerVms;
import com.pulumi.outscale.LoadBalancerVmsArgs;
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 outscaleLoadBalancerVms01 = new LoadBalancerVms("outscaleLoadBalancerVms01", LoadBalancerVmsArgs.builder()
.loadBalancerName("load-balancer-for-backend-vms")
.backendIps(
outscale_vm.outscale_vm01().public_ip(),
outscale_vm.outscale_vm02().public_ip())
.build());
}
}
resources:
outscaleLoadBalancerVms01:
type: outscale:LoadBalancerVms
properties:
loadBalancerName: load-balancer-for-backend-vms
backendIps:
- ${outscale_vm.outscale_vm01.public_ip}
- ${outscale_vm.outscale_vm02.public_ip}
Create LoadBalancerVms Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new LoadBalancerVms(name: string, args: LoadBalancerVmsArgs, opts?: CustomResourceOptions);
@overload
def LoadBalancerVms(resource_name: str,
args: LoadBalancerVmsArgs,
opts: Optional[ResourceOptions] = None)
@overload
def LoadBalancerVms(resource_name: str,
opts: Optional[ResourceOptions] = None,
load_balancer_name: Optional[str] = None,
backend_ips: Optional[Sequence[str]] = None,
backend_vm_ids: Optional[Sequence[str]] = None,
load_balancer_vms_id: Optional[str] = None)
func NewLoadBalancerVms(ctx *Context, name string, args LoadBalancerVmsArgs, opts ...ResourceOption) (*LoadBalancerVms, error)
public LoadBalancerVms(string name, LoadBalancerVmsArgs args, CustomResourceOptions? opts = null)
public LoadBalancerVms(String name, LoadBalancerVmsArgs args)
public LoadBalancerVms(String name, LoadBalancerVmsArgs args, CustomResourceOptions options)
type: outscale:LoadBalancerVms
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 LoadBalancerVmsArgs
- 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 LoadBalancerVmsArgs
- 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 LoadBalancerVmsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LoadBalancerVmsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LoadBalancerVmsArgs
- 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 loadBalancerVmsResource = new Outscale.LoadBalancerVms("loadBalancerVmsResource", new()
{
LoadBalancerName = "string",
BackendIps = new[]
{
"string",
},
BackendVmIds = new[]
{
"string",
},
LoadBalancerVmsId = "string",
});
example, err := outscale.NewLoadBalancerVms(ctx, "loadBalancerVmsResource", &outscale.LoadBalancerVmsArgs{
LoadBalancerName: pulumi.String("string"),
BackendIps: pulumi.StringArray{
pulumi.String("string"),
},
BackendVmIds: pulumi.StringArray{
pulumi.String("string"),
},
LoadBalancerVmsId: pulumi.String("string"),
})
var loadBalancerVmsResource = new LoadBalancerVms("loadBalancerVmsResource", LoadBalancerVmsArgs.builder()
.loadBalancerName("string")
.backendIps("string")
.backendVmIds("string")
.loadBalancerVmsId("string")
.build());
load_balancer_vms_resource = outscale.LoadBalancerVms("loadBalancerVmsResource",
load_balancer_name="string",
backend_ips=["string"],
backend_vm_ids=["string"],
load_balancer_vms_id="string")
const loadBalancerVmsResource = new outscale.LoadBalancerVms("loadBalancerVmsResource", {
loadBalancerName: "string",
backendIps: ["string"],
backendVmIds: ["string"],
loadBalancerVmsId: "string",
});
type: outscale:LoadBalancerVms
properties:
backendIps:
- string
backendVmIds:
- string
loadBalancerName: string
loadBalancerVmsId: string
LoadBalancerVms 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 LoadBalancerVms resource accepts the following input properties:
- Load
Balancer stringName - The name of the load balancer.
- Backend
Ips List<string> - Backend
Vm List<string>Ids - One or more IDs of backend VMs. Specifying the same ID several times has no effect as each backend VM has equal weight.
- Load
Balancer stringVms Id
- Load
Balancer stringName - The name of the load balancer.
- Backend
Ips []string - Backend
Vm []stringIds - One or more IDs of backend VMs. Specifying the same ID several times has no effect as each backend VM has equal weight.
- Load
Balancer stringVms Id
- load
Balancer StringName - The name of the load balancer.
- backend
Ips List<String> - backend
Vm List<String>Ids - One or more IDs of backend VMs. Specifying the same ID several times has no effect as each backend VM has equal weight.
- load
Balancer StringVms Id
- load
Balancer stringName - The name of the load balancer.
- backend
Ips string[] - backend
Vm string[]Ids - One or more IDs of backend VMs. Specifying the same ID several times has no effect as each backend VM has equal weight.
- load
Balancer stringVms Id
- load_
balancer_ strname - The name of the load balancer.
- backend_
ips Sequence[str] - backend_
vm_ Sequence[str]ids - One or more IDs of backend VMs. Specifying the same ID several times has no effect as each backend VM has equal weight.
- load_
balancer_ strvms_ id
- load
Balancer StringName - The name of the load balancer.
- backend
Ips List<String> - backend
Vm List<String>Ids - One or more IDs of backend VMs. Specifying the same ID several times has no effect as each backend VM has equal weight.
- load
Balancer StringVms Id
Outputs
All input properties are implicitly available as output properties. Additionally, the LoadBalancerVms resource produces the following output properties:
- id str
- The provider-assigned unique ID for this managed resource.
- request_
id str
Look up Existing LoadBalancerVms Resource
Get an existing LoadBalancerVms 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?: LoadBalancerVmsState, opts?: CustomResourceOptions): LoadBalancerVms
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
backend_ips: Optional[Sequence[str]] = None,
backend_vm_ids: Optional[Sequence[str]] = None,
load_balancer_name: Optional[str] = None,
load_balancer_vms_id: Optional[str] = None,
request_id: Optional[str] = None) -> LoadBalancerVms
func GetLoadBalancerVms(ctx *Context, name string, id IDInput, state *LoadBalancerVmsState, opts ...ResourceOption) (*LoadBalancerVms, error)
public static LoadBalancerVms Get(string name, Input<string> id, LoadBalancerVmsState? state, CustomResourceOptions? opts = null)
public static LoadBalancerVms get(String name, Output<String> id, LoadBalancerVmsState state, CustomResourceOptions options)
resources: _: type: outscale:LoadBalancerVms get: id: ${id}
- 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.
- Backend
Ips List<string> - Backend
Vm List<string>Ids - One or more IDs of backend VMs. Specifying the same ID several times has no effect as each backend VM has equal weight.
- Load
Balancer stringName - The name of the load balancer.
- Load
Balancer stringVms Id - Request
Id string
- Backend
Ips []string - Backend
Vm []stringIds - One or more IDs of backend VMs. Specifying the same ID several times has no effect as each backend VM has equal weight.
- Load
Balancer stringName - The name of the load balancer.
- Load
Balancer stringVms Id - Request
Id string
- backend
Ips List<String> - backend
Vm List<String>Ids - One or more IDs of backend VMs. Specifying the same ID several times has no effect as each backend VM has equal weight.
- load
Balancer StringName - The name of the load balancer.
- load
Balancer StringVms Id - request
Id String
- backend
Ips string[] - backend
Vm string[]Ids - One or more IDs of backend VMs. Specifying the same ID several times has no effect as each backend VM has equal weight.
- load
Balancer stringName - The name of the load balancer.
- load
Balancer stringVms Id - request
Id string
- backend_
ips Sequence[str] - backend_
vm_ Sequence[str]ids - One or more IDs of backend VMs. Specifying the same ID several times has no effect as each backend VM has equal weight.
- load_
balancer_ strname - The name of the load balancer.
- load_
balancer_ strvms_ id - request_
id str
- backend
Ips List<String> - backend
Vm List<String>Ids - One or more IDs of backend VMs. Specifying the same ID several times has no effect as each backend VM has equal weight.
- load
Balancer StringName - The name of the load balancer.
- load
Balancer StringVms Id - request
Id String
Package Details
- Repository
- outscale outscale/terraform-provider-outscale
- License
- Notes
- This Pulumi package is based on the
outscale
Terraform Provider.