Development Environment Setup

4 minute read

Development Environment Setup

Welcome to Module 3! In this module, you’ll set up a complete development environment for building Terraform providers. By the end, you’ll have everything needed to start developing your own custom providers.

A proper development setup is crucial for productive provider development. We’ll install Go, configure your environment, scaffold a provider project, and set up essential development tools.

What You’ll Learn

This module covers:

  • Go Installation — Install Go 1.21+ and configure your system
  • Project Scaffolding — Use templates and generators to bootstrap providers
  • Project Structure — Understand the standard provider directory layout
  • Dependencies — Manage Go modules and provider dependencies
  • Development Tools — Set up linters, formatters, and testing tools
  • IDE Configuration — Configure VS Code or GoLand for provider development
  • Local Testing — Test providers locally before publishing

Prerequisites

Before starting this module, ensure you have:

  • ✅ Basic understanding of command-line operations
  • ✅ Administrator/sudo access on your machine
  • ✅ Internet connection for downloading tools
  • ✅ Text editor or IDE (VS Code or GoLand recommended)

Module Chapters

Work through these chapters in order:

1. Go Installation and Setup

Install Go 1.21+, set up GOPATH, configure environment variables, and verify installation.

Time: 30 minutes

2. Project Scaffolding

Use terraform-plugin-framework-generator and templates to create a new provider project.

Time: 20 minutes

3. Project Structure

Understand the standard provider directory layout, file organization, and naming conventions.

Time: 30 minutes

4. Dependencies and Modules

Learn Go modules, manage dependencies, and understand provider SDK versions.

Time: 30 minutes

5. Hands-On Lab

Build your first provider scaffold, run it locally, and verify the setup works.

Time: 45 minutes

6. Practice Questions

Test your understanding with exercises and troubleshooting scenarios.

Time: 15 minutes

Estimated Module Time

Total: 2.5-3 hours

Development Environment Checklist

By the end of this module, you’ll have:

  • ✅ Go 1.21+ installed and configured
  • ✅ Terraform CLI installed
  • ✅ Provider project scaffolded
  • ✅ Dependencies downloaded
  • ✅ IDE configured for Go development
  • ✅ Local provider testing working
  • ✅ Development tools (linters, formatters) installed

System Requirements

Operating System

  • macOS: 10.15+ (Catalina or later)
  • Linux: Ubuntu 20.04+, Fedora 35+, or equivalent
  • Windows: Windows 10/11 with WSL2 recommended

Hardware

  • CPU: 2+ cores recommended
  • RAM: 8GB minimum, 16GB recommended
  • Disk: 5GB free space

Software

  • Terminal: bash, zsh, or PowerShell
  • Git: 2.30+
  • Text Editor: VS Code, GoLand, or Vim/Emacs

Development Philosophy

As you set up your environment, keep these principles in mind:

1. Reproducibility

Your setup should work consistently across machines and team members.

2. Isolation

Use Go modules to isolate project dependencies.

3. Automation

Automate repetitive tasks with Makefiles and scripts.

4. Testing

Set up testing tools from the start, not as an afterthought.

5. Documentation

Document your setup process for team onboarding.

Common Development Setups

Minimal Setup

Perfect for learning and exploration:

  • Go + Terraform CLI
  • Text editor
  • Command-line tools

Standard Setup

Recommended for serious development:

  • Go + Terraform CLI
  • VS Code with Go extension
  • golangci-lint
  • terraform-plugin-docs
  • make

Professional Setup

For production provider development:

  • All standard tools
  • GoLand IDE
  • CI/CD integration
  • Docker for isolated testing
  • Additional linters and security scanners

What You’ll Build

Throughout this module, you’ll scaffold a basic provider called terraform-provider-mycloud with:

terraform-provider-mycloud/
├── main.go              # Provider entry point
├── go.mod               # Go module definition
├── go.sum               # Dependency checksums
├── provider/
│   ├── provider.go      # Provider configuration
│   ├── resource_environment.go
│   └── data_source_region.go
├── internal/
│   └── client/          # API client
├── examples/            # Usage examples
├── docs/                # Generated documentation
├── Makefile             # Build automation
└── .github/
    └── workflows/       # CI/CD pipelines

This structure will serve as your foundation for building the complete MyCloud provider throughout this tutorial.

Development Workflow

Once your environment is set up, your typical workflow will be:

# 1. Write code
vim provider/resource_environment.go

# 2. Format and lint
make fmt
make lint

# 3. Run tests
make test

# 4. Build provider
make build

# 5. Test locally
make install
terraform init
terraform plan

We’ll practice this workflow in the hands-on lab.

Troubleshooting Resources

If you encounter issues during setup:

  1. Go Installation Issues
    • Check official Go docs: https://go.dev/doc/install
    • Verify PATH configuration
    • Try a different installation method
  2. Module Issues
    • Run go clean -modcache
    • Check proxy settings: go env GOPROXY
    • Verify internet connectivity
  3. Provider Compilation
    • Check Go version: go version
    • Update dependencies: go mod tidy
    • Clear build cache: go clean -cache

Community Resources

Key Takeaways

Before starting the hands-on chapters:

  • A proper development setup saves hours of frustration later
  • Go 1.21+ is required for modern provider development
  • Project scaffolding provides a solid starting point
  • Development tools (linters, formatters) are essential
  • Local testing capabilities are crucial for rapid iteration

Ready to Start?

Let’s begin by installing Go and setting up your development environment!

Start Chapter 1: Go Installation →


Last updated: June 30, 2026

Updated: