G RATIO TECH
Blog

Web & Cloud

CloudFront network calls: decide what happens when a service fails

CloudFront Functions gains network calls. Plan failure behaviour, access decisions and measurement before putting another service in the path of a customer request.

· G RATIO TECH · Technology insights

The verified update

On November 18, AWS announced network calls in CloudFront Functions. The cf.fetch() method can use an API response to decide how a request is handled; cf.beacon() can send background events. This adds an architectural option, not proof that a particular website will become faster.

Our recommendation: classify the decision first

Separate optional presentation choices from access decisions. A failed recommendation lookup might reasonably fall back to a generic page. A failed permission check should not silently grant access. Write down the expected result for each dependency before implementation: continue with a safe default, refuse the operation or show a temporary error. Choose the behaviour with the application owner, not solely to make an error counter fall.

Use a concrete failure table

For a proposed account-access check, list a valid approval, an explicit refusal, an unavailable service, a slow response and an unexpected response format. Specify what the customer sees in each case. Include an explanation that helps a legitimate user retry or seek support without revealing sensitive diagnostic details. These are suggested scenarios, not results of tests performed on your infrastructure.

Check the service behind the call

Estimate how many customer requests could reach the dependency and whether its capacity matches that pattern. Agree on limits, monitoring and responsibility for incidents. Review the information sent with each call and keep unnecessary personal data and secrets out of event payloads. A small edge function can still create substantial work for the service it calls; assess the complete request path.

Keep access and caching aligned

During the pilot, verify that cached responses cannot expose one user’s content to another. Test authorised and unauthorised users against the same requested resource, including after permissions change. Review the application’s own authorisation as well. Moving a check earlier in the path should not become an excuse to remove controls elsewhere without an explicit design review.

Release with evidence and a recovery plan

Compare customer-visible response time, failures and observed consumption before and during a limited rollout. Measure optional background events separately from decisions required to serve a request. Define who can disable the change and what safe behaviour remains afterwards. Expand only when the failure tests and operational evidence are acceptable; do not treat a successful happy-path demonstration as a production readiness check.

Discuss your technical priorities ↗