Tüm Ürünler
Search
Belge Merkezi

Enterprise Distributed Application Service:Terraform'ı yükleyin ve yapılandırın

Son Güncelleme:Oct 03, 2026

Cloud altyapısını tanımlamak, önizlemek ve dağıtmak için kullanmadan önce Terraform'ı yükleyin ve yapılandırın.

Yordam

  1. İşletim sisteminize uygun paketi Terraform adresinden indirin.

  2. Paketi /usr/local/bin dizinine çıkarın.

  3. Kurulumu doğrulamak için terraform komutunu çalıştırın.

    Aşağıdakine benzer bir çıktı görürsünüz:

    username:~$ terraform
    Usage: terraform [-version] [-help] <command> [args]
  4. Güvenliği artırmak için bir RAM kullanıcısı oluşturun.

    1. Bir Alibaba Cloud hesabı kullanarak Resource Access Management (RAM) konsolunda oturum açın.

    2. Terraform adlı bir RAM kullanıcısı oluşturun ve bir AccessKey çifti oluşturun. Daha fazla bilgi için bkz. RAM kullanıcı oluşturma.

    3. RAM kullanıcısına izinler atayın. Bu örnekte, Terraform kullanıcısına AliyunEDASFullAccess ve AliyunVPCFullAccess izinleri verilir. Daha fazla bilgi için bkz. RAM kullanıcı izinlerini yönetme.

  5. Bir test dizini oluşturun.

    Her Terraform projesinin kendi çalışma dizinine ihtiyacı vardır. terraform-test adlı bir test dizini oluşturun:

    [user@test bin]#mkdir terraform-test
  6. terraform-test dizinine gidin.

    [user@test bin]#cd terraform-test
    [user@test terraform-test]#
  7. Yapılandırma dosyaları oluşturun.

    Terraform, dizindeki tüm *.tf ve *.tfvars dosyalarını okur. Yapılandırmanızı birden çok dosyada düzenleyebilirsiniz:

    provider.tf           -- used to configure providers
    terraform.tfvars      -- used to configure the variables that are required to configure providers
    varable.tf            -- used to configure universal variables
    resource.tf           -- used to define resources
    data.tf               -- used to define package files
    output.tf             -- used to configure outputs

    Örneğin, kimlik bilgilerinizle provider.tf dosyasını oluşturun:

    [user@test terraform-test]# vim provider.tf
    provider "alicloud" {
        region      = "cn-beijing"
        access_key  = "LTA**********NO2"
        secret_key  = "MOk8x0*********************wwff"
    }

    Yapılandırma hakkında daha fazla bilgi için bkz. alicloud_edas_application.

  8. Çalışma dizinini başlatın.

    [user@test terraform-test]#terraform init
    
    Initializing provider plugins...
    - Checking for available provider plugins on https://releases.hashicorp.com...
    - Downloading plugin for provider "alicloud" (1.25.0)...
    
    The following providers do not have any version constraints in configuration,
    so the latest version was installed.
    
    To prevent automatic upgrades to new major versions that may contain breaking
    changes, it is recommended to add version = "..." constraints to the
    corresponding provider blocks in configuration, with the constraint strings
    suggested below.
    
    * provider.alicloud: version = "~> 1.25"
    
    Terraform has been successfully initialized!
    
    You may now begin working with Terraform. Try running "terraform plan" to see
    any changes that are required for your infrastructure. All Terraform commands
    should now work.
    
    If you ever set or change modules or backend configuration for Terraform,
    rerun this command to reinitialize your working directory. If you forget, other
    commands will detect it and remind you to do so if necessary.                        
    Önemli

    Bir çalışma dizini ve yapılandırma dosyaları oluşturduktan sonra terraform init komutunu çalıştırmanız gerekir.