Creating an Internet-facing Load Balancer in the Public Cloud

You can create an internet-facing load balancer to distribute inbound network traffic coming from the internet between several virtual machines (VMs) in the public Cloud. VMs behind a load balancer are called backend VMs, or backends.

The security group for this load balancer is automatically created and named outscale-elb-sg, owned by outscale-elb. For more information, see About Security Groups in LBU > Security Groups Configuration for Load Balancers in the Public Cloud.

Creating an Internet-facing Load Balancer in the Public Cloud Using Cockpit v2

Before you begin: (optional) Configure the security group of future backend VMs with the following rules:

  • Allow inbound flows in the TCP protocol on the port you want.

  • Allow the inbound flows coming from the security group of the load balancer (outscale-elb-sg), owned by outscale-elb.

For more information, see Adding Rules to a Security Group.

Open the Create Load Balancer Window

In the Load Balancers dashboard, click IconAddFull Create Load Balancer.
The CREATE LOAD BALANCER dialog box appears.

Configure Your Load Balancer

Choose a Name

  1. In the Name field, type a name for the load balancer.

    • This name must be unique for the whole Region.

    • It must follow domain name rules. That is, it can contain up to 32 alphanumeric characters or hyphens, but cannot start or end with a hyphen.

  2. Click Next.
    The Load Balancer Type screen appears.

Select the Privacy, the Public IP, and the Subregion

  1. From the Privacy list, select Public Cloud.

  2. From the Public IP list, select the public IP you want to associate with the load balancer. If not specified, a public IP owned by 3DS OUTSCALE is associated.

  3. From the Subregion list, select the subregion you want to use.

    By default, the Subregion A is selected.

  4. Click Next.
    The Listeners screen appears.

Configure the Listeners

  1. From the Protocol list, select the routing protocol of the load balancer (HTTP, HTTPS, TCP, SSL).

  2. In the Load balancer port field, type the listening port of the load balancer or select it using the arrows (between 1 and 65535, both included).

  3. In the Backend VM port field, type the listening port of the backend VM or select it using the arrows (between 1 and 65535, both included).

  4. Click Next.
    The Listeners window appears.

Configure a Health Check

  1. From the Protocol list, select the protocol for the URL of the VM (HTTP, HTTPS, TCP, SSL).

  2. In the Port field, type the port number or select it using the arrows (between 1 and 65535, both included).

  3. In the Interval field, type the number of seconds between two requests or select it using the arrows (between 5 and 600, both included).

  4. In the Timeout field, type the maximum waiting time for a response before considering the VM as unhealthy, in seconds, or select it using the arrows (between 2 and 60, both included).

  5. In the Healthy threshold field, type the number of consecutive successful requests before considering the VM as healthy or select it using the arrows (between 2 and 10, both included).

  6. In the Unhealthy threshold field, type the number of consecutive failed requests before considering the VM as unhealthy or select it using the arrows (between 2 and 10, both included).

  7. Click Next.
    The Access Logs screen appears.

Configure Access Logs

The amount of data (in GiB) stored in your OOS bucket will be added to your resource consumption.

  1. (optional) Leave the Customize access logs switch on, then specify the following elements:

    • From the OOS bucket name field, type the name of the OOS bucket for the access logs.

    • (optional) From the OOS bucket prefix field, type the path to the folder of the access logs in your OOS bucket (by default, the root level of your bucket).

    • From the Publication interval list, select the time interval for the publication of access logs in the OOS bucket, in minutes. This value can be either 5 or 60 (by default, 60).

  2. Click Next.
    The Backend VMs screen appears.

Configure Backend VMs

  1. From the Register backend VMs list, select:

    • Select backend VMs to select one or more backend VMs to register with the load balancer.

    • Proceed without backend VM if you don’t want to register a backend VM with the load balancer.

  2. Click Next.
    The Summary screen appears.

Confirm the Load Balancer Creation

  1. Review the settings you have specified for the load balancer.

  2. Click Create.
    The load balancer is created.

    The load balancer is available about 1 minute after its creation.

Creating an Internet-facing Load Balancer in the Public Cloud Using OSC CLI

Before you begin: Configure the security group of future backend VMs with the following rules:

  • Allow inbound flows in the TCP protocol on the port you want.

  • Allow the inbound flows coming from the security group of the load balancer (outscale-elb-sg), owned by outscale-elb.

For more information, see Adding Rules to a Security Group.

