This is an example for using the proxmox/lxc
module and the required variables. Get the release ID from the releases page.
module "<NAME>" {
Required Variables
source = "git::https://github.com/shakir85/terraform_modules.git//proxmox/lxc?ref=<RELEADE_ID>"
node_name = ""
disk_id = ""
ssh_public_key_path = ""
username = ""
hostname = ""
template_file_id = ""
#
# Optional Variables (default values presented below)
#
description = "Manage by Terraform"
ip_config = "dhcp"
network_interface = "eth0"
os_type = "unmanaged"
disk_size = "4"
memory = 1024
cpu_cores = 1
unprivileged = true
firewall = true
}
The following requirements are needed by this module:
The following providers are used by this module:
No modules.
The following resources are used by this module:
- proxmox_virtual_environment_container.lxc_container (resource)
- random_password.lxc_container_password (resource)
- local_file.ssh_public_key (data source)
The following input variables are required:
Description: Storage disk identifier (name)
Type: string
Description: Hostname to assign to the container
Type: string
Description: The name of the node to assign the container to
Type: string
Description: Path to the local public key to be added to the default user's .ssh/authorized_keys
file.
Type: string
Description: The identifier for an OS template file. The ID format is <datastore_id>:<content_type>/<file_name>, for example local:iso/jammy-server-cloudimg-amd64.tar.gz.
Type: string
The following input variables are optional (have default values):
Description: The number of CPU cores
Type: number
Default: 1
Description: Container description
Type: string
Default: "Manage by Terraform"
Description: The size of the root filesystem in gigabytes (defaults to 4). When set to 0 a directory or zfs/btrfs subvolume will be created. Requires datastore_id to be set.
Type: string
Default: "4"
Description: Whether this interface's firewall rules should be used
Type: bool
Default: true
Description: The IP configuration (default to dhcp)
Type: string
Default: "dhcp"
Description: The dedicated memory in megabytes
Type: number
Default: 1024
Description: A network interface
Type: string
Default: "eth0"
Description: OS type: Alpine, Ubunt ...etc
Type: string
Default: "unmanaged"
Description: Whether the container runs as unprivileged on the host
Type: bool
Default: true
No outputs.