New to Suga? Start with the Quickstart to understand how applications work, then read the Platform Development Guide to see how platforms compose plugins. This guide assumes you’re comfortable with Terraform and your target cloud provider.
Understanding Plugins
What Are Plugins?
Plugins are the lowest-level infrastructure building blocks in Suga. Each plugin is a self-contained unit that provides:- Infrastructure Deployment - Terraform modules that provision cloud resources
 - Input Schema - Configurable properties that platforms can customize
 - Runtime Adapters (optional) - Go code that translates abstract operations into cloud-specific API calls
 
lambdaplugin for serverless computes3-bucketplugin for object storagecloudfrontplugin for CDNiam-roleplugin for permissionsrds-postgres-dbplugin for PostgreSQL databases
Plugin Types
Suga supports different plugin types that correspond to application resources:service- Compute resources (Lambda, Fargate, Cloud Run) - requires runtime adapterstorage- Object storage (S3, Cloud Storage) - requires runtime adapterdatabase- Databases (RDS, Neon, Cloud SQL)entrypoint- HTTP routing (CloudFront, Load Balancers, Cloud CDN)identity- IAM roles and service accounts- Infrastructure plugins - Supporting resources (VPCs, security groups, load balancers)
 
Runtime Adapters Required: Services and storage plugins must provide runtime adapters in Go. These adapters power the generated client libraries that application code uses to interact with cloud resources. Other plugin types are purely infrastructure (Terraform only).
Plugin Structure
Plugin Library Repository
A plugin library is a Git repository containing one or more plugins. The recommended structure follows one module per plugin:Example Repository: See nitrictech/plugins-aws for a complete, production-ready plugin library with multiple AWS plugins.
The Plugin Manifest
Every plugin requires amanifest.yaml file that describes the plugin and its interface:
manifest.yaml
Manifest Fields Explained
name: Identifier used in platform definitions (e.g.,plugin: "suga/lambda")type: Determines how the plugin is used in applicationsrequired_identities: Anyidentityplugins this plugin depends on, such as an IAM rolecapabilities: Certain features may not be possible to implement with all cloud services. If a plugin implements any of these optional features, likeschedules, they should be listed under capabilitiesdeployment.terraform: Path to the Terraform module directoryruntime.go_module: Go import path for the runtime adapter (required for services and storage)inputs: Schema for configurable properties - these are passed to the resulting Terraform module as variablesoutputs: Any Terraform outputs you want to make available to other resources in the platforms that use this plugin
Terraform Module Structure
The Terraform module follows standard conventions:module/variables.tf
module/main.tf
module/outputs.tf
Runtime Adapters
Runtime adapters are required for service and storage plugins. They implement the translation layer between Suga’s abstract resource operations and cloud-specific APIs.Registration Differences:
- Service plugins register without a namespace: 
service.Register(New) - Storage plugins register with a namespace: 
storage.Register("team/library/plugin", New) 
When Runtime Adapters Are Needed
| Plugin Type | Runtime Adapter | Why | 
|---|---|---|
| Service | Required | Adapt to standard HTTP requests, e.g. on AWS Lambda it converts Lambda Events into HTTP Requests which are forwarded to application code | 
| Storage (Bucket) | Required | Implements file operations (read, write, delete, list, etc.) | 
| Database | Not needed | Connection strings typically injected via environment variables, SQL is already usable across providers | 
| Entrypoint | Not needed | Pure infrastructure - no runtime operations | 
| Identity | Not needed | Pure infrastructure - no runtime operations | 
Storage Plugin Runtime Adapter Example
Storage plugins must implement theStorage interface from github.com/nitrictech/suga/proto/storage/v2 and register with a namespace.
Here’s a complete example of a runtime adapter for an S3 bucket plugin:
s3-bucket/runtime.go
AI Assistance for Runtime Adapters: Writing runtime adapters is relatively easy, with well-defined specs. Making it an ideal task for AI coding agents like Claude Code or Cursor.Adding the Suga MCP server will help the agent understand how to build Suga Plugins. Allowing the agent to access Suga documentation and existing plugins for reference.
Service Plugin Runtime Adapter
Service plugins require runtime adapters that handle incoming requests/events from the underlying cloud compute service and translate them into a common HTTP request format.Service Interface
Service plugins MUST implement theService interface from github.com/nitrictech/suga/runtime/service:
- The 
Startmethod receives aProxythat forwards HTTP requests to the user’s application - Your runtime code translates cloud-specific events (Lambda events, container requests, etc.) into standard HTTP requests
 - The proxy handles forwarding these requests to the user’s application running locally
 - Your runtime code must register itself using 
service.Register()without a namespace 
Example Service Runtime Adapter
Here’s a complete example for AWS Lambda:lambda/runtime.go
- Initialize the service runtime environment
 - Handle request proxying and routing
 - Convert proprietary request/event types to standard HTTP requests
 
Go Module Path
Theruntime.go_module field in the manifest must match your actual Go module path:
manifest.yaml
go.mod
Local Development Workflow
Thesuga plugin serve command and suga build --replace-library flag enable rapid plugin development without publishing changes to a registry.
Why This Matters
Without these tools, every plugin change would require:- Pushing changes to Git
 - Tagging a new version
 - Publishing to the Suga platform or GitHub
 - Updating platform definitions to use the new version
 - Building applications to test changes
 
Step 1: Set Up Your Plugin Project
Create a new directory for your plugin library:Step 2: Start the Plugin Development Server
From your plugin library root directory:- Discovers all plugins in subdirectories
 - Validates manifest files
 - Serves plugin manifests over HTTP
 - Implements the Go module proxy protocol for runtime adapters
 - Watches for file changes (restart to pick up new plugins)
 
Step 3: Test Your Plugin in an Application
In a separate terminal, navigate to a Suga application that uses a platform with the plugin library you’re developing. Replace the library at build time:- Load your platform definition
 - Replace the 
suga/awslibrary with your local version athttp://localhost:9000 - Use your local plugin manifests and Terraform modules
 - Download runtime adapters from your local Go module proxy
 - Generate Terraform with your changes
 
Multiple Replacements: You can replace multiple libraries at once:
Step 4: Iterate and Refine
The development cycle becomes:- Edit your plugin files (manifest.yaml, Terraform, or Go code)
 - Rebuild your application: 
suga build -r suga/aws=http://localhost:9000 - Test the generated Terraform: 
cd terraform/stacks/my-app && terraform init --upgrade && terraform plan - Repeat: Make adjustments and rebuild
 
Step 5: Using with Custom Platforms
If you’re developing both a platform and plugins simultaneously: Option 1: Replace in platform definition Edit yourplatform.yaml to reference your local server:
platform.yaml
Testing Your Plugins
After building, validate the generated Terraform:- ✅ Variables passed correctly from manifest to Terraform
 - ✅ Resources created with proper names and configurations
 - ✅ Outputs available for other resources to reference
 - ✅ No Terraform errors or warnings
 
Advanced Topics
Identity Dependencies
Sugaidentity plugins are a special type of plugin. They’re not deployed independently, instead they’re attached to service plugins, in order to grant that service access to other resources.
Plugins, such as Buckets, can specify that a Service will require a specific identity type before accessing them will be possible. This is specified using the required_identities field:
s3/manifest.yaml
identity_type field:
iamrole/manifest.yaml
platform.yaml
Using Infrastructure Outputs
Plugins may need to reference outputs from other infrastructure in your platform, this is done by specifyinginputs for the plugins that need external data and outputs from plugins that provide the data:
fargate/manifest.yaml
vpc/manifest.yaml
${infra.*}:
platform.yaml
Custom Plugin Capabilities
Not all cloud services are equal, some have advanced features, others have a more basic feature set. Suga faced a few choices to deal with these differences, such as requiring all plugins to cover all advanced features, meaning certain services wouldn’t be usable as Suga plugins. Alternatively, we could set a lowest-common-denominator interface (i.e. don’t expose any advanced features, to maximize compatibility). Instead, Suga declares certain features as optional for plugins to implement. We call these optional featurescapabilities. If a plugin chooses to implement one of these capabilities, it should declare it in using the capabilities list:
lambda/manifest.yaml
Next Steps
Once you’ve developed and tested your plugins locally:- Commit your changes to your plugin library repository
 - Tag a version following semantic versioning (v0.0.1, v0.1.0, etc.)
 - Push to Git so it’s accessible
 - Publish to Suga using the Plugin Libraries UI
 - Update platforms to use your published plugins
 - Share with your team or the Suga community
 
Reference Implementation
Study the official Suga plugin libraries for best practices:- AWS Plugins: github.com/nitrictech/plugins-aws
 - GCP Plugins: github.com/nitrictech/plugins-gcp
 
Using AI Agents for Plugin Development
When writing plugins or runtime adapters consider using AI coding agents like Claude Code or Cursor with the Suga MCP integration. This is particularly valuable when writing runtime adapters if you’re more familiar with cloud infrastructure than Go programming.Additional Resources
- Platform Development Guide - Learn how platforms compose plugins
 - Suga MCP Integration - Use AI agents to help build plugins
 - Platforms Overview - Understand how plugins fit into the architecture
 - Suga CLI Reference - Complete CLI documentation
 
Need Help? Get in touch with the Suga Team or check the GitHub Discussions for plugin development questions.