Skip to content

This is a github template repository for an aws service infrastructure

License

Notifications You must be signed in to change notification settings

codingones-github-templates/aws-service-client

Repository files navigation

client infrastructure

À propos

client infrastructure décrit par le code un aspect de l'infrastructure à provisionner pour __PROJECT.

Table des matières

Prérequis

Installation

La commande suivante permet d'utiliser la ligne de commande terraform via Docker :

docker run --rm -it --name terraform -v ~/:/root/ -v $(pwd):/workspace -w /workspace hashicorp/terraform:light

Pour une utilisation simplifiée, il est possible de créer un alias :

alias terraform='docker run --rm -it --name terraform -v ~/:/root/ -v $(pwd):/workspace -w /workspace hashicorp/terraform:light'

Avec cet alias, il n'y a plus de différence entre une commande terraform exécutée avec Docker ou avec Terraform CLI.

Utilisation Locale

Cliquez pour afficher les commandes

Vérifier et corriger la syntaxe des fichiers .tf

terraform fmt --recursive

Vérifier la cohérence de l'infrastructure

terraform validate

Récupérer un jeton d'authentification à Terraform Cloud en local

terraform login

Initialiser l'état et les plugins en local

terraform init

Planifier une exécution pour voir les différences avec l'état précédent de l'infrastructure

terraform plan

Contribution

Appliquer la mise à jour de l'infrastructure

Pour que les modifications de la description de l'infrastructure soient appliquées en production, il suffit de publier les changements sur la branche main.

Construit avec

Langages & Frameworks

  • Terraform est un outil de description d'infrastructure par le code qui permet de créer et de maintenir une infrastructure de manière sûre et prévisible.

Outils

CI

  • Github Actions est l'outil d'intégration et de déploiement continu intégré à GitHub
  • Secrets du dépôt :
    • TF_API_TOKEN : Le token d'api Terraform Cloud qui permet à la CI d'opérer des actions sur Terraform Cloud
      • Provisionné par le organization.deployer du compte AWS parent de l'organization

Déploiement

  • AWS est la plateforme de services Cloud proposée par Amazon.
    • Utilisateur : __PROJECT.client.infrastructure
    • Groupe : client.deployer
  • Terraform Cloud est la plateforme proposée par HashiCorp pour administrer les modifications d'infrastructure
    • Organisation : __ORGANIZATION
    • Workspaces : client
    • Variables
      • AWS_SECRET_ACCESS_KEY

        • Value : Sensitive - write only
        • Category : env
        • Provisionnée par le iam.deployer du compte AWS
      • AWS_ACCESS_KEY_ID

        • Value : Sensitive - write only
        • Category : env
        • Provisionnée par le iam.deployer du compte AWS

Licence

Voir le fichier LICENSE.md du dépôt.

About

This is a github template repository for an aws service infrastructure

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages