With provider 1.54 the plan replaces both servers. Hetzner stopped returning a server's datacenter, the old provider derived the location from it, and a location that reads back empty differs from "hel1", which forces replacement. Only prevent_destroy stood in the way. Provider 1.70.2 reads the location properly: the same plan then shows the two firewall updates and nothing else. The lock file is not tracked, so raise the version constraint to keep the old provider out. Run terraform init -upgrade once in existing checkouts. Assisted-by: Claude:fable-5-2
53 lines
1.4 KiB
HCL
53 lines
1.4 KiB
HCL
terraform {
|
|
required_version = ">= 1.0.0"
|
|
|
|
# S3 backend - comment this section if bucket not yet created
|
|
backend "s3" {
|
|
bucket = "asxpio-terraform-main"
|
|
key = "terraform/state/terraform.tfstate"
|
|
region = "hel1"
|
|
endpoint = "https://hel1.your-objectstorage.com"
|
|
skip_credentials_validation = true
|
|
skip_metadata_api_check = true
|
|
skip_region_validation = true
|
|
skip_requesting_account_id = true
|
|
force_path_style = true
|
|
}
|
|
|
|
required_providers {
|
|
hcloud = {
|
|
source = "hetznercloud/hcloud"
|
|
# 1.54 no longer reads a server's location from the Hetzner API and
|
|
# plans to replace every server because of it. Do not go below 1.70.
|
|
version = "~> 1.70"
|
|
}
|
|
minio = {
|
|
source = "aminueza/minio"
|
|
version = "~> 3.11"
|
|
}
|
|
}
|
|
}
|
|
|
|
provider "hcloud" {
|
|
token = var.hcloud_token
|
|
}
|
|
|
|
# MinIO provider for Helsinki (hel1) region
|
|
provider "minio" {
|
|
alias = "hel1"
|
|
minio_server = var.s3_endpoint_hel1
|
|
minio_user = var.s3_access_key
|
|
minio_password = var.s3_secret_key
|
|
minio_region = "hel1"
|
|
minio_ssl = true
|
|
}
|
|
|
|
# MinIO provider for Falkenstein (fsn1) region
|
|
provider "minio" {
|
|
alias = "fsn1"
|
|
minio_server = var.s3_endpoint_fsn1
|
|
minio_user = var.s3_access_key
|
|
minio_password = var.s3_secret_key
|
|
minio_region = "fsn1"
|
|
minio_ssl = true
|
|
}
|