Graham
08/05/2025, 8:48 PMAsk Inkeep
08/05/2025, 8:48 PMPermit Support Automation
08/05/2025, 8:48 PMAsk Inkeep
08/05/2025, 8:48 PMcopy-env API
• Test and review changes in staging
• Once approved, copy from staging to production
2. Preview Branches Flow (Recommended)
This creates dynamic environments for each policy "pull request" :
• Use the create-env API to create a preview environment
• Use the copy-env API to copy from source to the preview environment
• After testing, use copy-env again to merge into production
Using the CLI for Migration
The Permit CLI provides commands to manage this workflow (2) :
permit env create --api-key permit_key --name "Staging" --description "Staging environment for testing"
To promote policies between environments:
permit env copy --api-key permit_key --from staging --to production
GitOps Integration
You can map branches when connecting your Permit Project to a repository (1) . This creates two lines of branches:
• Your application branches
• Your policy branches (Permit Environments)
These are connected through PDPs using environment API-secret-keys to sync to specific environments .
Environment Access Control
Each environment can have its own access control to gate who can affect the policy at each stage . For example, you can give only the developer who triggered the CI flow access to the preview environment .
Key Points to Remember
• PDPs are deployed with environment-specific API keys
• You can migrate an application to a new policy by simply pointing its PDP to a new environment
• The system maintains version control and consistency across environments using a Git-like modelAsk Inkeep
08/05/2025, 8:48 PMEli Moshkovich
08/05/2025, 10:55 PMGraham
08/06/2025, 6:25 AMOmer Zuarets
08/06/2025, 6:57 AMGraham
08/06/2025, 10:54 AMOmer Zuarets
08/06/2025, 11:03 AMGraham
08/07/2025, 6:30 AMAsk Inkeep
08/07/2025, 6:30 AMAsk Inkeep
08/07/2025, 6:31 AMterraform {
required_providers {
permitio = {
source = "<http://registry.terraform.io/permitio/permit-io|registry.terraform.io/permitio/permit-io>"
version = "~> 0.0.1"
}
}
}
(1)
provider "permitio" {
api_url = "<https://api.permit.io>" # Defaults to - "<https://api.permit.io> - Can be set as an environment variable PERMITIO_API_URL
api_key = "YOUR_API_KEY" # Can be set as an environment variable PERMITIO_API_KEY
}
The Permit Terraform Provider decouples policy configuration from data, allowing you to define roles, permissions, and resources using Terraform's declarative syntax (2) . You can version your policies, manage branches, and integrate them seamlessly with your CI/CD pipeline .
For your DigitalOcean App Platform deployment, you'd use DigitalOcean's Terraform provider alongside Permit's provider. Your Terraform configuration would manage both:
• DigitalOcean infrastructure (via DO's provider)
• Permit.io authorization policies (via Permit's provider)
Consider using the Permit Terraform provider to manage environment baselines and policy changes systematically (3) . Since policies are now part of your infrastructure as code, you can version them, manage branches, and integrate them seamlessly with your CI/CD pipeline (2) .Ask Inkeep
08/07/2025, 6:31 AMGraham
08/07/2025, 6:33 AMAsk Inkeep
08/07/2025, 6:33 AMAsk Inkeep
08/07/2025, 6:33 AMterraform {
required_providers {
permitio = {
source = "<http://registry.terraform.io/permitio/permit-io|registry.terraform.io/permitio/permit-io>"
version = "~> 0.0.1"
}
}
}
(1)
provider "permitio" {
api_url = "<https://api.permit.io>" # Defaults to - "<https://api.permit.io> - Can be set as an environment variable PERMITIO_API_URL
api_key = "YOUR_API_KEY" # Can be set as an environment variable PERMITIO_API_KEY
}
With Permit's Terraform Provider, you can create resources like roles and permissions :
resource "permitio_role" "reader" {
key = "reader"
name = "Reader"
description = "A role that allows reading documents"
permissions = [
"document:read"
]
extends = []
depends_on = [
permitio_resource.document # This is required to ensure that the resource is created before the role (for the permissions assignment)
]
}
The Permit Terraform Provider decouples policy configuration from data, allowing you to define roles, permissions, and resources using Terraform's declarative syntax (2) . Since policies are now part of your infrastructure as code, you can version them, manage branches, and integrate them seamlessly with your CI/CD pipeline .
For specific information about DigitalOcean's Terraform provider and how to configure it with theiAsk Inkeep
08/07/2025, 6:33 AM