Authava Terraform Provider
The Authava Terraform provider allows you to manage your Authava resources as code, making it easy to automate the provisioning and configuration of your authentication infrastructure.
GitHub Repository
The Terraform provider is available on GitHub at:
https://github.com/authava/terraformInstallation
Configure the Authava Terraform provider in your Terraform configuration:
terraform {
required_providers {
authava = {
source = "authava/authava"
version = "~> 1.0"
}
}
}
provider "authava" {
api_key = var.authava_api_key
domain = "api.authava.com"
}
Basic Usage
Managing Domains
Create and configure authentication domains:
resource "authava_domain" "example" {
domain = "auth.example.com"
email_provider = "authava"
whitelabel {
company_name = "Example Inc."
logo_url = "https://example.com/logo.png"
primary_color = "#4F46E5"
secondary_color = "#818CF8"
footer_text = "© 2023 Example Inc."
terms_url = "https://example.com/terms"
privacy_url = "https://example.com/privacy"
}
}
Configuring Email Settings
Configure email settings for your domains:
resource "authava_email_settings" "example" {
domain_id = authava_domain.example.id
provider_type = "authava"
from_email = "[email protected]"
from_name = "Example Authentication"
theme {
style = "modern"
brand_color = "#4F46E5"
secondary_color = "#818CF8"
button_style = "solid"
}
subjects {
welcome = "Welcome to Example Inc."
forgot_password = "Reset your Example Inc. password"
mfa_code = "Your Example Inc. verification code"
password_changed = "Your Example Inc. password has been changed"
email_changed = "Your Example Inc. email has been changed"
}
}
Setting Up Social Providers
Configure social login providers:
resource "authava_social_provider" "github" {
domain_id = authava_domain.example.id
provider_type = "github"
client_id = var.github_client_id
client_secret = var.github_client_secret
is_active = true
}
resource "authava_social_provider" "google" {
domain_id = authava_domain.example.id
provider_type = "google"
client_id = var.google_client_id
client_secret = var.google_client_secret
is_active = true
}
Managing Origins
Configure allowed origins for CORS and redirects:
resource "authava_origins" "example" {
domain_id = authava_domain.example.id
origins = [
"https://example.com",
"https://app.example.com",
"http://localhost:3000"
]
}
Features
- Infrastructure as Code: Manage your Authava resources using Terraform
- Domain Management: Create and configure authentication domains
- Email Configuration: Set up email delivery settings
- Social Providers: Configure social login providers
- Origin Management: Manage allowed origins for CORS and redirects
- Whitelabel Settings: Customize the appearance of your authentication pages
Advanced Configuration
For more advanced configuration options and detailed documentation, please refer to the GitHub repository.