H

Hashicorp技能

aws-ami-builder
hashicorp
使用Packer的amazon-ebs构建器创建自定义Amazon Machine Images。通过HCL模板自动化从源AMI创建AMI的过程,并利用配置器(shell脚本、文件上传、配置管理)进行自定义。支持通过ami_regions实现多区域AMI分发,以及按名称、所有者和虚拟化类型灵活过滤源AMI。通过环境变量、AWS凭证文件或IAM实例配置文件进行身份验证;包含模板的验证和构建命令...
official
aws-ami-builder
hashicorp
Build Amazon Machine Images (AMIs) with Packer using the amazon-ebs builder. Use when creating custom AMIs for EC2 instances.
official
azure-image-builder
hashicorp
Build Azure managed images and Azure Compute Gallery images with Packer. Use when creating custom images for Azure VMs.
official
azure-image-builder
hashicorp
使用Packer构建Azure托管映像和Azure Compute Gallery映像。在创建Azure VM的自定义映像时使用。
official
azure-verified-modules
hashicorp
针对寻求AVM合规的Azure Terraform模块的认证要求与最佳实践。强制要求提供者版本约束(azurerm >= 4.0, < 5.0;azapi >= 2.0, < 3.0),禁止使用基于Git的模块引用,转而采用固定的Terraform注册表源。所有标识符必须使用小写下划线命名法,变量类型需精确指定,通过防腐层模式实现离散输出属性,本地变量需按字母顺序排列。新增资源需配置功能开关变量...
official
azure-verified-modules
hashicorp
Azure Verified Modules (AVM) requirements and best practices for developing certified Azure Terraform modules. Use when creating or reviewing Azure modules…
official
new-terraform-provider
hashicorp
在使用 Plugin Framework 搭建新的 Terraform provider 时使用:工作区布局、go module 设置、provider server 的 main.go 和 provider.go…
official
new-terraform-provider
hashicorp
使用Plugin Framework搭建一个新的Terraform provider。生成一个采用标准"terraform-provider-"命名约定的新Go模块工作区,并初始化所需依赖。提供一个遵循HashiCorp Plugin Framework模式的模板main.go文件,其中包含用于自定义的TODO标记。通过运行构建和测试命令来验证设置,确保provider能够编译并通过初始检查。通过创建新工作区前确认意图来处理工作区管理。
official
provider-actions
hashicorp
使用Plugin Framework实现Terraform Provider操作。在开发于生命周期事件(之前/之后…)执行的命令式操作时使用。
official
provider-actions
hashicorp
使用Plugin Framework在资源生命周期事件中实现命令式Terraform Provider操作。支持创建前/后和更新前/后的生命周期触发器(Terraform 1.14.0中不支持销毁事件)。需要正确的模式定义,包括框架类型、集合的ElementType以及输入验证的验证器。包含进度报告、超时管理和长时间运行操作的全面错误处理。实现轮询和...
official
provider-configuration
hashicorp
Implement Terraform provider configuration and authentication with the Plugin Framework: provider schema for credentials (Optional + Sensitive attributes),…
official
provider-docs
hashicorp
使用HashiCorp推荐的模式、tfplugindocs模板和schema创建、更新和审查Terraform Registry的Terraform provider文档。
official
provider-docs
hashicorp
Create, update, and review Terraform provider documentation for Terraform Registry using HashiCorp-recommended patterns, tfplugindocs templates, and schema…
official
provider-ephemeral-resources
hashicorp
Implement Terraform provider ephemeral resources with the Plugin Framework: the Open/Renew/Close lifecycle, ephemeral schema design, registration via…
official
provider-framework-migration
hashicorp
Migrate Terraform provider resources and data sources from Plugin SDKv2 to the Plugin Framework: muxing both plugins in one provider (terraform-plugin-mux,…
official
provider-resources
hashicorp
Implement Terraform Provider resources and data sources using the Plugin Framework: CRUD operations, schema design, plan modifiers and validators, not-found…
official
provider-resources
hashicorp
使用完整的CRUD操作和测试来实现Terraform Provider资源和数据源。涵盖SDKv2和Plugin Framework的资源实现模式,包括模式设计、计划修改器和验证器。提供完整的CRUD操作示例(创建、读取、更新、删除),包含错误处理、状态管理和资源未找到模式。包含验收测试模式:基本测试、消失测试、辅助函数和测试执行命令...
official
provider-test-patterns
hashicorp
使用 terraform-plugin-testing 与 Plugin Framework 编写验收测试的模式。
official
provider-test-patterns
hashicorp
Terraform provider acceptance test patterns using terraform-plugin-testing with the Plugin Framework. Covers test structure, TestCase/TestStep fields,…
official
push-to-registry
hashicorp
将Packer构建元数据推送至HCP Packer注册表,用于镜像生命周期追踪与治理。以最小开销在HCP Packer中注册构建产物,仅存储元数据(非实际镜像),构建时间增加不到一分钟。支持存储桶级标签(每次构建更新)和不可变的构建级标签(Git SHA、时间戳),用于版本控制与合规追踪。通过hcp_packer_artifact数据源与Terraform集成,可跨环境查询和部署镜像...
official
push-to-registry
hashicorp
Push Packer build metadata to HCP Packer registry for tracking and managing image lifecycle. Use when integrating Packer builds with HCP Packer for version…
official
refactor-module
hashicorp
将单体式Terraform配置拆解为可复用、结构清晰的模块,并附带明确的合约与迁移路径。分析现有代码以识别重构候选对象,按逻辑功能对资源进行分组,并在设计前评估复杂度。遵循HashiCorp最佳实践生成包含类型化变量、验证规则及描述性输出的模块接口。提供基于moved块(Terraform 1.1+)或手动terraform state mv命令的状态迁移策略...
official
refactor-module
hashicorp
Transform monolithic Terraform configurations into reusable, maintainable modules following HashiCorp's module design principles and community best practices.
official
run-acceptance-tests
hashicorp
使用结构化故障排除方法执行并诊断Terraform提供商的Go验收测试。通过设置TF_ACC=1环境变量并运行go test -run=TestAccFeatureHappyPath来执行聚焦验收测试。逐步诊断失败原因:使用-count=1重试,通过-v启用详细输出,通过TF_LOG=debug激活调试日志,并通过TF_ACC_WORKING_DIR_PERSIST=1持久化Terraform工作目录。通过故意破坏TestCheckFunc并重新运行测试来验证测试可靠性...
official
run-acceptance-tests
hashicorp
Guide for running acceptance tests for a Terraform provider. Use this when asked to run an acceptance test or to run a test with the prefix `TestAcc`, when a…
official
terraform-policy
hashicorp
Write, test, or convert Terraform Policy files (.policy.hcl, .policytest.hcl, Sentinel→tfpolicy). Triggers: policy.hcl, policytest, convert sentinel, tfpolicy,…
official
terraform-search-import
hashicorp
Discover existing cloud resources using Terraform Search queries and bulk import them into Terraform management. Use when bringing unmanaged infrastructure…
official
terraform-search-import
hashicorp
使用 Terraform Search 查询发现现有云资源,并将其批量导入 Terraform 管理。适用于将未管理的基础设施纳入管理时…
official
terraform-stacks
hashicorp
创建、验证和管理跨环境Terraform Stack配置的全面指南。涵盖Stack语言基础:组件定义(.tfcomponent.hcl)、部署实例(.tfdeploy.hcl)、文件组织以及所需的Terraform v1.13+。支持使用for_each在提供者和组件上进行多区域和多环境部署,并自动推断组件间的依赖关系。包括工作负载身份(OIDC)认证、身份令牌...
official
terraform-stacks
hashicorp
Comprehensive guide for working with HashiCorp Terraform Stacks. Use when creating, modifying, or validating Terraform Stack configurations (.tfcomponent.hcl,…
official
terraform-style-guide
hashicorp
遵循HashiCorp官方风格约定生成和维护Terraform代码。强制使用双空格缩进、小写下划线命名,并按terraform.tf、providers.tf、main.tf、variables.tf、outputs.tf和locals.tf标准组织文件。要求所有变量和输出包含类型和描述,支持验证规则和敏感标记用于凭证。动态资源优先使用for_each而非count,应用安全加固(加密、私有...)
official
terraform-style-guide
hashicorp
Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform…
official
terraform-test
hashicorp
编写和运行Terraform测试的综合指南。在创建测试文件(.tftest.hcl)、使用run块编写测试场景、验证……时使用。
official
terraform-test
hashicorp
关于使用断言、模拟和模块验证编写及运行Terraform测试的全面指南。使用.tftest.hcl语法编写测试文件,通过运行块在计划或应用模式下执行,支持顺序和并行执行,并可选择状态隔离。对资源属性、输出和数据源进行断言条件验证;使用expect_failures确保无效输入被正确拒绝。模拟提供程序(Terraform 1.7.0+)可模拟基础设施行为,无需...
official
tfctl
hashicorp
使用 tfctl CLI 与 HCP Terraform / Terraform Cloud / Terraform Enterprise 交互。完整 API 覆盖。适用于任何 HCP Terraform 或 Terraform Cloud 或…
official
windows-builder
hashicorp
Build Windows images with Packer using WinRM communicator and PowerShell provisioners. Use when creating Windows AMIs, Azure images, or VMware templates.
official
windows-builder
hashicorp
使用 Packer 通过 WinRM 通信器和 PowerShell 配置器构建 Windows 镜像。适用于创建 Windows AMI、Azure 镜像或 VMware 模板。
official