Migrated to S3 for tfstate file

This commit is contained in:
2026-07-04 17:17:36 +02:00
parent bb54bfdbf4
commit 3f2c674cd9
5 changed files with 60 additions and 13 deletions

View File

@@ -17,7 +17,7 @@ resource "proxmox_virtual_environment_vm" "rocky_clone" {
} }
memory { memory {
dedicated = 768 dedicated = 2048
} }
initialization { initialization {
@@ -39,3 +39,45 @@ resource "proxmox_virtual_environment_vm" "rocky_clone" {
output "rocky_ipv4_address" { output "rocky_ipv4_address" {
value = proxmox_virtual_environment_vm.rocky_clone.ipv4_addresses[1][0] value = proxmox_virtual_environment_vm.rocky_clone.ipv4_addresses[1][0]
} }
resource "proxmox_virtual_environment_vm" "project-tomorrow" {
name = "project-tomorrow"
node_name = var.virtual_environment_node_name
started = true
clone {
vm_id = "7000"
}
agent {
# NOTE: The agent is installed and enabled as part of the cloud-init configuration in the template VM, see cloud-config.tf
# The working agent is *required* to retrieve the VM IP addresses.
# If you are using a different cloud-init configuration, or a different clone source
# that does not have the qemu-guest-agent installed, you may need to disable the `agent` below and remove the `vm_ipv4_address` output.
# See https://bpg.sh/docs/resources/virtual_environment_vm#qemu-guest-agent for more details.
enabled = true
}
memory {
dedicated = 4048
}
initialization {
dns {
servers = ["1.1.1.1"]
}
ip_config {
ipv4 {
address = "dhcp"
}
}
user_account {
username = "rocky"
keys = [trimspace(file("./id_ed25519_pt.pub"))]
}
}
}
output "project_tomorrow_ipv4_address" {
value = proxmox_virtual_environment_vm.project-tomorrow.ipv4_addresses[1][0]
}

View File

@@ -1,10 +0,0 @@
{
"version": 4,
"terraform_version": "1.12.1",
"serial": 21,
"lineage": "af0feed9-13f3-3cfd-a2e5-f720e7014b48",
"outputs": {},
"resources": [],
"check_results": null
}

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,22 @@
terraform { terraform {
backend "s3" {
bucket = "tofu-state-proxmox"
endpoint = "https://eu-central-2.storage.impossibleapi.net"
key = "terraform.tfstate"
region = "eu-central-2"
# use_lockfile = true # ImpossibleCloud doesn't support the required conditional PUT headers
skip_region_validation = true
skip_credentials_validation = true
skip_requesting_account_id = true
skip_s3_checksum = true
use_path_style = true
}
required_providers { required_providers {
proxmox = { proxmox = {
source = "bpg/proxmox" source = "bpg/proxmox"
version = "0.108.0" version = "0.108.0"
} }
} }