The CreateLoadBalancer command creates a load balancer.
The load balancer is created with a unique Domain Name Service (DNS) name. It receives the incoming traffic and routes it to its registered virtual machines (VMs).
By default, this action creates an Internet-facing load balancer, resolving to public IPs. To create an internal load balancer in a Net, resolving to private IPs, use the LoadBalancerType parameter.
You must specify either the Subnets or the SubregionNames parameters.

For more information, see About Load Balancers.

Request sample: Creating an internet-facing load balancer in the public Cloud
$ osc-cli api CreateLoadBalancer --profile "default" \
    --LoadBalancerName "public-lb-example" \
    --SubregionNames '["eu-west-2a"]' \
    --Listeners '[
        {
          "BackendPort": 8080,
          "BackendProtocol": "HTTP",
          "LoadBalancerPort": 8080,
          "LoadBalancerProtocol": "HTTP"
        }
      ]'

This command contains the following attributes that you need to specify:

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • Listeners: One or more listeners to create.

    • BackendPort: (optional) The port on which the backend VM is listening (between 1 and 65535, both included).

    • BackendProtocol: (optional) The protocol for routing traffic to backend VMs (HTTP | HTTPS | TCP | SSL).

    • LoadBalancerPort: (optional) The port on which the load balancer is listening (between 1 and 65535, both included).

    • LoadBalancerProtocol: (optional) The routing protocol (HTTP | HTTPS | TCP | SSL).

    • ServerCertificateId: (optional) The OUTSCALE Resource Name (ORN) of the server certificate. For more information, see Resource Identifiers > OUTSCALE Resource Names (ORNs).

  • LoadBalancerName: The unique name of the load balancer, with a maximum length of 32 alphanumeric characters and dashes (-). This name must not start or end with a dash.

  • LoadBalancerType: (optional) The type of load balancer: internet-facing or internal. Use this parameter only for load balancers in a Net.

  • PublicIp: (optional) (internet-facing only) The public IP you want to associate with the load balancer. If not specified, a public IP owned by 3DS OUTSCALE is associated.

  • SubregionNames: (optional) (public Cloud only) The Subregion in which you want to create the load balancer. Regardless of this Subregion, the load balancer can distribute traffic to all Subregions. This parameter is required in the public Cloud.

  • Tags: (optional) One or more tags assigned to the load balancer.

    • Key: (optional) The key of the tag, with a minimum of 1 character.

    • Value: (optional) The value of the tag, between 0 and 255 characters.

