new-terraform-provider
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTo scaffold a new Terraform provider with Plugin Framework:
- 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.
- Create a new workspace root directory. The root directory name should be prefixed with "terraform-provider-". Perform all subsequent steps in this new workspace.
- Initialize a new Go module..
- Run .
go get -u github.com/hashicorp/terraform-plugin-framework@latest - Write a main.go file that follows the example.
- Remove TODO comments from
main.go - Run
go mod tidy - Run
go build -o /dev/null - Run
go test ./...
使用Plugin Framework搭建新的Terraform Provider:
- 如果我已经处于Terraform Provider工作区中,请确认是否要创建一个新的工作区。如果不想创建新工作区,则跳过所有剩余步骤。
- 创建一个新的工作区根目录。根目录名称应以“terraform-provider-”为前缀。后续所有步骤都在此新工作区中执行。
- 初始化一个新的Go模块。
- 运行。
go get -u github.com/hashicorp/terraform-plugin-framework@latest - 编写一个遵循示例的main.go文件。
- 移除中的TODO注释
main.go - 运行
go mod tidy - 运行
go build -o /dev/null - 运行
go test ./...