Oneandone - Instance - Size: Example Usage
Oneandone - Instance - Size: Example Usage
» Example Usage
» Argument Reference
» oneandone_block_storage
Manages a Block Storage on 1&1
1
» Example Usage
» Argument Reference
» oneandone_server
Manages a Firewall Policy on 1&1
» Example Usage
2
"port_from" = 43
"port_to" = 43
"source_ip" = "0.0.0.0"
},
{
"protocol" = "TCP"
"port_from" = 22
"port_to" = 22
"source_ip" = "0.0.0.0"
}
]
}
» Argument Reference
» oneandone_server
Manages a Load Balancer on 1&1
» Example Usage
3
protocol = "TCP"
port_balancer = 8080
port_server = 8089
source_ip = "0.0.0.0"
},
{
protocol = "TCP"
port_balancer = 9090
port_server = 9099
source_ip = "0.0.0.0"
}
]
}
» Argument Reference
» oneandone_server
Manages a Monitoring Policy on 1&1
4
» Example Usage
thresholds = {
cpu = {
warning = {
value = 50,
alert = false
}
critical = {
value = 66,
alert = false
}
}
ram = {
warning = {
value = 70,
alert = true
}
critical = {
value = 80,
alert = true
}
},
ram = {
warning = {
value = 85,
alert = true
}
critical = {
value = 95,
alert = true
}
},
disk = {
warning = {
value = 84,
alert = true
}
critical = {
5
value = 94,
alert = true
}
},
transfer = {
warning = {
value = 1000,
alert = true
}
critical = {
value = 2000,
alert = true
}
},
internal_ping = {
warning = {
value = 3000,
alert = true
}
critical = {
value = 4000,
alert = true
}
}
}
ports = [
{
email_notification = true
port = 443
protocol = "TCP"
alert_if = "NOT_RESPONDING"
},
{
email_notification = false
port = 80
protocol = "TCP"
alert_if = "NOT_RESPONDING"
},
{
email_notification = true
port = 21
protocol = "TCP"
alert_if = "NOT_RESPONDING"
}
]
6
processes = [
{
email_notification = false
process = "httpdeamon"
alert_if = "RUNNING"
},
{
process = "iexplorer",
alert_if = "NOT_RUNNING"
email_notification = true
}]
}
» Argument Reference
7
• ‘disk - (Required) Hard Disk threshold
– ‘warning - (Required) Warning alert
∗ ‘value - (Required) Warning to be issued when the threshold is
reached. from 1 to 100
∗ ‘alert - (Required) If set true warning will be issued.
– ‘critical - (Required) Critical alert
∗ ‘value - (Required) Warning to be issued when the threshold is
reached. from 1 to 100
∗ ‘alert - (Required) If set true warning will be issued.
• ‘transfer - (Required) Data transfer threshold
– ‘warning - (Required) Warning alert
∗ ‘value - (Required) Warning to be issued when the threshold is
reached. from 1 to 100
∗ ‘alert - (Required) If set true warning will be issued.
– ‘critical - (Required) Critical alert
∗ ‘value - (Required) Warning to be issued when the threshold is
reached. from 1 to 100
∗ ‘alert - (Required) If set true warning will be issued.
• ‘internal_ping - (Required) Ping threshold
– ‘warning - (Required) Warning alert
∗ ‘value - (Required) Warning to be issued when the threshold is
reached. from 1 to 100
∗ ‘alert - (Required) If set true warning will be issued.
– ‘critical - (Required) Critical alert
∗ ‘value - (Required) Warning to be issued when the threshold is
reached. from 1 to 100
∗ ‘alert - (Required) If set true warning will be issued.
Monitoring Policy Ports (ports) support the following:
• email_notification - (Required) If set true email will be sent.
• port - (Required) Port number.
• protocol - (Required) The protocol of the port. Allowed values are TCP,
UDP, TCP/UDP, ICMP and IPSEC.
• alert_if - (Required) Condition for the alert to be issued.
Monitoring Policy Ports (processes) support the following:
• email_notification - (Required) If set true email will be sent.
• process - (Required) Process name.
• alert_if - (Required) Condition for the alert to be issued.
» oneandone_server
Manages a Private Network on 1&1
8
» Example Usage
» Argument Reference
» oneandone_ip
Manages a Public IP on 1&1
» Example Usage
» Argument Reference
9
• ip_type - (Required) IP type. Can be IPV4 or IPV6
• reverse_dns - (Optional)
• datacenter - (Optional) Location of desired 1and1 datacenter. Can be
DE, GB, US or ES.
• ip_address - (Computed) The IP address.
» oneandone_server
Manages a Server on 1&1
» Example Usage
provisioner "remote-exec" {
inline = [
"apt-get update",
"apt-get -y install nginx",
]
}
}
» Argument Reference
10
• datacenter - (Optional) Location of desired 1and1 datacenter. Can be
DE, GB, US or ES
• description - (Optional) Description of the server
• firewall_policy_id - (Optional) ID of firewall policy
• fixed_instance_size - (Optional) ID of a fixed instance size
• hdds - (Optional) List of HDDs. One HDD must be main.
• *disk_size -(Required) The size of HDD
• *is_main - (Optional) Indicates if HDD is to be used as main hard disk
of the server
• image -(Required) The name of a desired image to be provisioned with
the server
• ip - (Optional) IP address for the server
• loadbalancer_id - (Optional) ID of the load balancer
• monitoring_policy_id - (Optional) ID of monitoring policy
• name -(Required) The name of the server.
• password - (Optional) Desired password.
• ram -(Optional) Size of ram.
• ssh_key_path - (Optional) Path to private ssh key
• ssh_key_public - (Optional) The public key data in OpenSSH autho-
rized_keys format.
• vcores -(Optional) Number of virtual cores.
Either fixed_instance_size or all of vcores, cores_per_processor, ram and
hdds are required.
IPs (ips) expose the following attributes
• id - (Computed) The ID of the attached IP
• ip - (Computed) The IP
• firewall_policy_id - (Computed) The attached firewall policy
» oneandone_baremetal
Manages a Baremetal Server on 1&1
» Example Usage
11
ssh_key_public = "${file("/path/to/public/key.pub")}"
provisioner "remote-exec" {
inline = [
"apt-get update",
"apt-get -y install nginx",
]
}
}
» Argument Reference
» oneandone_server
Manages a Shared Storage on 1&1
» Example Usage
12
name = "test_storage1"
description = "1234"
size = 50
storage_servers = [
{
id = "${oneandone_server.server.id}"
rights = "RW"
},
{
id = "${oneandone_server.server02.id}"
rights = "RW"
}
]
}
» Argument Reference
» oneandone_ssh_key
Manages SSH Keys on 1&1
» Example Usage
13
» Argument Reference
» oneandone_vpn
Manages a VPN on 1&1
» Example Usage
» Argument Reference
14