Implementing our own Terraform provider to allow infrastructure automation

created: giovedì, set 12, 2024

Abbiamo iniziato a implementare il nostro provider Terraform perché riteniamo che l’automazione sia la chiave per l’adozione del cloud.

You can find our provider at github under

and over at the Hashicorp terraform site:

This provider give every customer another path of accessing DTZ resources and implemting their automation/IaaS on top of our services.

To setup the provider you need to generate an API-key through the website. We currently only support apikey authentication.

terraform {
  required_providers {
    dtz = {
      source = "DownToZero-Cloud/dtz"
      version = ">= 0.1.22"
    }
  }
}

provider "dtz" {
  api_key = "apikey-1234"
}

accesso a un contesto DTZ

https://registry.terraform.io/providers/DownToZero-Cloud/dtz/latest/docs/data-sources/context

data "dtz_context" "ctx" {}

output "context-alias" {
  value = data.dtz_context.ctx.alias
}
output "context-id" {
  value = data.dtz_context.ctx.id
}