kubiya_source
resource allows you to connect Git repositories containing tools and workflows to the Kubiya platform. These repositories provide agents with the functionality needed to perform tasks. For inline tool and workflow definitions, use the kubiya_inline_source
resource instead.
Sources are the foundation for extending agent capabilities. They allow you to version control your tools and workflows while making them available across your organization.
Prerequisites
Before using this resource, ensure you have:- A Kubiya account with API access
- An API key (generated from Kubiya dashboard under Admin → Kubiya API Keys)
- A Git repository containing tools and workflows (public or with appropriate credentials)
- The repository URL accessible from your Kubiya environment
Quick Start
Configuration Examples
Create environment-specific sources for different deployment stages:
Advanced Configurations
Multiple Git Providers
Multiple Git Providers
Configure sources from different Git providers:
Team-Specific Tool Sources
Team-Specific Tool Sources
Organize sources by team or function:
Arguments Reference
Required Arguments
URL to a Git repository containing tools and workflows. Supports HTTP/HTTPS URLs for public and private repositories.
Optional Arguments
The runner to use for executing tools from this source. Use “kubiya-hosted” for cloud execution or specify your custom runner.
JSON-encoded configuration for the source. Common options include:
branch
- Git branch to use (e.g., “main”, “develop”)tag
- Git tag to use for version pinning (e.g., “v1.2.0”)path
- Subdirectory within the repository containing toolsauth
- Authentication method for private repositoriesenvironment
- Environment identifier for organization
Attributes Reference
In addition to all arguments above, the following attributes are exported:The unique identifier of the source.
The computed name of the source (derived from repository name).
Repository Structure
Your Git repository should follow these conventions for tools and workflows:Import
Sources can be imported using their ID:Best Practices
Version Control
- Use specific branches or tags for production deployments
- Implement proper Git branching strategy (main, develop, feature branches)
- Tag releases with semantic versioning (v1.2.3)
- Use different branches for different environments
Repository Organization
- Organize tools logically within your repository structure
- Use clear naming conventions for tools and workflows
- Include comprehensive README files and documentation
- Group related tools in subdirectories by function or team
Security
- Use private repositories for proprietary or sensitive tools
- Configure appropriate Git credentials via Kubiya integrations
- Implement access controls and code review processes
- Audit tool usage and repository access regularly
Testing & Deployment
- Test repository connections in development environments first
- Validate tool definitions before committing to main branches
- Implement CI/CD pipelines for tool repositories
- Monitor source health and tool execution success rates
Dynamic Configuration Options
Compatibility
Requirements:
- Kubiya Terraform Provider version >= 1.0.0
- Terraform >= 1.0
- Git repositories must be accessible (public or with appropriate credentials)
- Sources must be created before agents can reference them
Supported Providers:
- GitHub (github.com)
- GitLab (gitlab.com and self-hosted)
- Bitbucket (bitbucket.org)
- Azure DevOps
- Other Git providers accessible via HTTP/HTTPS
Important Considerations:
- Repository URLs must be accessible from the Kubiya environment
- Private repositories require proper authentication setup
- Tool definitions must follow Kubiya schema specifications
- Large repositories may impact source loading times
Troubleshooting
Repository Access Issues
Repository Access Issues
- Verify the repository URL is correct and accessible
- Check authentication configuration for private repositories
- Ensure the Kubiya service has network access to the Git provider
- Validate credentials and permissions for the repository
Tool Loading Problems
Tool Loading Problems
- Check that tool definitions follow the correct schema
- Verify file paths and directory structure in the repository
- Review dynamic_config path settings for accuracy
- Ensure tool files have proper YAML syntax
Branch/Tag Resolution
Branch/Tag Resolution
- Verify that specified branches or tags exist in the repository
- Check for typos in branch/tag names (case-sensitive)
- Ensure the branch/tag contains the expected tool files
- Review Git provider permissions for tag/branch access