new-terraform-provider

작성자: hashicorp

Plugin Framework를 사용하여 새로운 Terraform Provider를 스캐폴딩합니다. 표준 "terraform-provider-" 명명 규칙을 따르는 새로운 Go 모듈 워크스페이스를 생성하고 필요한 종속성을 초기화합니다. HashiCorp의 Plugin Framework 패턴을 따르는 템플릿 main.go 파일을 제공하며, 사용자 정의를 위한 TODO 마커가 포함되어 있습니다. 빌드 및 테스트 명령을 실행하여 Provider가 컴파일되고 초기 검사를 통과하는지 확인함으로써 설정을 검증합니다. 새 워크스페이스를 생성하기 전에 의도를 확인하여 워크스페이스 관리를 처리합니다.

npx skills add https://github.com/hashicorp/agent-skills --skill new-terraform-provider

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. Write an internal/provider/provider.go file that follows the example. Rename the demo provider, the DEMO_* environment variables, and the authentication attributes to match the target API.
  7. Remove TODO comments from main.go and provider.go.
  8. Run go mod tidy
  9. Run go build -o /dev/null
  10. Run go test ./... The scaffold resolves credentials as explicit config with environment variable fallback. To grow that into a full credential provider chain (shared credentials files, profiles, platform identity, configure-time validation), use the provider-configuration skill (if available). To add the first resource or data source, use the provider-resources skill (if available).

hashicorp의 다른 스킬

provider-framework-migration
hashicorp
Terraform 제공자 리소스와 데이터 소스를 Plugin SDKv2에서 Plugin Framework로 마이그레이션: 하나의 제공자에서 두 플러그인을 멀티플렉싱(terraform-plugin-mux, …)
provider-configuration
hashicorp
Terraform provider 구성 및 인증을 Plugin Framework로 구현: 자격 증명을 위한 provider 스키마(Optional + Sensitive 속성),…
provider-ephemeral-resources
hashicorp
Terraform 공급자 임시 리소스를 Plugin Framework로 구현: Open/Renew/Close 수명주기, 임시 스키마 설계, 등록 방법…
terraform-test
hashicorp
Terraform 테스트 작성 및 실행을 위한 종합 가이드로, 어설션, 모킹, 모듈 검증을 포함합니다. .tftest.hcl 구문을 사용하여 테스트 파일을 작성하며, plan 또는 apply 모드로 실행되는 run 블록을 지원하고, 선택적 상태 격리와 함께 순차 및 병렬 실행을 지원합니다. 리소스 속성, 출력, 데이터 소스에 대한 조건을 어설션하고, expect_failures를 사용하여 잘못된 입력이 적절히 거부되는지 검증합니다. Mock 제공자(Terraform 1.7.0+)는 인프라 동작을 시뮬레이션합니다...
terraform-policy
hashicorp
Terraform Policy 파일(.policy.hcl, .policytest.hcl, Sentinel→tfpolicy)을 작성, 테스트 또는 변환합니다. 트리거: policy.hcl, policytest, convert sentinel, tfpolicy,…
terraform-search-import
hashicorp
Terraform Search 쿼리를 사용하여 기존 클라우드 리소스를 검색하고 이를 Terraform 관리로 대량 가져옵니다. 관리되지 않는 인프라를 도입할 때 사용합니다…
aws-ami-builder
hashicorp
Packer의 amazon-ebs 빌더로 사용자 지정 Amazon 머신 이미지를 구축합니다. HCL 템플릿과 프로비저너(셸 스크립트, 파일 업로드, 구성 관리)를 사용해 소스 AMI에서 AMI 생성을 자동화합니다. ami_regions를 통한 다중 리전 AMI 배포와 이름, 소유자, 가상화 유형별 유연한 소스 AMI 필터링을 지원합니다. 환경 변수, AWS 자격 증명 파일 또는 IAM 인스턴스 프로파일을 통해 인증하며 템플릿 검증 및 빌드 명령을 포함합니다...
tfctl
hashicorp
tfctl CLI를 사용하여 HCP Terraform / Terraform Cloud / Terraform Enterprise와 상호작용합니다. 전체 API를 지원합니다. 모든 HCP Terraform 또는 Terraform Cloud 또는…에 사용하세요.