Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| eadl:bloc4:fm2:terraform-intro [2026/04/26 00:37] – [3. Structure d’un projet Terraform] jcheron | eadl:bloc4:fm2:terraform-intro [2026/05/04 01:44] (Version actuelle) – [12. Modules (introduction)] jcheron | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== | + | ====== |
| ===== Objectifs ===== | ===== Objectifs ===== | ||
| Ligne 24: | Ligne 24: | ||
| ===== 2. Installation et vérification ===== | ===== 2. Installation et vérification ===== | ||
| - | Fichier : terminal | + | A partir du terminal |
| + | |||
| + | |||
| + | ==== tfenv ==== | ||
| + | [[https:// | ||
| + | |||
| + | <sxh bash; | ||
| + | # Installation | ||
| + | git clone --depth=1 https:// | ||
| + | |||
| + | # Ajouter au PATH | ||
| + | echo ' | ||
| + | source ~/.bashrc | ||
| + | |||
| + | # Installer Terraform 1.14.0 | ||
| + | tfenv install 1.14.0 | ||
| + | tfenv use 1.14.0 | ||
| + | |||
| + | </ | ||
| <sxh bash; | <sxh bash; | ||
| Ligne 31: | Ligne 49: | ||
| <WRAP round help> | <WRAP round help> | ||
| - | Questions | + | Question |
| - | * Que se passe-t-il si la commande n’existe pas ? | ||
| * Pourquoi vérifier la version est important en équipe ? | * Pourquoi vérifier la version est important en équipe ? | ||
| </ | </ | ||
| Ligne 40: | Ligne 57: | ||
| Créer un dossier : | Créer un dossier : | ||
| - | |||
| - | Fichier : terminal | ||
| <sxh bash; | <sxh bash; | ||
| Ligne 50: | Ligne 65: | ||
| Créer un fichier : | Créer un fichier : | ||
| - | Fichier : main.tf | + | Fichier : '' |
| <sxh hcl; | <sxh hcl; | ||
| Ligne 59: | Ligne 74: | ||
| Question : | Question : | ||
| - | * Quel est l’intérêt | + | * Une suite de commandes permet |
| </ | </ | ||
| Ligne 68: | Ligne 83: | ||
| * définir un provider | * définir un provider | ||
| - | Fichier : main.tf | + | Fichier : '' |
| - | < | + | < |
| terraform { | terraform { | ||
| required_providers { | required_providers { | ||
| Ligne 105: | Ligne 120: | ||
| Fichier : '' | Fichier : '' | ||
| - | < | + | < |
| resource " | resource " | ||
| name = " | name = " | ||
| Ligne 150: | Ligne 165: | ||
| Fichier : main.tf | Fichier : main.tf | ||
| - | < | + | < |
| image = " | image = " | ||
| </ | </ | ||
| Ligne 172: | Ligne 187: | ||
| Remettre : | Remettre : | ||
| - | Fichier : main.tf | + | Fichier : '' |
| - | < | + | < |
| image = " | image = " | ||
| </ | </ | ||
| Ligne 219: | Ligne 234: | ||
| Ajouter un port : | Ajouter un port : | ||
| - | Fichier : main.tf | + | Fichier : '' |
| - | < | + | < |
| ports { | ports { | ||
| internal = 80 | internal = 80 | ||
| Ligne 245: | Ligne 260: | ||
| * module " | * module " | ||
| - | <WRAP round help> | + | <WRAP round question> |
| Question : | Question : | ||