The CreateLoadBalancer command returns the following elements:

  • LoadBalancer: Information about the load balancer.

    • AccessLog: Information about access logs.

      • IsEnabled: If true, access logs are enabled for your load balancer. If false, they are not. If you set this to true in your request, the OsuBucketName parameter is required.

      • OsuBucketName: The name of the OOS bucket for the access logs.

      • OsuBucketPrefix: The path to the folder of the access logs in your OOS bucket (by default, the root level of your bucket).

      • PublicationInterval: The time interval for the publication of access logs in the OOS bucket, in minutes. This value can be either 5 or 60 (by default, 60).

    • ApplicationStickyCookiePolicies: The stickiness policies defined for the load balancer.

      • CookieName: The name of the application cookie used for stickiness.

      • PolicyName: The mnemonic name for the policy being created. The name must be unique within a set of policies for this load balancer.

    • BackendIps: One or more public IPs of backend VMs.

    • BackendVmIds: One or more IDs of backend VMs for the load balancer.

    • DnsName: The DNS name of the load balancer.

    • HealthCheck: Information about the health check configuration.

      • CheckInterval: The number of seconds between two requests (between 5 and 600 both included).

      • HealthyThreshold: The number of consecutive successful requests before considering the VM as healthy (between 2 and 10 both included).

      • Path: If you use the HTTP or HTTPS protocols, the request URL path.

      • Port: The port number (between 1 and 65535, both included).

      • Protocol: The protocol for the URL of the VM (HTTP | HTTPS | TCP | SSL).

      • Timeout: The maximum waiting time for a response before considering the VM as unhealthy, in seconds (between 2 and 60 both included).

      • UnhealthyThreshold: The number of consecutive failed requests before considering the VM as unhealthy (between 2 and 10 both included).

    • Listeners: The listeners for the load balancer.

      • BackendPort: The port on which the backend VM is listening (between 1 and 65535, both included).

      • BackendProtocol: The protocol for routing traffic to backend VMs (HTTP | HTTPS | TCP | SSL).

      • LoadBalancerPort: The port on which the load balancer is listening (between 1 and 65535, both included).

      • LoadBalancerProtocol: The routing protocol (HTTP | HTTPS | TCP | SSL).

      • PolicyNames: The names of the policies. If there are no policies enabled, the list is empty.

      • ServerCertificateId: The OUTSCALE Resource Name (ORN) of the server certificate. For more information, see Resource Identifiers > OUTSCALE Resource Names (ORNs).

    • LoadBalancerName: The name of the load balancer.

    • LoadBalancerStickyCookiePolicies: The policies defined for the load balancer.

      • CookieExpirationPeriod: The time period, in seconds, after which the cookie should be considered stale.
        If 1, the stickiness session lasts for the duration of the browser session.

      • PolicyName: The name of the stickiness policy.

    • LoadBalancerType: The type of load balancer. Valid only for load balancers in a Net.
      If LoadBalancerType is internet-facing, the load balancer has a public DNS name that resolves to a public IP.
      If LoadBalancerType is internal, the load balancer has a public DNS name that resolves to a private IP.

    • NetId: The ID of the Net for the load balancer.

    • PublicIp: (internet-facing only) The public IP associated with the load balancer.

    • SecuredCookies: Whether secure cookies are enabled for the load balancer.

    • SecurityGroups: One or more IDs of security groups for the load balancers. Valid only for load balancers in a Net.

    • SourceSecurityGroup: Information about the source security group of the load balancer, which you can use as part of your inbound rules for your registered VMs.
      To only allow traffic from load balancers, add a security group rule that specifies this source security group as the inbound source.

      • SecurityGroupAccountId: The account ID of the owner of the security group.

      • SecurityGroupName: The name of the security group.

    • Subnets: The ID of the Subnet in which the load balancer was created.

    • SubregionNames: The ID of the Subregion in which the load balancer was created.

    • Tags: One or more tags associated with the load balancer.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample: Creating an internet-facing load balancer in the public Cloud
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "LoadBalancer": {
    "Tags": [],
    "SourceSecurityGroup": {
      "SecurityGroupName": "outscale-elb-sg",
      "SecurityGroupAccountId": "outscale-elb"
    },
    "SecuredCookies": false,
    "Subnets": [],
    "BackendVmIds": [],
    "ApplicationStickyCookiePolicies": [],
    "LoadBalancerType": "internet-facing",
    "AccessLog": {
      "PublicationInterval": 60,
      "IsEnabled": false
    },
    "DnsName": "public-lb-example.123456789.eu-west-2.lbu.outscale.com",
    "HealthCheck": {
      "UnhealthyThreshold": 2,
      "Timeout": 5,
      "CheckInterval": 30,
      "Protocol": "TCP",
      "HealthyThreshold": 10,
      "Port": 8080
    },
    "LoadBalancerStickyCookiePolicies": [],
    "SubregionNames": [
      "eu-west-2a"
    ],
    "Listeners": [
      {
        "BackendPort": 8080,
        "BackendProtocol": "HTTP",
        "LoadBalancerPort": 8080,
        "LoadBalancerProtocol": "HTTP"
      }
    ],
    "LoadBalancerName": "public-lb-example"
  }
}

Creating an Internet-facing Load Balancer in the Public Cloud Using oapi-cli

Before you begin: Configure the security group of future backend VMs with the following rules:

  • Allow inbound flows in the TCP protocol on the port you want.

  • Allow the inbound flows coming from the security group of the load balancer (outscale-elb-sg), owned by outscale-elb.

For more information, see Adding Rules to a Security Group.

The CreateLoadBalancer command creates a load balancer.
The load balancer is created with a unique Domain Name Service (DNS) name. It receives the incoming traffic and routes it to its registered virtual machines (VMs).
By default, this action creates an Internet-facing load balancer, resolving to public IPs. To create an internal load balancer in a Net, resolving to private IPs, use the LoadBalancerType parameter.
You must specify either the Subnets or the SubregionNames parameters.

For more information, see About Load Balancers.

Request sample: Creating an internet-facing load balancer in the public Cloud
$ oapi-cli --profile "default" CreateLoadBalancer \
    --LoadBalancerName "public-lb-example" \
    --SubregionNames '["eu-west-2a"]' \
    --Listeners '[
        {
          "BackendPort": 8080,
          "BackendProtocol": "HTTP",
          "LoadBalancerPort": 8080,
          "LoadBalancerProtocol": "HTTP"
        }
      ]'

This command contains the following attributes that you need to specify:

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • Listeners: One or more listeners to create.

    • BackendPort: (optional) The port on which the backend VM is listening (between 1 and 65535, both included).

    • BackendProtocol: (optional) The protocol for routing traffic to backend VMs (HTTP | HTTPS | TCP | SSL).

    • LoadBalancerPort: (optional) The port on which the load balancer is listening (between 1 and 65535, both included).

    • LoadBalancerProtocol: (optional) The routing protocol (HTTP | HTTPS | TCP | SSL).

    • ServerCertificateId: (optional) The OUTSCALE Resource Name (ORN) of the server certificate. For more information, see Resource Identifiers > OUTSCALE Resource Names (ORNs).

  • LoadBalancerName: The unique name of the load balancer, with a maximum length of 32 alphanumeric characters and dashes (-). This name must not start or end with a dash.

  • LoadBalancerType: (optional) The type of load balancer: internet-facing or internal. Use this parameter only for load balancers in a Net.

  • PublicIp: (optional) (internet-facing only) The public IP you want to associate with the load balancer. If not specified, a public IP owned by 3DS OUTSCALE is associated.

  • SubregionNames: (optional) (public Cloud only) The Subregion in which you want to create the load balancer. Regardless of this Subregion, the load balancer can distribute traffic to all Subregions. This parameter is required in the public Cloud.

  • Tags: (optional) One or more tags assigned to the load balancer.

    • Key: (optional) The key of the tag, with a minimum of 1 character.

    • Value: (optional) The value of the tag, between 0 and 255 characters.

The CreateLoadBalancer command returns the following elements:

  • LoadBalancer: Information about the load balancer.

    • AccessLog: Information about access logs.

      • IsEnabled: If true, access logs are enabled for your load balancer. If false, they are not. If you set this to true in your request, the OsuBucketName parameter is required.

      • OsuBucketName: The name of the OOS bucket for the access logs.

      • OsuBucketPrefix: The path to the folder of the access logs in your OOS bucket (by default, the root level of your bucket).

      • PublicationInterval: The time interval for the publication of access logs in the OOS bucket, in minutes. This value can be either 5 or 60 (by default, 60).

    • ApplicationStickyCookiePolicies: The stickiness policies defined for the load balancer.

      • CookieName: The name of the application cookie used for stickiness.

      • PolicyName: The mnemonic name for the policy being created. The name must be unique within a set of policies for this load balancer.

    • BackendIps: One or more public IPs of backend VMs.

    • BackendVmIds: One or more IDs of backend VMs for the load balancer.

    • DnsName: The DNS name of the load balancer.

    • HealthCheck: Information about the health check configuration.

      • CheckInterval: The number of seconds between two requests (between 5 and 600 both included).

      • HealthyThreshold: The number of consecutive successful requests before considering the VM as healthy (between 2 and 10 both included).

      • Path: If you use the HTTP or HTTPS protocols, the request URL path.

      • Port: The port number (between 1 and 65535, both included).

      • Protocol: The protocol for the URL of the VM (HTTP | HTTPS | TCP | SSL).

      • Timeout: The maximum waiting time for a response before considering the VM as unhealthy, in seconds (between 2 and 60 both included).

      • UnhealthyThreshold: The number of consecutive failed requests before considering the VM as unhealthy (between 2 and 10 both included).

    • Listeners: The listeners for the load balancer.

      • BackendPort: The port on which the backend VM is listening (between 1 and 65535, both included).

      • BackendProtocol: The protocol for routing traffic to backend VMs (HTTP | HTTPS | TCP | SSL).

      • LoadBalancerPort: The port on which the load balancer is listening (between 1 and 65535, both included).

      • LoadBalancerProtocol: The routing protocol (HTTP | HTTPS | TCP | SSL).

      • PolicyNames: The names of the policies. If there are no policies enabled, the list is empty.

      • ServerCertificateId: The OUTSCALE Resource Name (ORN) of the server certificate. For more information, see Resource Identifiers > OUTSCALE Resource Names (ORNs).

    • LoadBalancerName: The name of the load balancer.

    • LoadBalancerStickyCookiePolicies: The policies defined for the load balancer.

      • CookieExpirationPeriod: The time period, in seconds, after which the cookie should be considered stale.
        If 1, the stickiness session lasts for the duration of the browser session.

      • PolicyName: The name of the stickiness policy.

    • LoadBalancerType: The type of load balancer. Valid only for load balancers in a Net.
      If LoadBalancerType is internet-facing, the load balancer has a public DNS name that resolves to a public IP.
      If LoadBalancerType is internal, the load balancer has a public DNS name that resolves to a private IP.

    • NetId: The ID of the Net for the load balancer.

    • PublicIp: (internet-facing only) The public IP associated with the load balancer.

    • SecuredCookies: Whether secure cookies are enabled for the load balancer.

    • SecurityGroups: One or more IDs of security groups for the load balancers. Valid only for load balancers in a Net.

    • SourceSecurityGroup: Information about the source security group of the load balancer, which you can use as part of your inbound rules for your registered VMs.
      To only allow traffic from load balancers, add a security group rule that specifies this source security group as the inbound source.

      • SecurityGroupAccountId: The account ID of the owner of the security group.

      • SecurityGroupName: The name of the security group.

    • Subnets: The ID of the Subnet in which the load balancer was created.

    • SubregionNames: The ID of the Subregion in which the load balancer was created.

    • Tags: One or more tags associated with the load balancer.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample: Creating an internet-facing load balancer in the public Cloud
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "LoadBalancer": {
    "Tags": [],
    "SourceSecurityGroup": {
      "SecurityGroupName": "outscale-elb-sg",
      "SecurityGroupAccountId": "outscale-elb"
    },
    "SecuredCookies": false,
    "Subnets": [],
    "BackendVmIds": [],
    "ApplicationStickyCookiePolicies": [],
    "LoadBalancerType": "internet-facing",
    "AccessLog": {
      "PublicationInterval": 60,
      "IsEnabled": false
    },
    "DnsName": "public-lb-example.123456789.eu-west-2.lbu.outscale.com",
    "HealthCheck": {
      "UnhealthyThreshold": 2,
      "Timeout": 5,
      "CheckInterval": 30,
      "Protocol": "TCP",
      "HealthyThreshold": 10,
      "Port": 8080
    },
    "LoadBalancerStickyCookiePolicies": [],
    "SubregionNames": [
      "eu-west-2a"
    ],
    "Listeners": [
      {
        "BackendPort": 8080,
        "BackendProtocol": "HTTP",
        "LoadBalancerPort": 8080,
        "LoadBalancerProtocol": "HTTP"
      }
    ],
    "LoadBalancerName": "public-lb-example"
  }
}

