ionoscloud.Ipfailover
Explore with Pulumi AI
Manages IP Failover groups on IonosCloud.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
import * as random from "@pulumi/random";
const exampleDatacenter = new ionoscloud.Datacenter("exampleDatacenter", {
location: "us/las",
description: "Datacenter Description",
secAuthProtection: false,
});
const exampleIpblock = new ionoscloud.Ipblock("exampleIpblock", {
location: "us/las",
size: 1,
});
const exampleLan = new ionoscloud.Lan("exampleLan", {
datacenterId: exampleDatacenter.datacenterId,
"public": true,
});
const serverImagePassword = new random.index.Random_password("serverImagePassword", {
length: 16,
special: false,
});
const exampleServer = new ionoscloud.Server("exampleServer", {
datacenterId: exampleDatacenter.datacenterId,
cores: 1,
ram: 1024,
imageName: "Ubuntu-20.04",
imagePassword: serverImagePassword.result,
volume: {
name: "system",
size: 14,
diskType: "SSD",
},
nic: {
lan: 1,
dhcp: true,
firewallActive: true,
ips: [exampleIpblock.ips[0]],
},
});
const exampleIpfailover = new ionoscloud.Ipfailover("exampleIpfailover", {
datacenterId: exampleDatacenter.datacenterId,
lanId: exampleLan.lanId,
ip: exampleIpblock.ips[0],
nicuuid: exampleServer.primaryNic,
}, {
dependsOn: [exampleLan],
});
import pulumi
import pulumi_ionoscloud as ionoscloud
import pulumi_random as random
example_datacenter = ionoscloud.Datacenter("exampleDatacenter",
location="us/las",
description="Datacenter Description",
sec_auth_protection=False)
example_ipblock = ionoscloud.Ipblock("exampleIpblock",
location="us/las",
size=1)
example_lan = ionoscloud.Lan("exampleLan",
datacenter_id=example_datacenter.datacenter_id,
public=True)
server_image_password = random.index.Random_password("serverImagePassword",
length=16,
special=False)
example_server = ionoscloud.Server("exampleServer",
datacenter_id=example_datacenter.datacenter_id,
cores=1,
ram=1024,
image_name="Ubuntu-20.04",
image_password=server_image_password["result"],
volume={
"name": "system",
"size": 14,
"disk_type": "SSD",
},
nic={
"lan": 1,
"dhcp": True,
"firewall_active": True,
"ips": [example_ipblock.ips[0]],
})
example_ipfailover = ionoscloud.Ipfailover("exampleIpfailover",
datacenter_id=example_datacenter.datacenter_id,
lan_id=example_lan.lan_id,
ip=example_ipblock.ips[0],
nicuuid=example_server.primary_nic,
opts = pulumi.ResourceOptions(depends_on=[example_lan]))
package main
import (
"github.com/pulumi/pulumi-random/sdk/go/random"
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleDatacenter, err := ionoscloud.NewDatacenter(ctx, "exampleDatacenter", &ionoscloud.DatacenterArgs{
Location: pulumi.String("us/las"),
Description: pulumi.String("Datacenter Description"),
SecAuthProtection: pulumi.Bool(false),
})
if err != nil {
return err
}
exampleIpblock, err := ionoscloud.NewIpblock(ctx, "exampleIpblock", &ionoscloud.IpblockArgs{
Location: pulumi.String("us/las"),
Size: pulumi.Float64(1),
})
if err != nil {
return err
}
exampleLan, err := ionoscloud.NewLan(ctx, "exampleLan", &ionoscloud.LanArgs{
DatacenterId: exampleDatacenter.DatacenterId,
Public: pulumi.Bool(true),
})
if err != nil {
return err
}
serverImagePassword, err := random.NewRandom_password(ctx, "serverImagePassword", &random.Random_passwordArgs{
Length: 16,
Special: false,
})
if err != nil {
return err
}
exampleServer, err := ionoscloud.NewServer(ctx, "exampleServer", &ionoscloud.ServerArgs{
DatacenterId: exampleDatacenter.DatacenterId,
Cores: pulumi.Float64(1),
Ram: pulumi.Float64(1024),
ImageName: pulumi.String("Ubuntu-20.04"),
ImagePassword: serverImagePassword.Result,
Volume: &ionoscloud.ServerVolumeArgs{
Name: pulumi.String("system"),
Size: pulumi.Float64(14),
DiskType: pulumi.String("SSD"),
},
Nic: &ionoscloud.ServerNicArgs{
Lan: pulumi.Float64(1),
Dhcp: pulumi.Bool(true),
FirewallActive: pulumi.Bool(true),
Ips: pulumi.StringArray{
exampleIpblock.Ips.ApplyT(func(ips []string) (string, error) {
return ips[0], nil
}).(pulumi.StringOutput),
},
},
})
if err != nil {
return err
}
_, err = ionoscloud.NewIpfailover(ctx, "exampleIpfailover", &ionoscloud.IpfailoverArgs{
DatacenterId: exampleDatacenter.DatacenterId,
LanId: exampleLan.LanId,
Ip: exampleIpblock.Ips.ApplyT(func(ips []string) (string, error) {
return ips[0], nil
}).(pulumi.StringOutput),
Nicuuid: exampleServer.PrimaryNic,
}, pulumi.DependsOn([]pulumi.Resource{
exampleLan,
}))
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var exampleDatacenter = new Ionoscloud.Datacenter("exampleDatacenter", new()
{
Location = "us/las",
Description = "Datacenter Description",
SecAuthProtection = false,
});
var exampleIpblock = new Ionoscloud.Ipblock("exampleIpblock", new()
{
Location = "us/las",
Size = 1,
});
var exampleLan = new Ionoscloud.Lan("exampleLan", new()
{
DatacenterId = exampleDatacenter.DatacenterId,
Public = true,
});
var serverImagePassword = new Random.Index.Random_password("serverImagePassword", new()
{
Length = 16,
Special = false,
});
var exampleServer = new Ionoscloud.Server("exampleServer", new()
{
DatacenterId = exampleDatacenter.DatacenterId,
Cores = 1,
Ram = 1024,
ImageName = "Ubuntu-20.04",
ImagePassword = serverImagePassword.Result,
Volume = new Ionoscloud.Inputs.ServerVolumeArgs
{
Name = "system",
Size = 14,
DiskType = "SSD",
},
Nic = new Ionoscloud.Inputs.ServerNicArgs
{
Lan = 1,
Dhcp = true,
FirewallActive = true,
Ips = new[]
{
exampleIpblock.Ips.Apply(ips => ips[0]),
},
},
});
var exampleIpfailover = new Ionoscloud.Ipfailover("exampleIpfailover", new()
{
DatacenterId = exampleDatacenter.DatacenterId,
LanId = exampleLan.LanId,
Ip = exampleIpblock.Ips.Apply(ips => ips[0]),
Nicuuid = exampleServer.PrimaryNic,
}, new CustomResourceOptions
{
DependsOn =
{
exampleLan,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.Datacenter;
import com.pulumi.ionoscloud.DatacenterArgs;
import com.pulumi.ionoscloud.Ipblock;
import com.pulumi.ionoscloud.IpblockArgs;
import com.pulumi.ionoscloud.Lan;
import com.pulumi.ionoscloud.LanArgs;
import com.pulumi.random.random_password;
import com.pulumi.random.Random_passwordArgs;
import com.pulumi.ionoscloud.Server;
import com.pulumi.ionoscloud.ServerArgs;
import com.pulumi.ionoscloud.inputs.ServerVolumeArgs;
import com.pulumi.ionoscloud.inputs.ServerNicArgs;
import com.pulumi.ionoscloud.Ipfailover;
import com.pulumi.ionoscloud.IpfailoverArgs;
import com.pulumi.resources.CustomResourceOptions;
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 exampleDatacenter = new Datacenter("exampleDatacenter", DatacenterArgs.builder()
.location("us/las")
.description("Datacenter Description")
.secAuthProtection(false)
.build());
var exampleIpblock = new Ipblock("exampleIpblock", IpblockArgs.builder()
.location("us/las")
.size(1)
.build());
var exampleLan = new Lan("exampleLan", LanArgs.builder()
.datacenterId(exampleDatacenter.datacenterId())
.public_(true)
.build());
var serverImagePassword = new Random_password("serverImagePassword", Random_passwordArgs.builder()
.length(16)
.special(false)
.build());
var exampleServer = new Server("exampleServer", ServerArgs.builder()
.datacenterId(exampleDatacenter.datacenterId())
.cores(1)
.ram(1024)
.imageName("Ubuntu-20.04")
.imagePassword(serverImagePassword.result())
.volume(ServerVolumeArgs.builder()
.name("system")
.size(14)
.diskType("SSD")
.build())
.nic(ServerNicArgs.builder()
.lan("1")
.dhcp(true)
.firewallActive(true)
.ips(exampleIpblock.ips().applyValue(ips -> ips[0]))
.build())
.build());
var exampleIpfailover = new Ipfailover("exampleIpfailover", IpfailoverArgs.builder()
.datacenterId(exampleDatacenter.datacenterId())
.lanId(exampleLan.lanId())
.ip(exampleIpblock.ips().applyValue(ips -> ips[0]))
.nicuuid(exampleServer.primaryNic())
.build(), CustomResourceOptions.builder()
.dependsOn(exampleLan)
.build());
}
}
resources:
exampleDatacenter:
type: ionoscloud:Datacenter
properties:
location: us/las
description: Datacenter Description
secAuthProtection: false
exampleIpblock:
type: ionoscloud:Ipblock
properties:
location: us/las
size: 1
exampleLan:
type: ionoscloud:Lan
properties:
datacenterId: ${exampleDatacenter.datacenterId}
public: true
exampleServer:
type: ionoscloud:Server
properties:
datacenterId: ${exampleDatacenter.datacenterId}
cores: 1
ram: 1024
imageName: Ubuntu-20.04
imagePassword: ${serverImagePassword.result}
volume:
name: system
size: 14
diskType: SSD
nic:
lan: '1'
dhcp: true
firewallActive: true
ips:
- ${exampleIpblock.ips[0]}
exampleIpfailover:
type: ionoscloud:Ipfailover
properties:
datacenterId: ${exampleDatacenter.datacenterId}
lanId: ${exampleLan.lanId}
ip: ${exampleIpblock.ips[0]}
nicuuid: ${exampleServer.primaryNic}
options:
dependsOn:
- ${exampleLan}
serverImagePassword:
type: random:random_password
properties:
length: 16
special: false
A note on multiple NICs on an IP Failover
If you want to add a secondary NIC to an IP Failover, follow these steps:
- Creating NIC A with failover IP on LAN 1
- Create NIC B unde the same LAN but with a different IP
- Create the IP Failover on LAN 1 with NIC A and failover IP of NIC A (A becomes now “master”, no slaves)
- Update NIC B IP to be the failover IP ( B becomes now a slave, A remains master)
After this you can create a new NIC C, NIC D and so on, in LAN 1, directly with the failover IP.
Please check examples for a full example with the above steps.
Create Ipfailover Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Ipfailover(name: string, args: IpfailoverArgs, opts?: CustomResourceOptions);
@overload
def Ipfailover(resource_name: str,
args: IpfailoverArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Ipfailover(resource_name: str,
opts: Optional[ResourceOptions] = None,
datacenter_id: Optional[str] = None,
ip: Optional[str] = None,
lan_id: Optional[str] = None,
nicuuid: Optional[str] = None,
ipfailover_id: Optional[str] = None,
timeouts: Optional[IpfailoverTimeoutsArgs] = None)
func NewIpfailover(ctx *Context, name string, args IpfailoverArgs, opts ...ResourceOption) (*Ipfailover, error)
public Ipfailover(string name, IpfailoverArgs args, CustomResourceOptions? opts = null)
public Ipfailover(String name, IpfailoverArgs args)
public Ipfailover(String name, IpfailoverArgs args, CustomResourceOptions options)
type: ionoscloud:Ipfailover
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 IpfailoverArgs
- 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 IpfailoverArgs
- 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 IpfailoverArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IpfailoverArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IpfailoverArgs
- 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 ipfailoverResource = new Ionoscloud.Ipfailover("ipfailoverResource", new()
{
DatacenterId = "string",
Ip = "string",
LanId = "string",
Nicuuid = "string",
IpfailoverId = "string",
Timeouts = new Ionoscloud.Inputs.IpfailoverTimeoutsArgs
{
Create = "string",
Default = "string",
Delete = "string",
Update = "string",
},
});
example, err := ionoscloud.NewIpfailover(ctx, "ipfailoverResource", &ionoscloud.IpfailoverArgs{
DatacenterId: pulumi.String("string"),
Ip: pulumi.String("string"),
LanId: pulumi.String("string"),
Nicuuid: pulumi.String("string"),
IpfailoverId: pulumi.String("string"),
Timeouts: &ionoscloud.IpfailoverTimeoutsArgs{
Create: pulumi.String("string"),
Default: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
var ipfailoverResource = new Ipfailover("ipfailoverResource", IpfailoverArgs.builder()
.datacenterId("string")
.ip("string")
.lanId("string")
.nicuuid("string")
.ipfailoverId("string")
.timeouts(IpfailoverTimeoutsArgs.builder()
.create("string")
.default_("string")
.delete("string")
.update("string")
.build())
.build());
ipfailover_resource = ionoscloud.Ipfailover("ipfailoverResource",
datacenter_id="string",
ip="string",
lan_id="string",
nicuuid="string",
ipfailover_id="string",
timeouts={
"create": "string",
"default": "string",
"delete": "string",
"update": "string",
})
const ipfailoverResource = new ionoscloud.Ipfailover("ipfailoverResource", {
datacenterId: "string",
ip: "string",
lanId: "string",
nicuuid: "string",
ipfailoverId: "string",
timeouts: {
create: "string",
"default": "string",
"delete": "string",
update: "string",
},
});
type: ionoscloud:Ipfailover
properties:
datacenterId: string
ip: string
ipfailoverId: string
lanId: string
nicuuid: string
timeouts:
create: string
default: string
delete: string
update: string
Ipfailover 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 Ipfailover resource accepts the following input properties:
- Datacenter
Id string - [string] The ID of a Virtual Data Center.
- Ip string
- [string] The reserved IP address to be used in the IP failover group.
- Lan
Id string - [string] The ID of a LAN.
- Nicuuid string
- The UUID of the master NIC
- Ipfailover
Id string - Timeouts
Ipfailover
Timeouts
- Datacenter
Id string - [string] The ID of a Virtual Data Center.
- Ip string
- [string] The reserved IP address to be used in the IP failover group.
- Lan
Id string - [string] The ID of a LAN.
- Nicuuid string
- The UUID of the master NIC
- Ipfailover
Id string - Timeouts
Ipfailover
Timeouts Args
- datacenter
Id String - [string] The ID of a Virtual Data Center.
- ip String
- [string] The reserved IP address to be used in the IP failover group.
- lan
Id String - [string] The ID of a LAN.
- nicuuid String
- The UUID of the master NIC
- ipfailover
Id String - timeouts
Ipfailover
Timeouts
- datacenter
Id string - [string] The ID of a Virtual Data Center.
- ip string
- [string] The reserved IP address to be used in the IP failover group.
- lan
Id string - [string] The ID of a LAN.
- nicuuid string
- The UUID of the master NIC
- ipfailover
Id string - timeouts
Ipfailover
Timeouts
- datacenter_
id str - [string] The ID of a Virtual Data Center.
- ip str
- [string] The reserved IP address to be used in the IP failover group.
- lan_
id str - [string] The ID of a LAN.
- nicuuid str
- The UUID of the master NIC
- ipfailover_
id str - timeouts
Ipfailover
Timeouts Args
- datacenter
Id String - [string] The ID of a Virtual Data Center.
- ip String
- [string] The reserved IP address to be used in the IP failover group.
- lan
Id String - [string] The ID of a LAN.
- nicuuid String
- The UUID of the master NIC
- ipfailover
Id String - timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the Ipfailover 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 Ipfailover Resource
Get an existing Ipfailover 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?: IpfailoverState, opts?: CustomResourceOptions): Ipfailover
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
datacenter_id: Optional[str] = None,
ip: Optional[str] = None,
ipfailover_id: Optional[str] = None,
lan_id: Optional[str] = None,
nicuuid: Optional[str] = None,
timeouts: Optional[IpfailoverTimeoutsArgs] = None) -> Ipfailover
func GetIpfailover(ctx *Context, name string, id IDInput, state *IpfailoverState, opts ...ResourceOption) (*Ipfailover, error)
public static Ipfailover Get(string name, Input<string> id, IpfailoverState? state, CustomResourceOptions? opts = null)
public static Ipfailover get(String name, Output<String> id, IpfailoverState state, CustomResourceOptions options)
resources: _: type: ionoscloud:Ipfailover 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.
- Datacenter
Id string - [string] The ID of a Virtual Data Center.
- Ip string
- [string] The reserved IP address to be used in the IP failover group.
- Ipfailover
Id string - Lan
Id string - [string] The ID of a LAN.
- Nicuuid string
- The UUID of the master NIC
- Timeouts
Ipfailover
Timeouts
- Datacenter
Id string - [string] The ID of a Virtual Data Center.
- Ip string
- [string] The reserved IP address to be used in the IP failover group.
- Ipfailover
Id string - Lan
Id string - [string] The ID of a LAN.
- Nicuuid string
- The UUID of the master NIC
- Timeouts
Ipfailover
Timeouts Args
- datacenter
Id String - [string] The ID of a Virtual Data Center.
- ip String
- [string] The reserved IP address to be used in the IP failover group.
- ipfailover
Id String - lan
Id String - [string] The ID of a LAN.
- nicuuid String
- The UUID of the master NIC
- timeouts
Ipfailover
Timeouts
- datacenter
Id string - [string] The ID of a Virtual Data Center.
- ip string
- [string] The reserved IP address to be used in the IP failover group.
- ipfailover
Id string - lan
Id string - [string] The ID of a LAN.
- nicuuid string
- The UUID of the master NIC
- timeouts
Ipfailover
Timeouts
- datacenter_
id str - [string] The ID of a Virtual Data Center.
- ip str
- [string] The reserved IP address to be used in the IP failover group.
- ipfailover_
id str - lan_
id str - [string] The ID of a LAN.
- nicuuid str
- The UUID of the master NIC
- timeouts
Ipfailover
Timeouts Args
- datacenter
Id String - [string] The ID of a Virtual Data Center.
- ip String
- [string] The reserved IP address to be used in the IP failover group.
- ipfailover
Id String - lan
Id String - [string] The ID of a LAN.
- nicuuid String
- The UUID of the master NIC
- timeouts Property Map
Supporting Types
IpfailoverTimeouts, IpfailoverTimeoutsArgs
Import
Resource IpFailover can be imported using the resource id
, e.g.
$ pulumi import ionoscloud:index/ipfailover:Ipfailover myipfailover datacenter uuid/lan uuid
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.