Function Configuration
Configure your Edge Compute functions with environment variables, secrets, and deployment settings for different environments.Configuration File (func.toml)
Each function includes afunc.toml configuration file:
Environment Variables
Setting Environment Variables
Via Configuration File
Accessing Environment Variables
Python
Go
Secrets Management
Storing Secrets
Use the CLI to securely store sensitive data:Accessing Secrets
Secrets are available as environment variables in your function:Best Practices for Secrets
DO:- Store sensitive data as secrets, not environment variables.
- Use descriptive names for secrets.
- Rotate secrets regularly.
- Use different secrets for different environments.
- Store secrets in your source code.
- Log secret values.
- Share secrets via insecure channels.
- Use the same secrets across all functions.
Bindings
Bindings enable your edge functions to call Telnyx APIs without managing API keys. Once you create a binding for your organization, your functions can use the Telnyx SDK to access messaging, voice, and other Telnyx services.Creating a Binding
Create a binding for your organization:Managing Bindings
Using Telnyx APIs in Your Function
With a binding configured, use the Telnyx SDK in your functions:Python
Go
Bindings vs Secrets
Use bindings for Telnyx API access — credentials are managed automatically. Use secrets for third-party services or when you need multiple different credentials.Runtime Configuration
Functions run with default resource allocation and timeout settings optimized for typical workloads. Custom resource configuration may be available in future releases.Configuration Validation
Validating Configuration
Configuration Schema
Define configuration schema for validation:Configuration Best Practices
Security
- Use secrets for sensitive data.
- Validate configuration at startup.
- Use environment-specific configurations.
- Never log secret values.
Maintainability
- Document all configuration options.
- Use descriptive variable names.
- Group related settings.
- Version your configuration files.