Outils pour utilisateurs

Outils du site


gestion_configuration:terraform:toc

Ceci est une ancienne révision du document !


Terraform

Configuration

Backend

Créer un fichier dans le home directory nommé .terraformrc :

credentials "app.terraform.io" {
  token = "xxxxxx.atlasv1.zzzzzzzzzzzzz"
}

Dans le répertoire de travail de Terraform, créer un fichier de configuration backend.hcl.

workspaces { name = "workspace" }
hostname     = "app.terraform.io"
organization = "company"

Sources : CLI Configuration File et Backend - Remote.

Provisioner

File

provisioner "file" {
  connection {
    type = "ssh"
    user = "root"
    private_key = "${var.private_key}"
    host = "${var.hostname}"
  }
  source = "/local/path/to/file.txt"
  destination = "/path/to/file.txt"
}

Remote

provisioner "remote-exec" {
  inline = [
    "puppet apply",
    "consul join ${aws_instance.web.private_ip}",
  ]
}
gestion_configuration/terraform/toc.1571097188.txt.gz · Dernière modification : 2022/02/02 00:43 (modification externe)