התקנת Terraform

בדף הזה מוסבר איך להתקין את Terraform ל-Google Cloud ב-Cloud Shell ובמעטפת מקומית. ‫Cloud Shell היא סביבת מעטפת אינטראקטיבית של Google Cloudשמאפשרת ללמוד על הפרויקטים והמשאבים שלכם ולנהל אותם מהדפדפן. Google Cloud

מדריך למתחילים לשימוש ב-Terraform עם Google Cloudזמין במאמר מדריך למתחילים לשימוש ב-Terraform עם Google Cloud .

Cloud Shell

  1. כדי להשתמש בטרמינל אונליין שכבר מוגדרים בו ה-CLI של gcloud ו-Terraform, צריך להפעיל את Cloud Shell:

    בחלק התחתון של הדף הזה מתחיל סשן של Cloud Shell ומופיעה הנחיה של שורת הפקודה. הסשן יופעל תוך כמה שניות.

  2. מריצים את הפקודה הבאה כדי לוודא ש-Terraform זמין:

    terraform
    

    הפלט אמור להיראות כך:

    
    Usage: terraform [global options] <subcommand> [args]
    
    The available commands for execution are listed below.
    The primary workflow commands are given first, followed by
    less common or more advanced commands.
    
    Main commands:
      init          Prepare your working directory for other commands
      validate      Check whether the configuration is valid
      plan          Show changes required by the current configuration
      apply         Create or update infrastructure
      destroy       Destroy previously-created infrastructure
    
    
  3. כדי להשתמש ב-Terraform עם Google Cloud, צריך לוודא שהמשימות הבאות בוצעו ב- Google Cloud:

מעטפת מקומית

  1. משתמשים בהוראות ההתקנה שסופקו על ידי Terraform.

  2. מריצים את הפקודה הבאה כדי לוודא ש-Terraform זמין:

    terraform
    

    הפלט אמור להיראות כך:

    
     Usage: terraform [global options] <subcommand> [args]
    
    The available commands for execution are listed below.
    The primary workflow commands are given first, followed by
    less common or more advanced commands.
    
    Main commands:
      init          Prepare your working directory for other commands
      validate      Check whether the configuration is valid
      plan          Show changes required by the current configuration
      apply         Create or update infrastructure
      destroy       Destroy previously-created infrastructure
    
  3. כדי להשתמש ב-Terraform עם Google Cloud, צריך לוודא שהמשימות הבאות בוצעו ב- Google Cloud:

המאמרים הבאים