gcorelabs.Loadbalancer
Explore with Pulumi AI
Represent load balancer
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";
const lb = new gcore.index.Gcore_loadbalancer("lb", {
projectId: 1,
regionId: 1,
name: "test",
flavor: "lb1-1-2",
listener: [{
name: "test",
protocol: "HTTP",
protocolPort: 80,
}],
});
import pulumi
import pulumi_gcore as gcore
lb = gcore.index.Gcore_loadbalancer("lb",
project_id=1,
region_id=1,
name=test,
flavor=lb1-1-2,
listener=[{
name: test,
protocol: HTTP,
protocolPort: 80,
}])
package main
import (
"github.com/pulumi/pulumi-gcore/sdk/go/gcore"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gcore.NewGcore_loadbalancer(ctx, "lb", &gcore.Gcore_loadbalancerArgs{
ProjectId: 1,
RegionId: 1,
Name: "test",
Flavor: "lb1-1-2",
Listener: []map[string]interface{}{
map[string]interface{}{
"name": "test",
"protocol": "HTTP",
"protocolPort": 80,
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;
return await Deployment.RunAsync(() =>
{
var lb = new Gcore.Index.Gcore_loadbalancer("lb", new()
{
ProjectId = 1,
RegionId = 1,
Name = "test",
Flavor = "lb1-1-2",
Listener = new[]
{
{
{ "name", "test" },
{ "protocol", "HTTP" },
{ "protocolPort", 80 },
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.gcore_loadbalancer;
import com.pulumi.gcore.Gcore_loadbalancerArgs;
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 lb = new Gcore_loadbalancer("lb", Gcore_loadbalancerArgs.builder()
.projectId(1)
.regionId(1)
.name("test")
.flavor("lb1-1-2")
.listener(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build());
}
}
resources:
lb:
type: gcore:gcore_loadbalancer
properties:
projectId: 1
regionId: 1
name: test
flavor: lb1-1-2
# when upgrading to version 0.2.28 nested listener max length reduced to 1
# //that mean, if you had more than one nested listener and removed them from
# //schema they not delete in the cloud. User has to delete it manually and
# //recreate as gcore_lblistener resource
listener:
- name: test
protocol: HTTP
protocolPort: 80
Create Loadbalancer Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Loadbalancer(name: string, args: LoadbalancerArgs, opts?: CustomResourceOptions);
@overload
def Loadbalancer(resource_name: str,
args: LoadbalancerArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Loadbalancer(resource_name: str,
opts: Optional[ResourceOptions] = None,
listener: Optional[LoadbalancerListenerArgs] = None,
project_id: Optional[float] = None,
last_updated: Optional[str] = None,
loadbalancer_id: Optional[str] = None,
metadata_map: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
flavor: Optional[str] = None,
project_name: Optional[str] = None,
region_id: Optional[float] = None,
region_name: Optional[str] = None,
timeouts: Optional[LoadbalancerTimeoutsArgs] = None,
vip_network_id: Optional[str] = None,
vip_subnet_id: Optional[str] = None)
func NewLoadbalancer(ctx *Context, name string, args LoadbalancerArgs, opts ...ResourceOption) (*Loadbalancer, error)
public Loadbalancer(string name, LoadbalancerArgs args, CustomResourceOptions? opts = null)
public Loadbalancer(String name, LoadbalancerArgs args)
public Loadbalancer(String name, LoadbalancerArgs args, CustomResourceOptions options)
type: gcorelabs:Loadbalancer
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 LoadbalancerArgs
- 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 LoadbalancerArgs
- 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 LoadbalancerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LoadbalancerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LoadbalancerArgs
- 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 loadbalancerResource = new Gcorelabs.Loadbalancer("loadbalancerResource", new()
{
Listener = new Gcorelabs.Inputs.LoadbalancerListenerArgs
{
Name = "string",
Protocol = "string",
ProtocolPort = 0,
Certificate = "string",
CertificateChain = "string",
Id = "string",
InsertXForwarded = false,
PrivateKey = "string",
SecretId = "string",
SniSecretIds = new[]
{
"string",
},
},
ProjectId = 0,
LastUpdated = "string",
LoadbalancerId = "string",
MetadataMap =
{
{ "string", "string" },
},
Name = "string",
Flavor = "string",
ProjectName = "string",
RegionId = 0,
RegionName = "string",
Timeouts = new Gcorelabs.Inputs.LoadbalancerTimeoutsArgs
{
Create = "string",
Delete = "string",
},
VipNetworkId = "string",
VipSubnetId = "string",
});
example, err := gcorelabs.NewLoadbalancer(ctx, "loadbalancerResource", &gcorelabs.LoadbalancerArgs{
Listener: &gcorelabs.LoadbalancerListenerArgs{
Name: pulumi.String("string"),
Protocol: pulumi.String("string"),
ProtocolPort: pulumi.Float64(0),
Certificate: pulumi.String("string"),
CertificateChain: pulumi.String("string"),
Id: pulumi.String("string"),
InsertXForwarded: pulumi.Bool(false),
PrivateKey: pulumi.String("string"),
SecretId: pulumi.String("string"),
SniSecretIds: pulumi.StringArray{
pulumi.String("string"),
},
},
ProjectId: pulumi.Float64(0),
LastUpdated: pulumi.String("string"),
LoadbalancerId: pulumi.String("string"),
MetadataMap: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
Flavor: pulumi.String("string"),
ProjectName: pulumi.String("string"),
RegionId: pulumi.Float64(0),
RegionName: pulumi.String("string"),
Timeouts: &gcorelabs.LoadbalancerTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
},
VipNetworkId: pulumi.String("string"),
VipSubnetId: pulumi.String("string"),
})
var loadbalancerResource = new Loadbalancer("loadbalancerResource", LoadbalancerArgs.builder()
.listener(LoadbalancerListenerArgs.builder()
.name("string")
.protocol("string")
.protocolPort(0)
.certificate("string")
.certificateChain("string")
.id("string")
.insertXForwarded(false)
.privateKey("string")
.secretId("string")
.sniSecretIds("string")
.build())
.projectId(0)
.lastUpdated("string")
.loadbalancerId("string")
.metadataMap(Map.of("string", "string"))
.name("string")
.flavor("string")
.projectName("string")
.regionId(0)
.regionName("string")
.timeouts(LoadbalancerTimeoutsArgs.builder()
.create("string")
.delete("string")
.build())
.vipNetworkId("string")
.vipSubnetId("string")
.build());
loadbalancer_resource = gcorelabs.Loadbalancer("loadbalancerResource",
listener={
"name": "string",
"protocol": "string",
"protocol_port": 0,
"certificate": "string",
"certificate_chain": "string",
"id": "string",
"insert_x_forwarded": False,
"private_key": "string",
"secret_id": "string",
"sni_secret_ids": ["string"],
},
project_id=0,
last_updated="string",
loadbalancer_id="string",
metadata_map={
"string": "string",
},
name="string",
flavor="string",
project_name="string",
region_id=0,
region_name="string",
timeouts={
"create": "string",
"delete": "string",
},
vip_network_id="string",
vip_subnet_id="string")
const loadbalancerResource = new gcorelabs.Loadbalancer("loadbalancerResource", {
listener: {
name: "string",
protocol: "string",
protocolPort: 0,
certificate: "string",
certificateChain: "string",
id: "string",
insertXForwarded: false,
privateKey: "string",
secretId: "string",
sniSecretIds: ["string"],
},
projectId: 0,
lastUpdated: "string",
loadbalancerId: "string",
metadataMap: {
string: "string",
},
name: "string",
flavor: "string",
projectName: "string",
regionId: 0,
regionName: "string",
timeouts: {
create: "string",
"delete": "string",
},
vipNetworkId: "string",
vipSubnetId: "string",
});
type: gcorelabs:Loadbalancer
properties:
flavor: string
lastUpdated: string
listener:
certificate: string
certificateChain: string
id: string
insertXForwarded: false
name: string
privateKey: string
protocol: string
protocolPort: 0
secretId: string
sniSecretIds:
- string
loadbalancerId: string
metadataMap:
string: string
name: string
projectId: 0
projectName: string
regionId: 0
regionName: string
timeouts:
create: string
delete: string
vipNetworkId: string
vipSubnetId: string
Loadbalancer 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 Loadbalancer resource accepts the following input properties:
- Listener
Loadbalancer
Listener - Flavor string
- Last
Updated string - Loadbalancer
Id string - The ID of this resource.
- Metadata
Map Dictionary<string, string> - Name string
- Project
Id double - Project
Name string - Region
Id double - Region
Name string - Timeouts
Loadbalancer
Timeouts - Vip
Network stringId - Vip
Subnet stringId
- Listener
Loadbalancer
Listener Args - Flavor string
- Last
Updated string - Loadbalancer
Id string - The ID of this resource.
- Metadata
Map map[string]string - Name string
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string - Timeouts
Loadbalancer
Timeouts Args - Vip
Network stringId - Vip
Subnet stringId
- listener
Loadbalancer
Listener - flavor String
- last
Updated String - loadbalancer
Id String - The ID of this resource.
- metadata
Map Map<String,String> - name String
- project
Id Double - project
Name String - region
Id Double - region
Name String - timeouts
Loadbalancer
Timeouts - vip
Network StringId - vip
Subnet StringId
- listener
Loadbalancer
Listener - flavor string
- last
Updated string - loadbalancer
Id string - The ID of this resource.
- metadata
Map {[key: string]: string} - name string
- project
Id number - project
Name string - region
Id number - region
Name string - timeouts
Loadbalancer
Timeouts - vip
Network stringId - vip
Subnet stringId
- listener
Loadbalancer
Listener Args - flavor str
- last_
updated str - loadbalancer_
id str - The ID of this resource.
- metadata_
map Mapping[str, str] - name str
- project_
id float - project_
name str - region_
id float - region_
name str - timeouts
Loadbalancer
Timeouts Args - vip_
network_ strid - vip_
subnet_ strid
- listener Property Map
- flavor String
- last
Updated String - loadbalancer
Id String - The ID of this resource.
- metadata
Map Map<String> - name String
- project
Id Number - project
Name String - region
Id Number - region
Name String - timeouts Property Map
- vip
Network StringId - vip
Subnet StringId
Outputs
All input properties are implicitly available as output properties. Additionally, the Loadbalancer resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadata
Read List<LoadbalancerOnlies Metadata Read Only> - Vip
Address string - Load balancer IP address
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadata
Read []LoadbalancerOnlies Metadata Read Only - Vip
Address string - Load balancer IP address
- id String
- The provider-assigned unique ID for this managed resource.
- metadata
Read List<LoadbalancerOnlies Metadata Read Only> - vip
Address String - Load balancer IP address
- id string
- The provider-assigned unique ID for this managed resource.
- metadata
Read LoadbalancerOnlies Metadata Read Only[] - vip
Address string - Load balancer IP address
- id str
- The provider-assigned unique ID for this managed resource.
- metadata_
read_ Sequence[Loadbalanceronlies Metadata Read Only] - vip_
address str - Load balancer IP address
- id String
- The provider-assigned unique ID for this managed resource.
- metadata
Read List<Property Map>Onlies - vip
Address String - Load balancer IP address
Look up Existing Loadbalancer Resource
Get an existing Loadbalancer 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?: LoadbalancerState, opts?: CustomResourceOptions): Loadbalancer
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
flavor: Optional[str] = None,
last_updated: Optional[str] = None,
listener: Optional[LoadbalancerListenerArgs] = None,
loadbalancer_id: Optional[str] = None,
metadata_map: Optional[Mapping[str, str]] = None,
metadata_read_onlies: Optional[Sequence[LoadbalancerMetadataReadOnlyArgs]] = None,
name: Optional[str] = None,
project_id: Optional[float] = None,
project_name: Optional[str] = None,
region_id: Optional[float] = None,
region_name: Optional[str] = None,
timeouts: Optional[LoadbalancerTimeoutsArgs] = None,
vip_address: Optional[str] = None,
vip_network_id: Optional[str] = None,
vip_subnet_id: Optional[str] = None) -> Loadbalancer
func GetLoadbalancer(ctx *Context, name string, id IDInput, state *LoadbalancerState, opts ...ResourceOption) (*Loadbalancer, error)
public static Loadbalancer Get(string name, Input<string> id, LoadbalancerState? state, CustomResourceOptions? opts = null)
public static Loadbalancer get(String name, Output<String> id, LoadbalancerState state, CustomResourceOptions options)
resources: _: type: gcorelabs:Loadbalancer 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.
- Flavor string
- Last
Updated string - Listener
Loadbalancer
Listener - Loadbalancer
Id string - The ID of this resource.
- Metadata
Map Dictionary<string, string> - Metadata
Read List<LoadbalancerOnlies Metadata Read Only> - Name string
- Project
Id double - Project
Name string - Region
Id double - Region
Name string - Timeouts
Loadbalancer
Timeouts - Vip
Address string - Load balancer IP address
- Vip
Network stringId - Vip
Subnet stringId
- Flavor string
- Last
Updated string - Listener
Loadbalancer
Listener Args - Loadbalancer
Id string - The ID of this resource.
- Metadata
Map map[string]string - Metadata
Read []LoadbalancerOnlies Metadata Read Only Args - Name string
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string - Timeouts
Loadbalancer
Timeouts Args - Vip
Address string - Load balancer IP address
- Vip
Network stringId - Vip
Subnet stringId
- flavor String
- last
Updated String - listener
Loadbalancer
Listener - loadbalancer
Id String - The ID of this resource.
- metadata
Map Map<String,String> - metadata
Read List<LoadbalancerOnlies Metadata Read Only> - name String
- project
Id Double - project
Name String - region
Id Double - region
Name String - timeouts
Loadbalancer
Timeouts - vip
Address String - Load balancer IP address
- vip
Network StringId - vip
Subnet StringId
- flavor string
- last
Updated string - listener
Loadbalancer
Listener - loadbalancer
Id string - The ID of this resource.
- metadata
Map {[key: string]: string} - metadata
Read LoadbalancerOnlies Metadata Read Only[] - name string
- project
Id number - project
Name string - region
Id number - region
Name string - timeouts
Loadbalancer
Timeouts - vip
Address string - Load balancer IP address
- vip
Network stringId - vip
Subnet stringId
- flavor str
- last_
updated str - listener
Loadbalancer
Listener Args - loadbalancer_
id str - The ID of this resource.
- metadata_
map Mapping[str, str] - metadata_
read_ Sequence[Loadbalanceronlies Metadata Read Only Args] - name str
- project_
id float - project_
name str - region_
id float - region_
name str - timeouts
Loadbalancer
Timeouts Args - vip_
address str - Load balancer IP address
- vip_
network_ strid - vip_
subnet_ strid
- flavor String
- last
Updated String - listener Property Map
- loadbalancer
Id String - The ID of this resource.
- metadata
Map Map<String> - metadata
Read List<Property Map>Onlies - name String
- project
Id Number - project
Name String - region
Id Number - region
Name String - timeouts Property Map
- vip
Address String - Load balancer IP address
- vip
Network StringId - vip
Subnet StringId
Supporting Types
LoadbalancerListener, LoadbalancerListenerArgs
- Name string
- Protocol string
- Available values is 'HTTP' (currently work, other do not work on ed-8), 'HTTPS', 'TCP', 'UDP'
- Protocol
Port double - Certificate string
- Certificate
Chain string - Id string
- The ID of this resource.
- Insert
XForwarded bool - Private
Key string - Secret
Id string - Sni
Secret List<string>Ids
- Name string
- Protocol string
- Available values is 'HTTP' (currently work, other do not work on ed-8), 'HTTPS', 'TCP', 'UDP'
- Protocol
Port float64 - Certificate string
- Certificate
Chain string - Id string
- The ID of this resource.
- Insert
XForwarded bool - Private
Key string - Secret
Id string - Sni
Secret []stringIds
- name String
- protocol String
- Available values is 'HTTP' (currently work, other do not work on ed-8), 'HTTPS', 'TCP', 'UDP'
- protocol
Port Double - certificate String
- certificate
Chain String - id String
- The ID of this resource.
- insert
XForwarded Boolean - private
Key String - secret
Id String - sni
Secret List<String>Ids
- name string
- protocol string
- Available values is 'HTTP' (currently work, other do not work on ed-8), 'HTTPS', 'TCP', 'UDP'
- protocol
Port number - certificate string
- certificate
Chain string - id string
- The ID of this resource.
- insert
XForwarded boolean - private
Key string - secret
Id string - sni
Secret string[]Ids
- name str
- protocol str
- Available values is 'HTTP' (currently work, other do not work on ed-8), 'HTTPS', 'TCP', 'UDP'
- protocol_
port float - certificate str
- certificate_
chain str - id str
- The ID of this resource.
- insert_
x_ boolforwarded - private_
key str - secret_
id str - sni_
secret_ Sequence[str]ids
- name String
- protocol String
- Available values is 'HTTP' (currently work, other do not work on ed-8), 'HTTPS', 'TCP', 'UDP'
- protocol
Port Number - certificate String
- certificate
Chain String - id String
- The ID of this resource.
- insert
XForwarded Boolean - private
Key String - secret
Id String - sni
Secret List<String>Ids
LoadbalancerMetadataReadOnly, LoadbalancerMetadataReadOnlyArgs
LoadbalancerTimeouts, LoadbalancerTimeoutsArgs
Import
import using <project_id>:<region_id>:<loadbalancer_id>:<listener_id> format, listener_id - nested listener id
$ pulumi import gcorelabs:index/loadbalancer:Loadbalancer loadbalancer1 1:6:447d2959-8ae0-4ca0-8d47-9f050a3637d7:a336f28c-fbb0-4256-9545-e905bed9f48f
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- gcorelabs g-core/terraform-provider-gcorelabs
- License
- Notes
- This Pulumi package is based on the
gcorelabs
Terraform Provider.