Skip to content

Starting point for those wanting to create their own terraform providers

Notifications You must be signed in to change notification settings

jsandov/custom-tf-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Learning Resources

  1. HashiCorp's Official Tutorial: "Implement a Provider with the Terraform Plugin Framework"
  2. Terraform Plugin Framework documentation
  3. HashiCorp Learn Lab: "Create a Terraform provider with the Plugin Framework" (YouTube video)
  4. Terraform Registry documentation on publishing provider documentation
  5. GitHub repository: terraform-provider-scaffolding-framework (template for new providers)
  6. Terraform Plugin Development section on HashiCorp Discuss (for asking questions and learning patterns)
  7. Terraform Provider Development tutorials on HashiCorp Developer portal
  8. Blog post: "How To Create a Terraform Provider — a Guide for Absolute Beginners" by Speakeasy

Essential Libraries

github.com/hashicorp/terraform-plugin-framework
github.com/hashicorp/terraform-plugin-go
github.com/hashicorp/terraform-plugin-docs
github.com/hashicorp/terraform-plugin-testing

Go Module Initialization

# Create a new directory for your provider
mkdir terraform-provider-mycompany
cd terraform-provider-mycompany

# Initialize Go module
go mod init github.com/yourusername/terraform-provider-mycompany

# Add core dependencies
go get github.com/hashicorp/terraform-plugin-framework
go get github.com/hashicorp/terraform-plugin-go

Recommended Project Structure

terraform-provider-mycompany/
│
├── main.go
├── go.mod
├── go.sum
│
├── internal/
│   ├── provider/
│   │   ├── provider.go
│   │   ├── resource.go
│   │   └── datasource.go
│   └── examples/
└── resources/
    └── example_resource.tf

Key Development Considerations

  • Use Go modules for dependency management
  • Implement provider using Plugin Framework
  • Follow HashiCorp's best practices
  • Generate comprehensive documentation
  • Create thorough test coverage

Helpful Development Commands

# Run tests
go test ./...

# Build provider
go build

# Generate documentation
tfplugindocs generate

Learning Path Recommendations

  1. Complete HashiCorp's official tutorial
  2. Study existing open-source providers
  3. Start with a simple, single-resource provider
  4. Incrementally add complexity
  5. Publish to Terraform Registry

About

Starting point for those wanting to create their own terraform providers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published