PD-1 — Plan d'implémentation¶
📚 Navigation User Story
| Document | | | ---------- | -- | | 📋 [Spécification](PD-1-specification.md) | | | 🛠️ **Plan d'implémentation** | *(ce document)* | | ✅ [Critères d'acceptation](PD-1-acceptability.md) | | | 📝 Retour d'expérience | *(à venir)* | [← Retour à infrastructure-souveraine](../PD-193-epic.md) · [↑ Index User Story](index.md)Objectif¶
Provisionner l'infrastructure cloud souveraine via Terraform sur OVH Cloud (région GRA11, Gravelines, France).
Choix techniques retenus¶
- Provider : OVH Cloud Public Cloud
- IaC : Terraform 1.5+
- Région : GRA11 (Gravelines, France)
- Backend : S3 OVH pour state
- Secrets : HashiCorp Vault
Architecture ciblée¶
terraform/
├── main.tf # Configuration principale
├── variables.tf # Variables d'entrée
├── outputs.tf # Sorties
├── providers.tf # Providers OVH/AWS
├── security_groups.tf # Security groups
├── modules/
│ ├── vpc_hsm/ # VPC pour HSM (AWS)
│ ├── ovh_dns/ # DNS OVH
│ └── ...
└── environments/
├── dev/
├── staging/
└── prod/
Découpage technique¶
Phase 1 : Configuration Terraform¶
- Configurer provider OVH :
terraform {
required_providers {
ovh = {
source = "ovh/ovh"
version = "~> 0.40"
}
}
backend "s3" {
bucket = "probatiovault-terraform-state"
key = "infra/terraform.tfstate"
region = "gra"
endpoint = "s3.gra.cloud.ovh.net"
}
}
- Configurer variables sensibles via Vault
Phase 2 : Réseau OVH¶
- Créer projet Public Cloud
- Configurer vRack si nécessaire
- Définir security groups :
- Backend : 443 (HTTPS), 5432 (PostgreSQL internal)
- HSM : VPN uniquement
Phase 3 : DNS OVH¶
- Créer module
ovh_dns: - Zone probatiovault.com
- Records A/AAAA pour API
- Records pour environnements (dev, staging, prod)
Phase 4 : Intégration AWS (HSM)¶
- Configurer provider AWS (eu-west-3)
- Créer VPC dédié HSM
- Configurer VPN Site-to-Site OVH ↔ AWS
Phase 5 : Scripts helper¶
scripts/terraform-with-vault.sh:- Récupérer credentials depuis Vault
- Exporter comme env vars
- Exécuter terraform
Phase 6 : Environnements¶
- Créer structure par environnement :
environments/dev/main.tfenvironments/staging/main.tf-
environments/prod/main.tf -
Utiliser workspaces ou dossiers séparés
Phase 7 : CI/CD¶
- Pipeline GitLab :
plan: terraform planapply: terraform apply (manuel)destroy: terraform destroy (protégé)
Points de vigilance¶
- Credentials : Jamais en dur, toujours Vault
- State : Stockage distant obligatoire
- Locks : DynamoDB pour locking state
- Drift : Détecter changements manuels
Hors périmètre¶
- Provisioning PostgreSQL (→ PD-2)
- Buckets S3 (→ PD-4)
- CloudHSM (→ module dédié)