new-terraform-provider

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
To scaffold a new Terraform provider with Plugin Framework:
  1. If I am already in a Terraform provider workspace, then confirm that I want to create a new workspace. If I do not want to create a new workspace, then skip all remaining steps.
  2. Create a new workspace root directory. The root directory name should be prefixed with "terraform-provider-". Perform all subsequent steps in this new workspace.
  3. Initialize a new Go module..
  4. Run
    go get -u github.com/hashicorp/terraform-plugin-framework@latest
    .
  5. Write a main.go file that follows the example.
  6. Remove TODO comments from
    main.go
  7. Run
    go mod tidy
  8. Run
    go build -o /dev/null
  9. Run
    go test ./...
使用Plugin Framework搭建新的Terraform Provider:
  1. 如果我已经处于Terraform Provider工作区中,请确认是否要创建一个新的工作区。如果不想创建新工作区,则跳过所有剩余步骤。
  2. 创建一个新的工作区根目录。根目录名称应以“terraform-provider-”为前缀。后续所有步骤都在此新工作区中执行。
  3. 初始化一个新的Go模块。
  4. 运行
    go get -u github.com/hashicorp/terraform-plugin-framework@latest
  5. 编写一个遵循示例的main.go文件。
  6. 移除
    main.go
    中的TODO注释
  7. 运行
    go mod tidy
  8. 运行
    go build -o /dev/null
  9. 运行
    go test ./...