about summary refs log blame commit diff
path: root/ops/glesys/main.tf
blob: 9fa87f0609a0475a3e5fa553d5123b298c914f44 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                             


                                                   


                                     

                                      

                                      
   







                                                        
                         
 


                                                      
                         

             
                                



                                                              
                                                          

                                         

                                                         
                                                          

                                    
# Configure TVL resources hosted with GleSYS.
#
# Most importantly:
#  - all of our DNS
#  - object storage (e.g. backups)

terraform {
  required_providers {
    glesys = {
      source = "depot/glesys"
    }
  }

  backend "s3" {
    endpoint = "https://objects.dc-sto1.glesys.net"
    bucket   = "tvl-state"
    key      = "terraform/tvl-glesys"
    region   = "glesys"

    skip_credentials_validation = true
    skip_region_validation      = true
    skip_metadata_api_check     = true
  }
}

provider "glesys" {
  userid = "cl26117" # generated by GleSYS
}

resource "glesys_objectstorage_instance" "tvl-backups" {
  description = "tvl-backups"
  datacenter  = "dc-sto1"
}

resource "glesys_objectstorage_instance" "tvl-state" {
  description = "tvl-state"
  datacenter  = "dc-sto1"

  lifecycle {
    ignore_changes = [accesskey]
  }
}

resource "glesys_objectstorage_credential" "terraform-state" {
  instanceid  = glesys_objectstorage_instance.tvl-state.id
  description = "key for terraform state"
}

resource "glesys_objectstorage_credential" "litestream" {
  instanceid  = glesys_objectstorage_instance.tvl-state.id
  description = "key for litestream"
}