Skip to content

arslanbekov/terraform-provider-sendgrid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Terraform Provider for SendGrid

Build Status Go Report Card codecov Go Version License

A comprehensive Terraform provider for managing SendGrid resources with enhanced features and reliability.

Key Features

  • 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

Quick Start

# 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"]
}
terraform init && terraform apply

Documentation

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

Popular Use Cases

  • 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

Supported Resources

  • 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

See full documentation for details.

Quick Links

Development

Requirements

Building

go build -o terraform-provider-sendgrid

Testing

The provider includes both unit tests and acceptance tests:

# Run unit tests
make test

# Run acceptance tests (requires SENDGRID_API_KEY)
make testacc

Note: Test coverage is primarily achieved through acceptance tests against the real SendGrid API. Current coverage: ~44% (standard for Terraform providers with external API dependencies).

See TESTING.md for detailed testing instructions.

Contributing

Contributions are welcome! We'd love your help improving this provider.

Before contributing:

Quick start:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Add tests for your changes
  4. Run make fmt and make lint
  5. Commit your changes with clear messages (Conventional Commits)
  6. Push to your branch and create a Pull Request

For significant changes, please open an issue first to discuss the proposed changes.

License

This project is licensed under the Mozilla Public License 2.0.

Support

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.

Sponsor this project

 

Packages

No packages published

Contributors 9

Languages