A comprehensive Terraform provider for managing SendGrid resources with enhanced features and reliability.
Fully compatible with OpenTofu - This provider works seamlessly with both Terraform and OpenTofu.
- Advanced Rate Limiting - Built-in exponential backoff and retry logic for reliable operations
- Teammate Management - Complete lifecycle management, including pending invitations and SSO support
- Template Management - Full template and version control with dynamic content
- Webhook Security - OAuth and signature verification for parse webhooks
- Event Webhooks - Real-time email event notifications with friendly names
- Multiple Auth Methods - Environment variables, Terraform variables, and CI/CD integration
- Rich Documentation - Extensive examples, troubleshooting guides, and API references
# Set your API key
export SENDGRID_API_KEY="SG.your-api-key-here"terraform {
required_providers {
sendgrid = {
source = "arslanbekov/sendgrid"
version = "~> 2.0"
}
}
}
provider "sendgrid" {}
resource "sendgrid_teammate" "example" {
email = "teammate@example.com"
is_admin = false
is_sso = false
scopes = ["mail.send"]
}# Using Terraform
terraform init && terraform apply
# Or using OpenTofu
tofu init && tofu apply| Topic | Description |
|---|---|
| Installation | Installation methods and requirements |
| Authentication | All authentication methods and security best practices |
| Resources | Complete list of resources and data sources |
| Troubleshooting | Common issues and solutions |
| Rate Limiting | Rate limiting handling and best practices |
| Migration Guide | Guide for migrating between major versions |
| Testing Guide | How to run and write tests |
- Team Management: Invite and manage teammates with specific permissions
- Email Templates: Create and version email templates
- API Key Management: Secure API key creation with minimal scopes
- Domain Setup: Configure domain authentication and link branding
- Webhook Configuration: Set up event and parse webhooks
- Teammate Management:
sendgrid_teammate- Manage team members and permissions - Templates:
sendgrid_template,sendgrid_template_version- Email template management - API Keys:
sendgrid_api_key- Scoped API key management - Domain Configuration:
sendgrid_domain_authentication,sendgrid_link_branding- Domain setup - Webhooks:
sendgrid_event_webhook,sendgrid_parse_webhook,sendgrid_webhook_security_policy- Webhook configuration - SSO:
sendgrid_sso_integration,sendgrid_sso_certificate- Single Sign-On setup - Subusers:
sendgrid_subuser- Subuser account management - Unsubscribe Groups:
sendgrid_unsubscribe_group- Manage unsubscribe groups - Domain Validation:
sendgrid_domain_authentication_validation- Domain DNS validation
See full documentation for details.
go build -o terraform-provider-sendgridThe provider includes unit tests (with mock HTTP servers) and acceptance tests (against real SendGrid API):
# Run all unit tests (no API key needed)
go test ./... -timeout=60s
# Run acceptance tests (requires SENDGRID_API_KEY)
export SENDGRID_API_KEY="your-key"
export TF_ACC=1
go test -v ./sendgrid/ -run '^TestAcc' -timeout=30m -parallel=1All resources have unit tests with mock HTTP servers covering Read (success, 404, error), schema validation, and key CRUD operations. Acceptance tests run against the real API on the master branch.
See TESTING.md for detailed testing instructions.
Contributions are welcome! We'd love your help improving this provider.
Before contributing:
- Read our Contributing Guide
- Review the Code of Conduct
Quick start:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Add tests for your changes
- Run
make fmtandmake lint - Commit your changes with clear messages (Conventional Commits)
- Push to your branch and create a Pull Request
For significant changes, please open an issue first to discuss the proposed changes.
Need help with integrating this provider or other Terraform/OpenTofu solutions? I offer professional services including:
- Provider Integration - Custom implementation and configuration
- Migration Assistance - Smooth migration from manual setup to Infrastructure as Code
- Terraform/OpenTofu Consulting - Architecture design and best practices
- Custom Provider Development - Terraform providers for your specific needs
- Training & Workshops - Team training on Terraform/OpenTofu
For inquiries and collaboration opportunities, please contact: sendgrid@arslanbekov.com
This project is licensed under the Mozilla Public License 2.0.
For support options, see our Support Guide.
Disclaimer: This is an unofficial provider maintained by the community. While it offers enhanced features and comprehensive testing, evaluate thoroughly for production use.