feat: initial commit
- have been working on this for some time now
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
resource "incus_project" "this" {
|
||||
name = var.name
|
||||
description = var.description
|
||||
|
||||
config = {
|
||||
# Features
|
||||
"features.images" = var.features_images
|
||||
"features.networks" = var.features_networks
|
||||
"features.networks.zones" = var.features_networks_zones
|
||||
"features.profiles" = var.features_profiles
|
||||
"features.storage.buckets" = var.features_storage_buckets
|
||||
"features.storage.volumes" = var.features_storage_volumes
|
||||
|
||||
# Limits
|
||||
"limits.containers" = var.limits_containers
|
||||
"limits.cpu" = var.limits_cpu
|
||||
"limits.disk" = var.limits_disk
|
||||
"limits.instances" = var.limits_instances
|
||||
"limits.memory" = var.limits_memory
|
||||
"limits.networks" = var.limits_networks
|
||||
"limits.processes" = var.limits_processes
|
||||
"limits.virtual-machines" = var.limits_virtual_machines
|
||||
}
|
||||
|
||||
# Dynamic block for per-pool disk limits, if defined
|
||||
dynamic "config" {
|
||||
for_each = var.limits_disk_pool
|
||||
content {
|
||||
key = "limits.disk.pool.${config.key}"
|
||||
value = config.value
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
output "name" {
|
||||
description = "The name of the project"
|
||||
value = incus_project.this.name
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
variable "limits_containers" {
|
||||
description = "Maximum number of containers that can be created in the project"
|
||||
type = number
|
||||
}
|
||||
|
||||
variable "limits_cpu" {
|
||||
description = "Maximum number of CPUs to use in the project. This value is the maximum of the sum of individual instance CPU limits."
|
||||
type = number
|
||||
}
|
||||
|
||||
variable "limits_disk" {
|
||||
description = "Maximum disk space used by the project. This includes all instance volumes, custom volumes, and images."
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "limits_disk_pool" {
|
||||
description = <<EOT
|
||||
Map of storage pool names to disk space limits for each pool.
|
||||
Each key is a POOL_NAME and the value is the maximum aggregate disk space used on that pool.
|
||||
Example:
|
||||
{
|
||||
"default" = "50GB"
|
||||
"ssd" = "100GB"
|
||||
}
|
||||
EOT
|
||||
type = map(string)
|
||||
}
|
||||
|
||||
variable "limits_instances" {
|
||||
description = "Maximum number of instances that can be created in the project"
|
||||
type = number
|
||||
}
|
||||
|
||||
variable "limits_memory" {
|
||||
description = "Usage limit for the host’s memory for the project. Sum of individual memory limits on instances."
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "limits_networks" {
|
||||
description = "Maximum number of networks that the project can have"
|
||||
type = number
|
||||
}
|
||||
|
||||
variable "limits_processes" {
|
||||
description = "Maximum number of processes within the project. This is the sum of the limits.processes on all instances."
|
||||
type = number
|
||||
}
|
||||
|
||||
variable "limits_virtual_machines" {
|
||||
description = "Maximum number of virtual machines that can be created in the project"
|
||||
type = number
|
||||
}
|
||||
|
||||
variable "features_images" {
|
||||
description = "Whether to use a separate set of images for the project (initial value: true)"
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
|
||||
variable "features_networks" {
|
||||
description = "Whether to use a separate set of networks for the project (initial value: false)"
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
|
||||
variable "features_networks_zones" {
|
||||
description = "Whether to use a separate set of network zones for the project (initial value: false)"
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
|
||||
variable "features_profiles" {
|
||||
description = "Whether to use a separate set of profiles for the project (initial value: true)"
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
|
||||
variable "features_storage_buckets" {
|
||||
description = "Whether to use a separate set of storage buckets for the project (initial value: true)"
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
|
||||
variable "features_storage_volumes" {
|
||||
description = "Whether to use a separate set of storage volumes for the project (initial value: true)"
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
Reference in New Issue
Block a user