Creating an Internet-facing Load Balancer in the Public Cloud Using AWS CLI

Before you begin:

  • Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • Configure the security group of future backend instances with the following rules:

    • Allow inbound flows in the TCP protocol on the port you want.

    • Allow the inbound flows coming from the security group of the load balancer (outscale-elb-sg), owned by outscale-elb.

      For more information, see Adding Rules to a Security Group.

To create an internet-facing load balancer in the public Cloud, use the create-load-balancer command following this syntax:

Request sample
$ aws elb create-load-balancer \
    --profile YOUR_PROFILE \
    --load-balancer-name my-load-balancer \
    --listeners Protocol=TCP,LoadBalancerPort=80,InstanceProtocol=TCP,InstancePort=58 \
    --availability-zones eu-west-2a \
    --endpoint https://lbu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • load-balancer-name: The name of the load balancer.

    • This name must be unique for the whole Region.

    • It must follow domain name rules. That is, it can contain up to 32 alphanumeric characters or hyphens, but cannot start or end with a hyphen.

  • listeners: One or more listeners for the load balancer. This attribute requires the following elements for each listener:

    To add several listeners, separate each of them with a space.

    • Protocol: The routing protocol of the load balancer (HTTP, HTTPS, TCP or SSL).

    • LoadBalancerPort: The port on which the load balancer is listening (between 1 and 65535, both included).

    • InstancePort: The port on which the backend instances are listening (between 1 and 65535, both included).

    • (optional) InstanceProtocol: The protocol for routing traffic to backend instances (HTTP, HTTPS, TCP or SSL).

    • (optional) SSLCertificateId: The OUTSCALE Resource Name (ORN) of an SSL certificate. For more information, see Getting Information About Your Server Certificates.

      An SSL certificate is required only if the load balancer protocol is HTTPS or SSL.

      For more information about how to configure your listener when using SSL certificates, see Configuring a Load Balancer for SSL Termination or SSL Passthrough.

  • availability-zones: The Availability Zone (AZ) in which you want to create the load balancer. Regardless of this AZ, the load balancer can distribute traffic to all AZs.

  • endpoint: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.

The create-load-balancer command returns the following element:

  • DNSName: The DNS name assigned to the load balancer.

Result sample
{
    "DNSName": "my_load_balancer_1234567890.lbu.eu-west-2.outscale.com"
}

Related Pages

Corresponding API Methods

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.