tech:cloud_-_terraform
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tech:cloud_-_terraform [2026/04/28 11:37] – Jean-Baptiste | tech:cloud_-_terraform [2026/06/16 15:31] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Cloud - Terrafom / OpenTofu | ||
| + | |||
| + | Terraform antonomase OpenTofu | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Voir aussi : | ||
| + | * [[Cloud Pulumi|Pulumi]] | ||
| + | * [terraform-clean-syntax](https:// | ||
| + | * Terragrunt | ||
| + | |||
| + | |||
| + | |||
| + | ## Notes | ||
| + | |||
| + | Terraform n'est plus un Logiciel Libre. Le Fork libre s' | ||
| + | |||
| + | Install | ||
| + | ~~~bash | ||
| + | snap install --classic opentofu | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | terraform fmt | ||
| + | terraform validate | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | terraform plan -out plan01 | ||
| + | terraform apply " | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Pb | ||
| + | |||
| + | ### EBS volumes destroyed & recreated - Keep EBS without create new topology ? | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | ### Erreur : VPCIdNotSpecified: | ||
| + | |||
| + | `example.tf` | ||
| + | ~~~ | ||
| + | provider " | ||
| + | profile | ||
| + | region | ||
| + | } | ||
| + | |||
| + | resource " | ||
| + | ami = " | ||
| + | instance_type = " | ||
| + | tags = { | ||
| + | Name = " | ||
| + | } | ||
| + | |||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | terraform apply | ||
| + | ~~~ | ||
| + | |||
| + | Erreur | ||
| + | ~~~ | ||
| + | Error: Error launching source instance: VPCIdNotSpecified: | ||
| + | status code: 400, request id: c83af246-9715-4d82-a47d-d08a7941c7f6 | ||
| + | ~~~ | ||
| + | |||
| + | #### Solution | ||
| + | |||
| + | `example.tf` | ||
| + | ~~~ | ||
| + | provider " | ||
| + | profile | ||
| + | region | ||
| + | } | ||
| + | |||
| + | resource " | ||
| + | ami = " | ||
| + | instance_type = " | ||
| + | vpc_security_group_ids = [" | ||
| + | subnet_id | ||
| + | tags = { | ||
| + | Name = " | ||
| + | } | ||
| + | |||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Erreur : No suitable endpoint could be found in the service | ||
| + | |||
| + | ~~~bash | ||
| + | terraform apply | ||
| + | ~~~ | ||
| + | |||
| + | ~~~ | ||
| + | │ Error: Error creating OpenStack compute client: No suitable endpoint could be found in the service catalog. | ||
| + | │ | ||
| + | │ with openstack_compute_keypair_v2.test_keypair, | ||
| + | │ on 10_test.tf line 2, in resource " | ||
| + | │ 2: resource " | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | Lister le catalogue ici | ||
| + | ~~~bash | ||
| + | openstack catalog list | ||
| + | ~~~ | ||
| + | |||
| + | Mettre la région appropriée | ||
| + | |||
| + | |||
| + | ## Autres | ||
| + | |||
| + | |||
| + | ### SFTP TO S3 - AWS Storage Gateway | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | ~~~ | ||
| + | |||
| + | |||
| + | resource " | ||
| + | # | ||
| + | # | ||
| + | gateway_name | ||
| + | gateway_timezone | ||
| + | gateway_type | ||
| + | smb_guest_password = " | ||
| + | } | ||
| + | |||
| + | resource " | ||
| + | authentication = " | ||
| + | gateway_arn | ||
| + | location_arn | ||
| + | role_arn | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | ## Autres | ||
| + | |||
| + | `~/ | ||
| + | |||
| + | ~~~bash | ||
| + | export TF_LOG=1 | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | terraform plan ${VARS} -out=" | ||
| + | terraform apply -input=false ${ENV}.tfplan | ||
| + | ~~~ | ||
| + | |||
