MCPcopy Index your code
hub / github.com/crossplane/upjet

github.com/crossplane/upjet @v2.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.3.0 ↗ · + Follow
1,549 symbols 4,907 edges 157 files 834 documented · 54%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Upjet - Generate Crossplane Providers from any Terraform Provider

CI GitHub release Go Report Card Contributors Slack X (formerly Twitter) Follow

Upjet is a code generation framework and Kubernetes controller runtime that transforms Terraform providers into Crossplane providers. It generates Kubernetes CRDs, reconciliation controllers, and example manifests while providing runtime libraries for API conversions, Terraform state management, and resource lifecycle operations. It powers the official AWS, Azure, and GCP providers along with 50+ community providers.

Upjet overview

Table of Contents

Key Features

  • Multiple Terraform Execution Modes

  • Terraform CLI: Traditional fork-based Terraform CLI and Terraform provider process spawning

  • Terraform Plugin SDK v2: Direct Go library integration (no-CLI invocation)
  • Terraform Plugin Framework: Protocol-based communication via protov6 (no-CLI invocation)

  • Automatic Resource Generation

  • Kubernetes CRDs highly conformant to the Crossplane Resource Model (XRM) from Terraform schemas

  • Reconciliation controllers with full CRUD lifecycle
  • Example manifests, API documentation, (partial) API validation rules, etc.

  • Cross-Resource References

  • Kubernetes-native reference resolution between resources

  • Automatic selector generation for resource lookups

  • Management Policies (Crossplane v1.11+)

  • Fine-grained control over resource lifecycle operations

  • Observe-only mode for importing existing infrastructure

  • Advanced Capabilities

  • External name mapping for resource identification

  • Late initialization from provider responses
  • Sync & async operations for long-running resources
  • Sensitive field handling with connection secrets

When to Use Upjet

Upjet is ideal when:

  • A Terraform provider already exists for your target platform
  • You want to leverage Terraform's battle-tested resource logic
  • You need broad coverage of infrastructure resources quickly
  • Your team is familiar with Terraform provider semantics

Consider a native Crossplane provider when:

  • No Terraform provider exists for your platform
  • You need deeply customized reconciliation logic
  • You require precise control over the Kubernetes API surface
  • Performance requirements exceed what Terraform execution allows

Architecture

Upjet bridges the gap between Terraform's vast provider ecosystem and Kubernetes-native infrastructure management. At build time, Upjet reads a Terraform provider's schema and generates everything needed for a Crossplane provider: Go types, Custom Resource Definitions, and reconciliation controllers. At runtime, these controllers use Terraform's resource logic to manage infrastructure, while exposing a pure Kubernetes API to users.

Upjet components

  1. Code Generation Pipeline - Transforms Terraform schemas into Go types, CRDs, and controllers
  2. Generic CR Reconcilers - Runtimes that handle reconciliation for all generated resources
  3. Documentation Scraper - Extracts and generates API documentation, example manifests (used for e2e testing and documentation), cross-resource references, etc. from Terraform docs
  4. Migration Framework - Supports migrating resources between different providers of the same external API, like migrating from the community AWS provider (crossplane-contrib/provider-aws) to the official provider (upbound/provider-aws)
  5. API Conversion Framework - Handles lifecycle management and breaking changes between API versions of the same CRD
  6. Resource Configuration Framework - Implements various configuration aspects (external name, sync/async behavior, API naming, API versions, cross-resource references, etc.) for Upjet resources

Providers Built with Upjet

Major Cloud Providers

Additional Providers

Browse the Upbound Marketplace for a full list of available providers.

Documentation

Guide Description
Generating a Provider Create a new Crossplane provider from scratch
Configuring a Resource External names, references, and resource customization
Adding New Resources Add resources to an existing provider
Testing with Uptest End-to-end testing framework
Monitoring Prometheus metrics for the Upjet runtime
Upgrading to v2 Migration guide from Upjet v1 to v2
Managing CRD Versions Handle Terraform schema changes across versions
Controller Template Variables Variables available to the managed resource controller setup template
Main Template Variables Variables available to the provider family main program template

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Community

Prior Art

Upjet originates from the Terrajet project. See the original design document.

License

Upjet is under the Apache 2.0 license with notice.

Extension points exported contracts — how you extend this code

ProviderRunner (Interface)
ProviderRunner is the interface for running Terraform native provider processes in the shared gRPC server mode [5 implementers]
pkg/terraform/provider_runner.go
PavedConversion (Interface)
PavedConversion is an optimized Conversion between two fieldpath.Paved objects. PavedConversion implementations for a sp [5 …
pkg/config/conversion/conversions.go
Store (Interface)
Store is where we can get access to the Terraform workspace of given resource. [3 implementers]
pkg/controller/interfaces.go
SecretClient (Interface)
SecretClient is the client to get sensitive data from kubernetes secrets go:generate go run github.com/golang/mock/mock [3 …
pkg/resource/sensitive.go
Element (Interface)
Element represents a schema element being visited and should Accept a visitor. [2 implementers]
pkg/schema/traverser/traverse.go
Option (FuncType)
Option is a comment option
pkg/types/comments/comment.go
ReconcilerOption (FuncType)
ReconcilerOption configures a Reconciler returned by NewReconciler.
pkg/reconciler/reconciliationpolicy/reconciler.go
FuzzerOption (FuncType)
FuzzerOption configures a single fuzzerOptions entry. Pass one or more to WithFuzzerConfig to register a new fuzzer con
pkg/apitesting/roundtrip/roundtrip.go

Core symbols most depended-on inside this repo

Run
called by 226
pkg/pipeline/hooks.go
AddAcronym
called by 92
pkg/types/name/name.go
Error
called by 77
pkg/terraform/operation.go
String
called by 50
pkg/config/tf_conversion.go
loadTestFixture
called by 50
pkg/config/testing_helpers.go
newTestResource
called by 35
pkg/config/testing_helpers.go
DefaultResource
called by 34
pkg/config/common.go
EXPECT
called by 32
pkg/resource/fake/mocks/mock.go

Shape

Function 642
Method 515
Struct 287
FuncType 49
Interface 29
TypeAlias 27

Languages

Go100%

Modules by API surface

pkg/config/resource.go66 symbols
pkg/controller/external_tfpluginfw_test.go60 symbols
pkg/config/conversion/conversions.go53 symbols
pkg/config/provider.go35 symbols
pkg/resource/fake/terraformed.go33 symbols
pkg/apitesting/roundtrip/roundtrip.go33 symbols
pkg/terraform/provider_scheduler.go31 symbols
pkg/terraform/errors/errors.go31 symbols
pkg/controller/external_tfpluginfw.go30 symbols
tests/conversion/test_resource.go28 symbols
pkg/controller/external_tfpluginsdk.go27 symbols
pkg/apitesting/roundtrip/roundtrip_test.go27 symbols

For agents

$ claude mcp add upjet \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact