Server
Creates and manages IonosCloud Server objects.
Manages a Server on IonosCloud.
Example Usage
This resource will create an operational server. After this section completes, the provisioner can be called.
ENTERPRISE Server
With IPv6 Enabled
CUBE Server
Server that boots from CDROM
Argument reference
template_uuid
- (Optional)[string] The UUID of the template for creating a CUBE server; the available templates for CUBE servers can be found on the templates resourcename
- (Required)[string] The name of the server.datacenter_id
- (Required)[string] The ID of a Virtual Data Center.cores
- (Optional)(Computed)[integer] Number of server CPU cores.ram
- (Optional)(Computed)[integer] The amount of memory for the server in MB.image_name
- (Optional)[string] The name, ID or alias of the image. May also be a snapshot ID. It is required iflicence_type
is not provided. Attribute is immutable.availability_zone
- (Optional)[string] The availability zone in which the server should exist. E.g:AUTO
,ZONE_1
,ZONE_2
. This property is immutable.licence_type
- (Optional)[string] Sets the OS type of the server.cpu_family
- (Optional)[string] CPU architecture on which server gets provisioned; not all CPU architectures are available in all datacenter regions; available CPU architectures can be retrieved from the datacenter resource. E.g.: "INTEL_SKYLAKE" or "INTEL_XEON".vm_state
- (Optional)[string] Sets the power state of the server. E.g:RUNNING
,SHUTOFF
orSUSPENDED
. SUSPENDED state is only valid for cube. SHUTOFF state is only valid for enterprise.volume
- (Required) See the Volume section.nic
- (Optional) See the Nic section.firewall
- (Optional) Allows to define firewall rules inline in the server. See the Firewall section.boot_volume
- (Computed) The associated boot volume.boot_cdrom
- DEPRECATED Please refer to ionoscloud_server_boot_device_selection (Optional)(Computed)[string] The associated boot drive, if any. Must be the UUID of a bootable CDROM image that can be retrieved using the ionoscloud_image data source.boot_image
- (Optional)[string] The image or snapshot UUID / name. May also be an image alias. It is required iflicence_type
is not provided.primary_nic
- (Computed) The associated NIC.primary_ip
- (Computed) The associated IP address.firewallrule_id
- (Computed) The associated firewall rule.firewallrule_ids
- (Computed) The associated firewall rules.ssh_key_path
- (Optional)[list] List of absolute paths to files containing a public SSH key that will be injected into IonosCloud provided Linux images. Also accepts ssh keys directly. Required for IonosCloud Linux images. Required ifimage_password
is not provided. Does not support~
expansion to homedir in the given path. This property is immutable.ssh_keys
- (Optional)[list] Immutable List of absolute or relative paths to files containing public SSH key that will be injected into IonosCloud provided Linux images. Also accepts ssh keys directly. Public SSH keys are set on the image as authorized keys for appropriate SSH login to the instance using the corresponding private key. This field may only be set in creation requests. When reading, it always returns null. SSH keys are only supported if a public Linux image is used for the volume creation. Does not support~
expansion to homedir in the given path.image_password
- (Optional)[string] Required ifssh_key_path
is not provided.type
- (Optional)(Computed)[string] Server usages: ENTERPRISE or CUBE. This property is immutable.label
- (Optional)[set] A label can be seen as an object with only two required fields:key
andvalue
, both of thestring
type. Please check the example presented above to see how alabel
can be used in the plan. A server can have multiple labels.key
- (Required)[string] The key of the label.value
- (Required)[string] The value of the label.
inline_volume_ids
- (Computed) A list with the IDs for the volumes that are defined inside the server resource.
⚠ WARNING
Image_name under volume level is deprecated, please use image_name under server level ssh_key_path and ssh_keys fields are immutable.
⚠ WARNING
If you want to create a CUBE server, you have to provide the
template_uuid
. In this case you can not setcores
,ram
andvolume.size
arguments, these being mutually exclusive withtemplate_uuid
.In all the other cases (ENTERPRISE servers) you have to provide values for
cores
,ram
andvolume size
.
Import
Resource Server can be imported using the resource id
and the datacenter id
, e.g.. Passing only resource id and datacenter id means that the first nic found linked to the server will be attached to it.
Optionally, you can pass primary_nic
and firewallrule_id
so terraform will know to import also the first nic and firewall rule (if it exists on the server):
Notes
Please note that for any secondary volume, you need to set the licence_type property to UNKNOWN
⚠️ Note: Important for deleting an firewall
rule from within a list of inline resources defined on the same nic. There is one limitation to removing one firewall rule from the middle of the list of firewall
rules. Terraform will actually modify the existing rules and delete the last one. More details here. There is a workaround described in the issue that involves moving the resources in the list prior to deletion. terraform state mv <resource-name>.<resource-id>[<i>] <resource-name>.<resource-id>[<j>]
Last updated