For Fargate deployments,
Permit.io supports both approaches, with *sidecar deployment being the most common and recommended pattern* for production use
(1) .
The sidecar pattern is explicitly recommended as "the most common way to deploy the PDP locally" where "you run one PDP container next to each of your own microservices" . This approach provides zero-latency between your application and the PDP, along with improved stability and security .
According to the deployment documentation, PDPs are "usually initially deployed as sidecars or within load-balanced containers using services like Fargate"
(2) . The sidecar pattern is particularly beneficial because it:
• Eliminates network latency between your app and the PDP
(1)
• Scales automatically with your application
• Provides better stability with no dependency on other clouds
For ECS-Fargate specifically, you'll need to configure:
• Container ports:
7000
(required for PDP API) and
8181
(optional for direct OPA access)
(3)
• Image URI:
permitio/pdp-v2:latest
• Environment variable:
PDP_API_KEY
with your API key
The best practice recommendation states that using a sidecar design pattern ensures "each application component has its own dedicated PDP, which can be independently controlled and updated"
(4) . This pattern is especially beneficial for "applications that require low latency and high data reliability" .