upcloud.LoadbalancerResolver
Explore with Pulumi AI
This resource represents load balancer resolver.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as upcloud from "@upcloud/pulumi-upcloud";
const config = new pulumi.Config();
const lbZone = config.get("lbZone") || "fi-hel2";
const lbNetwork = new upcloud.Network("lb_network", {
    name: "lb-test-net",
    zone: lbZone,
    ipNetwork: {
        address: "10.0.0.0/24",
        dhcp: true,
        family: "IPv4",
    },
});
const lb = new upcloud.Loadbalancer("lb", {
    configuredStatus: "started",
    name: "lb-test",
    plan: "development",
    zone: lbZone,
    network: upcloudNetwork.lbNetwork.id,
});
const lbResolver1 = new upcloud.LoadbalancerResolver("lb_resolver_1", {
    loadbalancer: upcloudLoadbalancer.lb.id,
    name: "lb-resolver-1-test",
    cacheInvalid: 10,
    cacheValid: 100,
    retries: 5,
    timeout: 10,
    timeoutRetry: 10,
    nameservers: ["10.0.0.10:53"],
});
import pulumi
import pulumi_upcloud as upcloud
config = pulumi.Config()
lb_zone = config.get("lbZone")
if lb_zone is None:
    lb_zone = "fi-hel2"
lb_network = upcloud.Network("lb_network",
    name="lb-test-net",
    zone=lb_zone,
    ip_network={
        "address": "10.0.0.0/24",
        "dhcp": True,
        "family": "IPv4",
    })
lb = upcloud.Loadbalancer("lb",
    configured_status="started",
    name="lb-test",
    plan="development",
    zone=lb_zone,
    network=upcloud_network["lbNetwork"]["id"])
lb_resolver1 = upcloud.LoadbalancerResolver("lb_resolver_1",
    loadbalancer=upcloud_loadbalancer["lb"]["id"],
    name="lb-resolver-1-test",
    cache_invalid=10,
    cache_valid=100,
    retries=5,
    timeout=10,
    timeout_retry=10,
    nameservers=["10.0.0.10:53"])
