Pods
Authorizers & resource policies
Decide who can call an API: JWT and custom authorizers, authorization on each method or route, API key requirements and REST resource policies.
Authorizers
Caching and timeouts
Every authorizer has two limits, set in its dialog.
- Result cache TTL (seconds): from 0 to 3600. Pods remembers each result for that long, keyed by the identity values, so repeat calls skip the check. 0 turns caching off. JWT authorizers and custom authorizers on HTTP APIs start at 0; other custom authorizers start at 300.
- Timeout (ms): from 1000 to 29000, 10000 by default. A function that takes longer fails the call with 500.
A cached policy is still checked against each method, so a policy cached from GET /pets can deny POST /pets. Denials and 401s are cached too; errors aren't.
Authorizers
Editing and deleting authorizers
Click an authorizer, or choose Edit in its ⋯ menu, to change it, then choose Save Changes. Everything except the type can change.
To delete one, choose Delete in its ⋯ menu. Pods asks you to confirm. Methods and routes that used it lose their authorization check, and it can't be undone. Like other changes to the API, edits and deletions reach callers when you next deploy.
Resource policies
Resource policies
A resource policy filters calls to a REST API by IP address, connector or signing principal, before any authorizer runs. An explicit Deny always wins. It's in the Resource policy card of the API editor's Settings section, and only Owners and Admins can edit it.
- Optional: under Start from a template, choose IP allow-list, Deny IP range, Connector-only private API or Cross-project principal allow. The template replaces the editor's text.
- Edit the JSON in Policy document, up to 8192 characters, with
VersionandStatement. - Choose Save Policy.
A saved policy takes effect on the API's next deployment. Clear removes the policy after you confirm, and from the next deployment callers are no longer filtered.
Resource policies
Simulating a resource policy
The Policy simulator, under the resource policy in a REST API's Settings section, checks the saved policy against a sample call. It doesn't need a deployment.
- In Method ARN, type the call to check, in the form
arn:pods:execute-api:auto:{project ID}:{API ID}/{stage}/{method}/{path}. - Type a Source IP, and optionally a Principal ARN.
- Choose Simulate.
The result shows Allow or Deny, and which statements matched.