new-terraform-provider

作成者: hashicorp

Plugin Frameworkを使用して新しいTerraformプロバイダーをスキャフォールディングします。標準の「terraform-provider-」命名規則に従った新しいGoモジュールワークスペースを生成し、必要な依存関係を初期化します。カスタマイズ用のTODOマーカー付きで、HashiCorpのPlugin Frameworkパターンに従ったテンプレートmain.goファイルを提供します。ビルドおよびテストコマンドを実行してプロバイダーがコンパイルされ、初期チェックを通過することを確認することでセットアップを検証します。新しいワークスペースを作成する前に意図を確認することでワークスペース管理を処理します...

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へ移行する:両方のプラグインを1つのプロバイダーでmuxする(terraform-plugin-mux、…
provider-configuration
hashicorp
Terraformプロバイダーの設定と認証をPlugin Frameworkで実装する:プロバイダースキーマの資格情報(Optional + Sensitive属性)、…
provider-ephemeral-resources
hashicorp
Terraformプロバイダーの一時的リソースをPlugin Frameworkで実装する:Open/Renew/Closeライフサイクル、一時的スキーマ設計、登録方法…
terraform-test
hashicorp
Terraformテストの作成と実行に関する包括的なガイド。アサーション、モック、モジュール検証を含む。.tftest.hcl構文を使用してテストファイルを作成し、planまたはapplyモードで実行されるrunブロックを記述。逐次実行と並列実行をサポートし、オプションで状態の分離も可能。リソース属性、出力、データソースに対する条件をアサートし、expect_failuresを使用して無効な入力が適切に拒否されることを検証。モックプロバイダー(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マシンイメージを構築します。ソースAMIからHCLテンプレートを使用してAMI作成を自動化し、プロビジョナー(シェルスクリプト、ファイルアップロード、構成管理)によるカスタマイズをサポートします。ami_regionsによるマルチリージョンAMI配布と、名前、所有者、仮想化タイプによる柔軟なソースAMIフィルタリングをサポートします。環境変数、AWS認証情報ファイル、またはIAMインスタンスプロファイルを介して認証し、テンプレートの検証およびビルドコマンドを含みます...
tfctl
hashicorp
tfctl CLIを使用してHCP Terraform / Terraform Cloud / Terraform Enterpriseと対話します。完全なAPIカバレッジ。任意のHCP TerraformまたはTerraform Cloudまたは…