package main
import (
	"github.com/UpCloudLtd/pulumi-upcloud/sdk/go/upcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		lbZone := "fi-hel2"
		if param := cfg.Get("lbZone"); param != "" {
			lbZone = param
		}
		_, err := upcloud.NewNetwork(ctx, "lb_network", &upcloud.NetworkArgs{
			Name: pulumi.String("lb-test-net"),
			Zone: pulumi.String(lbZone),
			IpNetwork: &upcloud.NetworkIpNetworkArgs{
				Address: pulumi.String("10.0.0.0/24"),
				Dhcp:    pulumi.Bool(true),
				Family:  pulumi.String("IPv4"),
			},
		})
		if err != nil {
			return err
		}
		_, err = upcloud.NewLoadbalancer(ctx, "lb", &upcloud.LoadbalancerArgs{
			ConfiguredStatus: pulumi.String("started"),
			Name:             pulumi.String("lb-test"),
			Plan:             pulumi.String("development"),
			Zone:             pulumi.String(lbZone),
			Network:          pulumi.Any(upcloudNetwork.LbNetwork.Id),
		})
		if err != nil {
			return err
		}
		_, err = upcloud.NewLoadbalancerResolver(ctx, "lb_resolver_1", &upcloud.LoadbalancerResolverArgs{
			Loadbalancer: pulumi.Any(upcloudLoadbalancer.Lb.Id),
			Name:         pulumi.String("lb-resolver-1-test"),
			CacheInvalid: pulumi.Int(10),
			CacheValid:   pulumi.Int(100),
			Retries:      pulumi.Int(5),
			Timeout:      pulumi.Int(10),
			TimeoutRetry: pulumi.Int(10),
			Nameservers: pulumi.StringArray{
				pulumi.String("10.0.0.10:53"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using UpCloud = UpCloud.Pulumi.UpCloud;
return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var lbZone = config.Get("lbZone") ?? "fi-hel2";
    var lbNetwork = new UpCloud.Network("lb_network", new()
    {
        Name = "lb-test-net",
        Zone = lbZone,
        IpNetwork = new UpCloud.Inputs.NetworkIpNetworkArgs
        {
            Address = "10.0.0.0/24",
            Dhcp = true,
            Family = "IPv4",
        },
    });
    var lb = new UpCloud.Loadbalancer("lb", new()
    {
        ConfiguredStatus = "started",
        Name = "lb-test",
        Plan = "development",
        Zone = lbZone,
        Network = upcloudNetwork.LbNetwork.Id,
    });
    var lbResolver1 = new UpCloud.LoadbalancerResolver("lb_resolver_1", new()
    {
        Loadbalancer = upcloudLoadbalancer.Lb.Id,
        Name = "lb-resolver-1-test",
        CacheInvalid = 10,
        CacheValid = 100,
        Retries = 5,
        Timeout = 10,
        TimeoutRetry = 10,
        Nameservers = new[]
        {
            "10.0.0.10:53",
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.upcloud.Network;
import com.pulumi.upcloud.NetworkArgs;
import com.pulumi.upcloud.inputs.NetworkIpNetworkArgs;
import com.pulumi.upcloud.Loadbalancer;
import com.pulumi.upcloud.LoadbalancerArgs;
import com.pulumi.upcloud.LoadbalancerResolver;
import com.pulumi.upcloud.LoadbalancerResolverArgs;
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 config = ctx.config();
        final var lbZone = config.get("lbZone").orElse("fi-hel2");
        var lbNetwork = new Network("lbNetwork", NetworkArgs.builder()
            .name("lb-test-net")
            .zone(lbZone)
            .ipNetwork(NetworkIpNetworkArgs.builder()
                .address("10.0.0.0/24")
                .dhcp(true)
                .family("IPv4")
                .build())
            .build());
        var lb = new Loadbalancer("lb", LoadbalancerArgs.builder()
            .configuredStatus("started")
            .name("lb-test")
            .plan("development")
            .zone(lbZone)
            .network(upcloudNetwork.lbNetwork().id())
            .build());
        var lbResolver1 = new LoadbalancerResolver("lbResolver1", LoadbalancerResolverArgs.builder()
            .loadbalancer(upcloudLoadbalancer.lb().id())
            .name("lb-resolver-1-test")
            .cacheInvalid(10)
            .cacheValid(100)
            .retries(5)
            .timeout(10)
            .timeoutRetry(10)
            .nameservers("10.0.0.10:53")
            .build());
    }
}
configuration:
  lbZone:
    type: string
    default: fi-hel2
resources:
  lbNetwork:
    type: upcloud:Network
    name: lb_network
    properties:
      name: lb-test-net
      zone: ${lbZone}
      ipNetwork:
        address: 10.0.0.0/24
        dhcp: true
        family: IPv4
  lb:
    type: upcloud:Loadbalancer
    properties:
      configuredStatus: started
      name: lb-test
      plan: development
      zone: ${lbZone}
      network: ${upcloudNetwork.lbNetwork.id}
  lbResolver1:
    type: upcloud:LoadbalancerResolver
    name: lb_resolver_1
    properties:
      loadbalancer: ${upcloudLoadbalancer.lb.id}
      name: lb-resolver-1-test
      cacheInvalid: 10
      cacheValid: 100
      retries: 5
      timeout: 10
      timeoutRetry: 10
      nameservers:
        - 10.0.0.10:53
Create LoadbalancerResolver Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new LoadbalancerResolver(name: string, args: LoadbalancerResolverArgs, opts?: CustomResourceOptions);@overload
def LoadbalancerResolver(resource_name: str,
                         args: LoadbalancerResolverArgs,
                         opts: Optional[ResourceOptions] = None)
@overload
def LoadbalancerResolver(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         cache_invalid: Optional[int] = None,
                         cache_valid: Optional[int] = None,
                         loadbalancer: Optional[str] = None,
                         nameservers: Optional[Sequence[str]] = None,
                         retries: Optional[int] = None,
                         timeout: Optional[int] = None,
                         timeout_retry: Optional[int] = None,
                         name: Optional[str] = None)func NewLoadbalancerResolver(ctx *Context, name string, args LoadbalancerResolverArgs, opts ...ResourceOption) (*LoadbalancerResolver, error)public LoadbalancerResolver(string name, LoadbalancerResolverArgs args, CustomResourceOptions? opts = null)
public LoadbalancerResolver(String name, LoadbalancerResolverArgs args)
public LoadbalancerResolver(String name, LoadbalancerResolverArgs args, CustomResourceOptions options)
type: upcloud:LoadbalancerResolver
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 LoadbalancerResolverArgs
- 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 LoadbalancerResolverArgs
- 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 LoadbalancerResolverArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LoadbalancerResolverArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LoadbalancerResolverArgs
- 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 loadbalancerResolverResource = new UpCloud.LoadbalancerResolver("loadbalancerResolverResource", new()
{
    CacheInvalid = 0,
    CacheValid = 0,
    Loadbalancer = "string",
    Nameservers = new[]
    {
        "string",
    },
    Retries = 0,
    Timeout = 0,
    TimeoutRetry = 0,
    Name = "string",
});
example, err := upcloud.NewLoadbalancerResolver(ctx, "loadbalancerResolverResource", &upcloud.LoadbalancerResolverArgs{
	CacheInvalid: pulumi.Int(0),
	CacheValid:   pulumi.Int(0),
	Loadbalancer: pulumi.String("string"),
	Nameservers: pulumi.StringArray{
		pulumi.String("string"),
	},
	Retries:      pulumi.Int(0),
	Timeout:      pulumi.Int(0),
	TimeoutRetry: pulumi.Int(0),
	Name:         pulumi.String("string"),
})
var loadbalancerResolverResource = new LoadbalancerResolver("loadbalancerResolverResource", LoadbalancerResolverArgs.builder()
    .cacheInvalid(0)
    .cacheValid(0)
    .loadbalancer("string")
    .nameservers("string")
    .retries(0)
    .timeout(0)
    .timeoutRetry(0)
    .name("string")
    .build());
loadbalancer_resolver_resource = upcloud.LoadbalancerResolver("loadbalancerResolverResource",
    cache_invalid=0,
    cache_valid=0,
    loadbalancer="string",
    nameservers=["string"],
    retries=0,
    timeout=0,
    timeout_retry=0,
    name="string")
const loadbalancerResolverResource = new upcloud.LoadbalancerResolver("loadbalancerResolverResource", {
    cacheInvalid: 0,
    cacheValid: 0,
    loadbalancer: "string",
    nameservers: ["string"],
    retries: 0,
    timeout: 0,
    timeoutRetry: 0,
    name: "string",
});
type: upcloud:LoadbalancerResolver
properties:
    cacheInvalid: 0
    cacheValid: 0
    loadbalancer: string
    name: string
    nameservers:
        - string
    retries: 0
    timeout: 0
    timeoutRetry: 0
LoadbalancerResolver 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 LoadbalancerResolver resource accepts the following input properties:
- CacheInvalid int
- Time in seconds to cache invalid results.
- CacheValid int
- Time in seconds to cache valid results.
- Loadbalancer string
- ID of the load balancer to which the resolver is connected.
- Nameservers List<string>
- List of nameserver IP addresses. Nameserver can reside in public internet or in customer private network. Port is optional, if missing then default 53 will be used.
- Retries int
- Number of retries on failure.
- Timeout int
- Timeout for the query in seconds.
- TimeoutRetry int
- Timeout for the query retries in seconds.
- Name string
- The name of the resolver. Must be unique within the service.
- CacheInvalid int
- Time in seconds to cache invalid results.
- CacheValid int
- Time in seconds to cache valid results.
- Loadbalancer string
- ID of the load balancer to which the resolver is connected.
- Nameservers []string
- List of nameserver IP addresses. Nameserver can reside in public internet or in customer private network. Port is optional, if missing then default 53 will be used.
- Retries int
- Number of retries on failure.
- Timeout int
- Timeout for the query in seconds.
- TimeoutRetry int
- Timeout for the query retries in seconds.
- Name string
- The name of the resolver. Must be unique within the service.
- cacheInvalid Integer
- Time in seconds to cache invalid results.
- cacheValid Integer
- Time in seconds to cache valid results.
- loadbalancer String
- ID of the load balancer to which the resolver is connected.
- nameservers List<String>
- List of nameserver IP addresses. Nameserver can reside in public internet or in customer private network. Port is optional, if missing then default 53 will be used.
- retries Integer
- Number of retries on failure.
- timeout Integer
- Timeout for the query in seconds.
- timeoutRetry Integer
- Timeout for the query retries in seconds.
- name String
- The name of the resolver. Must be unique within the service.
- cacheInvalid number
- Time in seconds to cache invalid results.
- cacheValid number
- Time in seconds to cache valid results.
- loadbalancer string
- ID of the load balancer to which the resolver is connected.
- nameservers string[]
- List of nameserver IP addresses. Nameserver can reside in public internet or in customer private network. Port is optional, if missing then default 53 will be used.
- retries number
- Number of retries on failure.
- timeout number
- Timeout for the query in seconds.
- timeoutRetry number
- Timeout for the query retries in seconds.
- name string
- The name of the resolver. Must be unique within the service.
- cache_invalid int
- Time in seconds to cache invalid results.
- cache_valid int
- Time in seconds to cache valid results.
- loadbalancer str
- ID of the load balancer to which the resolver is connected.
- nameservers Sequence[str]
- List of nameserver IP addresses. Nameserver can reside in public internet or in customer private network. Port is optional, if missing then default 53 will be used.
- retries int
- Number of retries on failure.
- timeout int
- Timeout for the query in seconds.
- timeout_retry int
- Timeout for the query retries in seconds.
- name str
- The name of the resolver. Must be unique within the service.
- cacheInvalid Number
- Time in seconds to cache invalid results.
- cacheValid Number
- Time in seconds to cache valid results.
- loadbalancer String
- ID of the load balancer to which the resolver is connected.
- nameservers List<String>
- List of nameserver IP addresses. Nameserver can reside in public internet or in customer private network. Port is optional, if missing then default 53 will be used.
- retries Number
- Number of retries on failure.
- timeout Number
- Timeout for the query in seconds.
- timeoutRetry Number
- Timeout for the query retries in seconds.
- name String
- The name of the resolver. Must be unique within the service.
Outputs
All input properties are implicitly available as output properties. Additionally, the LoadbalancerResolver 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 LoadbalancerResolver Resource
Get an existing LoadbalancerResolver 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?: LoadbalancerResolverState, opts?: CustomResourceOptions): LoadbalancerResolver@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cache_invalid: Optional[int] = None,
        cache_valid: Optional[int] = None,
        loadbalancer: Optional[str] = None,
        name: Optional[str] = None,
        nameservers: Optional[Sequence[str]] = None,
        retries: Optional[int] = None,
        timeout: Optional[int] = None,
        timeout_retry: Optional[int] = None) -> LoadbalancerResolverfunc GetLoadbalancerResolver(ctx *Context, name string, id IDInput, state *LoadbalancerResolverState, opts ...ResourceOption) (*LoadbalancerResolver, error)public static LoadbalancerResolver Get(string name, Input<string> id, LoadbalancerResolverState? state, CustomResourceOptions? opts = null)public static LoadbalancerResolver get(String name, Output<String> id, LoadbalancerResolverState state, CustomResourceOptions options)resources:  _:    type: upcloud:LoadbalancerResolver    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.
- CacheInvalid int
- Time in seconds to cache invalid results.
- CacheValid int
- Time in seconds to cache valid results.
- Loadbalancer string
- ID of the load balancer to which the resolver is connected.
- Name string
- The name of the resolver. Must be unique within the service.
- Nameservers List<string>
- List of nameserver IP addresses. Nameserver can reside in public internet or in customer private network. Port is optional, if missing then default 53 will be used.
- Retries int
- Number of retries on failure.
- Timeout int
- Timeout for the query in seconds.
- TimeoutRetry int
- Timeout for the query retries in seconds.
- CacheInvalid int
- Time in seconds to cache invalid results.
- CacheValid int
- Time in seconds to cache valid results.
- Loadbalancer string
- ID of the load balancer to which the resolver is connected.
- Name string
- The name of the resolver. Must be unique within the service.
- Nameservers []string
- List of nameserver IP addresses. Nameserver can reside in public internet or in customer private network. Port is optional, if missing then default 53 will be used.
- Retries int
- Number of retries on failure.
- Timeout int
- Timeout for the query in seconds.
- TimeoutRetry int
- Timeout for the query retries in seconds.
- cacheInvalid Integer
- Time in seconds to cache invalid results.
- cacheValid Integer
- Time in seconds to cache valid results.
- loadbalancer String
- ID of the load balancer to which the resolver is connected.
- name String
- The name of the resolver. Must be unique within the service.
- nameservers List<String>
- List of nameserver IP addresses. Nameserver can reside in public internet or in customer private network. Port is optional, if missing then default 53 will be used.
- retries Integer
- Number of retries on failure.
- timeout Integer
- Timeout for the query in seconds.
- timeoutRetry Integer
- Timeout for the query retries in seconds.
- cacheInvalid number
- Time in seconds to cache invalid results.
- cacheValid number
- Time in seconds to cache valid results.
- loadbalancer string
- ID of the load balancer to which the resolver is connected.
- name string
- The name of the resolver. Must be unique within the service.
- nameservers string[]
- List of nameserver IP addresses. Nameserver can reside in public internet or in customer private network. Port is optional, if missing then default 53 will be used.
- retries number
- Number of retries on failure.
- timeout number
- Timeout for the query in seconds.
- timeoutRetry number
- Timeout for the query retries in seconds.
- cache_invalid int
- Time in seconds to cache invalid results.
- cache_valid int
- Time in seconds to cache valid results.
- loadbalancer str
- ID of the load balancer to which the resolver is connected.
- name str
- The name of the resolver. Must be unique within the service.
- nameservers Sequence[str]
- List of nameserver IP addresses. Nameserver can reside in public internet or in customer private network. Port is optional, if missing then default 53 will be used.
- retries int
- Number of retries on failure.
- timeout int
- Timeout for the query in seconds.
- timeout_retry int
- Timeout for the query retries in seconds.
- cacheInvalid Number
- Time in seconds to cache invalid results.
- cacheValid Number
- Time in seconds to cache valid results.
- loadbalancer String
- ID of the load balancer to which the resolver is connected.
- name String
- The name of the resolver. Must be unique within the service.
- nameservers List<String>
- List of nameserver IP addresses. Nameserver can reside in public internet or in customer private network. Port is optional, if missing then default 53 will be used.
- retries Number
- Number of retries on failure.
- timeout Number
- Timeout for the query in seconds.
- timeoutRetry Number
- Timeout for the query retries in seconds.
Package Details
- Repository
- upcloud UpCloudLtd/pulumi-upcloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the upcloudTerraform Provider.
