Add Copy_of_template2_192__20260630_095524
This commit is contained in:
parent
868eb7171c
commit
396e217fde
76
Copy_of_template2_192__20260630_095524
Normal file
76
Copy_of_template2_192__20260630_095524
Normal file
@ -0,0 +1,76 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
ionoscloud = {
|
||||
source = "ionos-cloud/ionoscloud"
|
||||
version = "~> 6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "ionoscloud" {
|
||||
username = var.username
|
||||
password = var.password
|
||||
}
|
||||
|
||||
variable "datacenter_name" {
|
||||
type = string
|
||||
default = "simpl-dc"
|
||||
}
|
||||
|
||||
variable "location" {
|
||||
type = string
|
||||
default = "de/fra"
|
||||
}
|
||||
|
||||
variable "server_name" {
|
||||
type = string
|
||||
default = "simpl-server"
|
||||
}
|
||||
|
||||
variable "cores" {
|
||||
type = number
|
||||
default = 2
|
||||
}
|
||||
|
||||
variable "ram" {
|
||||
type = number
|
||||
default = 4096
|
||||
}
|
||||
|
||||
variable "disk_size" {
|
||||
type = number
|
||||
default = 50
|
||||
}
|
||||
|
||||
resource "ionoscloud_datacenter" "dc" {
|
||||
name = var.datacenter_name
|
||||
location = var.location
|
||||
}
|
||||
|
||||
resource "ionoscloud_lan" "lan" {
|
||||
datacenter_id = ionoscloud_datacenter.dc.id
|
||||
public = true
|
||||
}
|
||||
|
||||
resource "ionoscloud_server" "vm" {
|
||||
name = var.server_name
|
||||
datacenter_id = ionoscloud_datacenter.dc.id
|
||||
cores = var.cores
|
||||
ram = var.ram
|
||||
availability_zone = "AUTO"
|
||||
|
||||
cpu_family = "AMD_OPTERON"
|
||||
|
||||
volume {
|
||||
name = "system-disk"
|
||||
size = var.disk_size
|
||||
disk_type = "SSD"
|
||||
image = "ubuntu:20.04"
|
||||
}
|
||||
|
||||
nic {
|
||||
lan = ionoscloud_lan.lan.id
|
||||
dhcp = true
|
||||
firewall_active = false
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user