The terraform-state can be stored in backblaze b2 with some configurations. This changes does exactly this. Note, that this requires the special env-variables `AWS_SECRET_ACCESS_KEY` and `AWS_ACCESS_KEY_ID` which are normally part of the AWS-setup. To be able to use AWS and this setup in parallel I use dotenv to maintain the variables in the special file `.envrc`. Reference: https://andrzejgor.ski/posts/backblaze_b2_tf_state Reference: https://www.reddit.com/r/selfhosted/comments/1iv1qir Reference: https://direnv.net/
46 lines
951 B
HCL
46 lines
951 B
HCL
terraform {
|
|
backend "s3" {
|
|
bucket = "nemoinho-tfstate"
|
|
key = "hetzner-infra/terraform.tfstate"
|
|
region = "eu-central-003"
|
|
endpoints = {
|
|
s3 = "https://s3.eu-central-003.backblazeb2.com"
|
|
}
|
|
skip_credentials_validation = true
|
|
skip_region_validation = true
|
|
skip_metadata_api_check = true
|
|
skip_requesting_account_id = true
|
|
skip_s3_checksum = true
|
|
}
|
|
|
|
required_providers {
|
|
hetznerdns = {
|
|
source = "timohirt/hetznerdns"
|
|
version = "2.2.0"
|
|
}
|
|
hcloud = {
|
|
source = "hetznercloud/hcloud"
|
|
version = "1.50.0"
|
|
}
|
|
random = {
|
|
source = "hashicorp/random"
|
|
version = "3.7.1"
|
|
}
|
|
external = {
|
|
source = "hashicorp/external"
|
|
version = "2.3.4"
|
|
}
|
|
}
|
|
}
|
|
|
|
provider "hetznerdns" {
|
|
apitoken = var.hetzner_dns_apitoken
|
|
}
|
|
|
|
provider "hcloud" {
|
|
token = var.hetzner_cloud_apitoken
|
|
}
|
|
|
|
provider "random" {}
|
|
provider "external" {}
|