Specify Public Delivery and Optional Private Administration
A capstone is a delivery with a reviewer, not a longer tutorial. You will build one public request path, split its ownership across two roots, prove each layer, promote it through a protected plan, break it once on purpose, and reconcile both roots. The output is a small working system plus the evidence that it behaves as designed.
Keep the required path small enough to finish. One zone, one public hostname, one AWS region, one ALB across two Availability Zones, and one immutable application release. A second region is a design decision you can record and defer; it is not required to pass.
Private administration is an extension, not a shortcut around the public path. Access in front of a Tunnel gives an admin surface with no inbound origin listener, but it adds an identity policy, a connector, a separate hostname, and a second acceptance path. Choose it explicitly or record that it is out of scope.
If administration is in scope, it gets a separate hostname and a separate policy. A Tunnel origin has no inbound listener for Cloudflare to present a client certificate to, so AOP does not apply to that hostname and Access becomes the authorization decision. The public path still needs its own TLS and reachability proof; one does not cover the other.
Scope is a written boundary, not a feeling. The record names the hostname, zone, region, origin, admin decision, cost ceiling, owner and review date. If the scope says "the edge", no test can fail it.
The reviewer should be able to reject the project on paper. The scope record, ownership matrix and acceptance table are reviewed before the first credential is issued. A capstone that cannot be rejected before it is built cannot be accepted after it is built.
| ID | Deliverable | Accepted when |
|---|---|---|
| D1 | Scope and decision record | One named public hostname and an explicit admin in-or-out decision |
| D2 | Ownership matrix for both roots | Every object has one root, one state key and one credential scope |
| D3 | Origin root and edge root | Both plan, apply and destroy without manual console edits |
| D4 | Proof log for TLS and reachability | Edge trust, origin trust and a refused direct path are recorded |
| D5 | Promotion record | Plan digest and image digest were approved together and applied once |
| D6 | Recovery and reconciliation report | One controlled failure recovered, both roots at no-change plans |
The boundary table decides what the project will not do. Exclusions are not failures; they are the reason the work is reviewable. Write them down before the first plan and revisit them only with a new approval.
| Boundary | Included | Excluded |
|---|---|---|
| Traffic | One public hostname, HTTPS, cache and WAF | Multi-region steering, custom hostnames |
| Administration | Optional Access and Tunnel path | Permanent break-glass access, shared admin accounts |
| Data | Stateless application responses | Customer data migration, database replication |
| Cost | One ALB, one release, bounded probe volume | Paid add-ons without an approved entitlement |
The required and optional paths fail differently, so they get separate evidence. A public failure is visible as a status code at the edge; an admin failure is a challenge loop, a policy mismatch, or a connector that is up while the route is wrong. One test must not stand in for the other.
Figure 1 shows the decision the scope record has to make: the public application is required, and private administration is a branch that either gets its own proof or is closed.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
S["Scope record
hostname · zone · region"] --> P["Public path
app.example.com"]
S --> A{"Private admin
in scope?"}
P --> E["Edge policy
TLS · WAF · cache"]
A -->|"no"| N["Record the decision
no admin surface"]
A -->|"yes"| T["Access and Tunnel
admin.example.com"]
E --> G1{"Edge and origin
proved?"}
T --> G2{"Identity and route
proved?"}
G1 -->|"no"| X["Stop
no policy cutover"]
G2 -->|"no"| X
G1 -->|"yes"| OK["Acceptance review"]
G2 -->|"yes"| OK
N --> OK
classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
class S,P primary;
class E,T secondary;
class A,G1,G2,N warn;
class OK ok;
class X danger;
Figure 2 is the layer map the remaining sections test. Read it from the visitor inward: DNS and proxy, edge TLS and policy, the optional balancer, then the origin listener and target. Every arrow is a handoff that needs an owner and a proof.
Write the scope record before the first plan. It is a one-page document in the project repository, reviewed with the same care as the Terraform. It prevents the most common capstone failure: a project that quietly grows until no single reviewer can accept it.
Partition Accounts, Roots and Runtime Owners
Two roots are the minimum honest partition. One root owns the Cloudflare account and zone objects; the other owns the AWS origin. The accounts are separate as well, and neither provider's credential is valid in the other's root. A third root for the application release is acceptable, but it must not also own infrastructure.
The partition follows the API object graph. DNS records and zone settings are zone-scoped, load balancer monitors and pools are account-scoped, and ALBs, target groups and security groups are regional AWS objects. A root that mixes them can still plan cleanly while holding two blast radii.
Separate accounts per environment where the product allows it. Account-scoped pools, monitors and rulesets are shared by every zone in the account, so staging and production in one account share a blast radius even when the zones differ. When a second account is not possible, use a dedicated zone, a lab- prefix, and prevent_destroy only on objects you intend to keep.
| Object | Root | State key | Credential scope | Runtime owner |
|---|---|---|---|---|
| Zone, DNS records, proxy status | Edge | edge/prod | Zone DNS edit | Edge team |
| TLS mode, minimum version, HSTS | Edge | edge/prod | Zone settings edit | Edge team |
| WAF rules and cache rules | Edge | edge/prod | Zone WAF and cache edit | Edge team |
| Load balancer, pools, monitor | Edge | edge/prod | Account Load Balancing edit | Edge team |
| ALB, listener, target group | Origin | origin/prod | Elastic Load Balancing in one region | Origin team |
| Security group and trust bundle | Origin | origin/prod | EC2 security group edit | Origin team |
| ACM certificate | Origin | origin/prod | ACM issue and read | Origin team |
| Application image and tag | Release | release/prod | Registry push only | Application team |
The runtime owner is not the same as the Terraform owner. A platform team may merge the change, but the origin team owns the ALB and the edge team owns the zone at three in the morning. Write the on-call owner beside each object, because a shared root with no runtime owner produces a fast apply and a slow incident.
The edge root never authenticates to AWS. The ALB DNS name, hosted zone and certificate identity arrive as input variables from a published contract. Reading the origin root's state through a broad role would make the boundary cosmetic and the plan unreviewable.
The origin root never edits Cloudflare. It can publish the ALB name and install an AOP trust bundle, but it does not create the DNS record, the pool or the WAF rule. If it does, the next edge apply will revert the change and the two plans will alternate forever.
Shared objects need a handoff artifact, not a second resource. An AOP certificate is created in Cloudflare and its CA bundle is installed in the origin trust store. The bundle is a versioned artifact with an owner and a rotation date, and the origin root consumes that version rather than inventing its own.
A duplicated object is worse than a missing one. A missing record fails loudly and once. A duplicated record passes both reviews, then reverts on alternate applies, which looks like provider drift and trains the team to ignore the plan.
Figure 3 assigns one owner to each object and turns every cross-root dependency into a named artifact.
Read the ownership map in both directions. Every box has one root, and every arrow is an artifact or a variable. An arrow that is a credential means the boundary leaked, even if the plans are currently clean.
Figure 4 follows the mechanics of the pair, including the branches that produce a valid plan with the wrong owner.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
O["Origin root plan
ALB · listener · ACM · SG"] --> C["Contract outputs
ALB DNS · zone · cert name"]
C --> E["Edge root plan
DNS · TLS · WAF · cache · LB"]
E --> Q{"Contract matches
the origin?"}
Q -->|"no"| X1["Stop
unknown or stale origin"]
Q -->|"yes"| AO["Apply origin root"]
AO --> AE["Apply edge root"]
AE --> R{"One owner
per object?"}
R -->|"duplicate DNS"| X2["Two writers
alternating revert"]
R -->|"shared pool"| X3["Cross-zone blast radius"]
R -->|"yes"| OK["Reconciled pair
two no-change plans"]
X1 --> F["Fix contract
then re-plan both"]
classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
class O,AO primary;
class C,E secondary;
class Q,R warn;
class OK ok;
class X1,X2,X3 danger;
class F warn;
Plan addresses are part of the review. A resource moving between roots is a destroy and a create unless a moved block preserves it. State surgery is a change with its own approval, not a cleanup task at the end of the day.
A contract change is a versioned change. Add a field, bump the contract version, update the consumer and plan both roots. Editing an output in place is how one root starts reading a value the other has not applied yet.
Prove TLS and Origin Reachability Before Policy Cutover
Prove the path in the order traffic takes it. DNS resolution, edge TLS, origin TLS, then application readiness. Policy cutover comes last because it changes what happens to requests that already pass those checks.
Edge trust is the first checkpoint. The edge certificate must be publicly trusted, cover the hostname, and have a not-after date beyond the review window. The zone mode must be Full (strict), with a minimum TLS version of at least 1.2.
Origin trust is the second checkpoint. The ALB listener presents a certificate that chains to a public root and covers the name Cloudflare targets. If the pool overrides the Host header, the certificate must cover both the application host and the origin name.
Do not relax the mode to make a probe pass. Full encrypts without validating, and Flexible sends plaintext to the origin. Both turn a visible 526 into an invisible trust failure, which is a worse outcome than a failed test.
Reachability is the third checkpoint. With AOP, a direct request must fail the handshake; with an allowlist alone, it must be refused or recorded as residual risk. Test from outside the VPC, because a request from inside the network proves nothing about the public path.
DNS has two names with two jobs. A grey-clouded origin name gives the pool a stable target, while the proxied application hostname is what visitors use. A balancer hostname owns its record, so declaring a second record for the same name creates a silent second answer.
Keep one proof log with one row per checkpoint. Each row holds the action, the source network, the timestamp, the observed result and the request identifier. A screenshot is an illustration; the log is the evidence a reviewer can compare across runs.
Use the verifier, not the dashboard. openssl s_client -showcerts with SNI tests a certificate chain, and curl --resolve sends a request to a chosen address while keeping the public name. Neither command changes state, so both are safe to repeat during a review.
| Check | Method | Pass condition | Failure signal |
|---|---|---|---|
| Edge certificate | openssl s_client with the public hostname | Public issuer, SAN match, valid dates | Origin CA issuer or wrong name |
| Zone mode | Read the setting back after apply | Full (strict), TLS 1.2 or higher | Flexible or Full without validation |
| Origin certificate | Handshake with the name Cloudflare targets | Complete chain, SAN match, unexpired | Missing intermediate or wrong SAN |
| Direct origin | Request with the public name against the origin address | Handshake rejected with AOP on | A 200 response means the origin is public |
| Application readiness | Health path through the edge on a cache miss | Expected status and body | 5xx, redirect or stale cache hit |
Figure 5 places the three checkpoints on the request path and keeps the bypass attempt visible, because a blocked bypass is part of the proof.
Cutover is a named gate with a timestamp. Record the baseline before it, the exact change, and the first request after it. If any checkpoint is red, stop; a relaxed TLS mode is not a rollback, it is a new risk.
Enforce in two steps when the policy supports observation. Run the WAF matrix in a log or simulate action first, compare the would-be decisions with the allowed cases, then switch to enforce. The second apply changes the action, not the match conditions, so the reviewed expression stays the same.
Cache can hide a broken origin. A HIT can serve a valid edge response while the origin is failing. That is why origin checks run on a cache miss or a deliberate probe, not only on the visitor path.
A refused bypass is evidence, not an accident. Save the command, the source network and the result. If the origin answers directly, the edge policy is protecting a door that is already open.
Test Cache, WAF and Health-Based Routing
Test behaviour, not attributes. A plan that contains a WAF rule proves the rule exists; a request proves it blocks. A cache rule proves intent; a response header proves a HIT.
Fix the matrix before you run it. One row per case, one variable per row, one expected result. Adding a case after seeing a failure turns a test into a negotiation.
Instrument the baseline before changing policy. Record one uncached response, one cached response, the origin marker and the status code for each case. Without a baseline, a 403 and a 200 are both anecdotes.
| ID | Case | Request | Expected | Evidence |
|---|---|---|---|---|
| C1 | Static asset miss then hit | Same asset twice | MISS then HIT | Cache status header |
| C2 | Authenticated response | Request with a session cookie | Not stored in shared cache | Cache status and response headers |
| C3 | Deliberate bypass path | Request to the bypass route | Bypass, no shared copy | Cache status header |
| C4 | Allowed request | Normal page request | Served, no challenge | Status and edge log |
| C5 | Denied request | Canary header set to block | 403 from the intended rule | Status and rule identifier |
| C6 | Admin path, if in scope | Request without identity | Challenge or redirect to login | Access log and status |
| H1 | Primary healthy | Regular request | Primary origin answers | Origin marker and pool health |
| H2 | Primary unhealthy | Health path fails | Secondary answers inside budget | Pool health and first secondary response |
| H3 | Recovery | Restore the primary | Primary answers again | Pool health and origin marker |
| H4 | Last resort | All default pools critical | Fallback or a documented error | Balancer response |
WAF tests use a harmless canary. Add a temporary custom rule that matches a request header you control, prove the allowed request and the denied request, then remove or disable the rule. Never generate attack traffic against a shared zone.
Cache tests need two requests and the response header. Send the asset twice with curl -sSI and read cf-cache-status; a HIT on the second request is the proof. An authenticated or cookie-bearing response must not be stored in the shared cache, and the header is the evidence, not the rule text.
The cache key decides what a HIT means. Query strings, cookies and selected headers can all change the key, so the rule must match the request shape you actually test. A HIT on a request that should bypass is a data leak, not a performance win.
Health routing needs a timeline, not a status. Record the change time, the first failed probe, the pool transition, the first secondary response, and the recovery. Compare the balancer view with the pool health view, because one dashboard is an opinion and two are evidence.
A health check is a request with a bill. Every selected region probes every endpoint on the monitor interval, so a short interval multiplies requests across pools and lands in the ALB logs. Choose the smallest region set that can detect the failure you wrote down.
Paid routing is a gate, not a default. Load Balancing is an add-on with its own entitlement and probe volume. Confirm the plan and the budget before the first apply, and write the choice into the scope record.
| Tier | What it proves | Main cost driver | Choose when |
|---|---|---|---|
| ALB only | Target health inside one region | ALB hours and capacity units | The recovery objective is a zone or task failure |
| Single-region balancer | Pool failover and fallback behaviour | LB hostnames, health checks, probes | An approved entitlement exists and one region is enough |
| Two-region balancer | Regional origin isolation | Two ALBs, instances, egress and probes | A regional failure is an explicit requirement |
A single-origin design can still pass the capstone. If entitlement or budget is not approved, prove ALB target health and DNS TTL behaviour and record Cloudflare health routing as deferred. Do not claim a failover path you did not exercise.
Every denied case needs a reason. A 403 produced by the wrong rule passes the status check and fails the design. Record the rule identity and the matched expression, then keep the case in the regression set.
Run the matrix twice: once for behaviour, once for drift. The first run proves the policy; the second, after a no-op plan, proves nothing changed underneath it. A case that passes only on the first run is a timing dependency.
Promote with Protected Plans and Scoped Credentials
Promotion is one record with two identities. The infrastructure plan and the application release travel together. A plan approved against one image digest and applied with another is an unreviewed deployment with a reviewed filename.
| Field | What it records | Why it matters |
|---|---|---|
| Commit and tree | The exact configuration reviewed | A branch that moved invalidates the plan |
| Toolchain | Terraform 1.17.1, cloudflare 5.28.1, hashicorp/aws 6.72.0 | A different producer makes a different plan |
| Module references | Tag or commit for every module | A moved tag changes the graph silently |
| Plan digest | Hash of the saved plan artifact | The applied bytes match the reviewed bytes |
| Image digest | Immutable application release | The code under test is the code promoted |
| Approver and expiry | Named human and a deadline | Approval is for a change, not for a season |
| State keys | One key per root | A shared key erases the boundary |
Pin the producer, not just the product. Terraform 1.17.1, the Cloudflare provider at 5.28.1 and the AWS provider at 6.72.0 belong in version constraints and in the workflow that runs them. The lock file is committed, and the record names the toolchain that produced the plan.
Apply the saved plan, never a fresh one. The apply job downloads the artifact, verifies its digest, and runs terraform apply tfplan against that file. A re-plan after approval is a new change with a new approval, even when the diff looks identical.
Separate plan and apply identities where the backend permits it. The plan identity needs read access and the state lock, while the apply identity needs the write permissions and a short session. If one role must do both, keep the write set to the two roots and expire the session after the job.
Scope the credentials to the root. The edge token needs DNS, zone settings, WAF, cache and load balancing permissions for one zone and account. The AWS role needs load balancing, EC2 security groups and ACM in one region, assumed through OIDC with a short session.
A token that can edit every zone is a finding. It turns a misplaced resource into a cross-customer incident and makes the ownership matrix decorative. Review the token policy in the same pull request as the root it serves.
Order the applies and the destroys. Apply the origin first and the edge second; destroy the edge first and the origin second. The reverse order leaves a pool pointing at a deleted ALB or a DNS record pointing at nothing.
Rollback is an artifact, not a memory. Keep the previous plan and image digest until the new release has passed its observation window. A rollback that requires re-planning under incident pressure is a new change with no review.
Separate application release identity from infrastructure identity. Terraform references an immutable image tag or digest as a variable; the application pipeline builds and signs it. A deploy that changes the image without a Terraform plan is still a production change and needs its own record.
Figure 6 contrasts the promoted path with the two common shortcuts: applying a re-planned artifact and using a credential that is wider than the root.
The evidence flow has four gates. Figure 7 turns them into an order of operations: the plan is produced, approved at the same digest, applied, and verified. A missing gate is not a shortcut; it is an unreviewed change with a green checkmark.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
T["Scoped token and role"] --> P["Protected plan
digest recorded"]
P --> A{"Approved
same digest?"}
A -->|"no"| X1["Stop
stale or re-planned"]
A -->|"yes"| AP["Apply saved plan"]
AP --> V{"Edge and origin
checks pass?"}
V -->|"no"| X2["Roll back
previous artifact"]
V -->|"yes"| R["Promotion record
complete"]
R --> N["No-change plan
both roots"]
X2 --> RC["Recovery review
named owner"]
classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
class T,P primary;
class A,AP,V secondary;
class R,N ok;
class X1,X2 danger;
class RC warn;
A protected plan is only protected if the artifact is protected. Encrypt the bucket, restrict readers, keep it for days, and never attach it to a ticket. Plan files can contain variable values in clear text.
The promotion record is written before the apply and completed after it. Approver and expiry go in before; the observed result and timestamp go in after. A record written from memory is a story, not evidence.
The apply job should reject a stale approval. Check the expiry, the approver, the plan digest and the image digest before the provider is configured. A job that validates after the apply has already lost the argument.
Recover One Controlled Failure and Reconcile Both Roots
Choose one failure that crosses both roots. Replacing the origin certificate with one that has the wrong name produces an edge 526, may trip the health monitor, and requires an origin fix while the edge configuration should not move.
State the hypothesis before the change. Expected: a 526 on a cache miss, a critical pool if Load Balancing is on, no diff in the edge root, and one planned change in the origin root. If the expectation is vague, the test cannot fail.
Write the timeline while it happens. Use one row per event with the time, the observer, the layer and the signal. Memory reconstructs a clean story; the timeline preserves the gap between the change and the first failed probe.
Evidence comes from the layer that decided. The edge log shows the TLS refusal, the pool health view shows the transition, and the origin listener shows the certificate it served. If only one view changed, the failure did not cross the boundary you meant to test.
Recovery is not rollback. Rollback restores the previous certificate; recovery restores service and then proves the intended state. Record which one you performed and why, because a rollback that is never reverted becomes the new design.
| ID | Acceptance criterion | Evidence that closes it |
|---|---|---|
| A1 | Public hostname resolves through the proxy | Resolution from two networks and the proxy setting |
| A2 | Edge certificate is publicly trusted and current | Issuer, SANs and dates from the served chain |
| A3 | Full (strict) and TLS 1.2 or higher are enforced | Setting read-back and a rejected TLS 1.0 handshake |
| A4 | Direct origin access is refused | Handshake or connection result from outside the VPC |
| A5 | Cache serves a HIT and refuses a shared copy | Cache status for C1, C2 and C3 |
| A6 | WAF allows the normal request and denies the canary | Status and rule identity for C4 and C5 |
| A7 | Health routing behaves or is formally deferred | Timeline for H1 to H4, or a deferred decision |
| A8 | Promotion applied the approved artifacts | Plan digest and image digest in the record |
| A9 | Controlled failure recovered and both roots reconcile | 526 cleared without a mode change and two no-change plans |
Reconcile both roots after the fix. A no-change plan in each root, run with the detailed exit code, is the closing evidence. A diff in the edge root usually means the fix crossed the boundary; a diff in the origin root means someone changed it by hand.
Hybrid edge acceptance review
Status: design-only. No Cloudflare or AWS credential was used to produce this capstone, and the steps were not executed here. Versions: Terraform CLI 1.17.1, cloudflare/cloudflare 5.28.1, hashicorp/aws 6.72.0, verified 6 November 2026.
Prerequisites. One zone you can delegate, one AWS account and region, an ALB across two Availability Zones, an application release, a scoped Cloudflare token, a scoped AWS role, and a cost ceiling written into the scope record. Load Balancing is optional and needs an approved entitlement.
Deliverables to attach. D1 scope, D2 ownership matrix, D3 both roots, D4 proof log, D5 promotion record and D6 recovery report. The review is not complete until every row of the acceptance table has an artifact behind it.
| Stage | Action | Pass condition |
|---|---|---|
| Preflight | Plan both roots and save both artifacts | Plans succeed, digests recorded, no unexpected destroys |
| Edge trust | Inspect the served edge chain with the public name | Public issuer, SAN match, dates beyond review |
| Origin trust | Inspect the chain with the name Cloudflare targets | Complete chain, SAN match, unexpired |
| Reachability | Request the public name against the origin address | Refused with AOP on, or a recorded residual risk |
| Cache | Request the static asset twice, then the bypass route | MISS, HIT, then a bypass status |
| WAF | Send the canary header and a normal request | Denied for the canary, served for the normal case |
| Health, if balancing | Fail the health path on the primary | Secondary serves, then primary returns after recovery |
| Failure | Replace the origin certificate with a wrong name | 526 at the edge, no edge-root diff, one origin diff |
| Recovery | Apply the origin root to restore the certificate | 526 clears without a mode change |
| Reconcile | Plan both roots with the detailed exit code | Exit 0 in the edge root and the origin root |
- Record the baseline. Resolve the public hostname, capture the edge and origin chains, send one cached and one uncached request, and save the plan identity for both roots.
- Prove the healthy path. Walk the acceptance table from A1 to A7. Any red row stops the review before the failure injection, because a broken baseline makes the recovery unreadable.
- Prepare the failure. Record the current listener certificate and the declared configuration so the origin root can restore them. Announce the window, the expected signal and the named recovery owner.
- Inject the failure at the origin. Replace the listener certificate in the console with one whose name does not match the target, so the declared configuration now differs from the runtime. Record the change time as
t0. - Observe the edge. On a cache miss, record the 526, the request identifier and the first failed probe. If Load Balancing is on, record the pool transition and the first secondary response.
- Recover. Apply the origin root to restore the declared certificate, wait for the listener to serve it, and record the first successful response as
t4. Do not change the zone mode to shorten the outage. - Reconcile. Run a plan in the origin root and expect no changes, because the console edit is gone. Run a plan in the edge root and expect no changes at all.
- Close the record. Complete D5 and D6 with timestamps, then destroy the edge root before the origin root; inside the edge root, the balancer goes before its pools and origin records. Revoke the token and delete the plan artifacts.
Expected observation. The edge returns 526 while the origin listener is healthy and serving the wrong certificate. The zone mode stays Full (strict), the edge root plans no change, and the origin root shows exactly one planned certificate change before recovery. After the fix, both roots return exit 0 and the public hostname serves again on the next cache miss, without a mode change.
Failure checks. The review fails if the 526 is cleared by switching to Full or Flexible, if the edge root plans a change during the incident, if the direct origin path returns content, if the health transition is claimed without a timestamp, or if either root still shows a diff at the end.
Cost boundary. One ALB, one application release, one zone and a bounded probe volume. Load Balancing adds hostname, health-check and probe charges; a second region doubles the origin footprint. Confirm current pricing and entitlement before the apply, and stop at the ceiling written in D1 rather than at the first surprising invoice.
Cleanup. Delete the edge balancer before its pools, remove origin records before the origin root, and destroy the origin last. Revoke the token and the role session, delete stored plans, remove the canary rule, and confirm the budget alarm and any temporary DNS records are gone.
Evidence to keep. The scope decision, the ownership matrix, both plan digests, the promotion record, the edge and origin chain output, the cache and WAF results, the health timeline, the 526 request identifier, the recovery timestamp, and both final no-change plans. Keep the evidence; discard the credentials.
A governed edge is a set of owned objects with proof at each layer. The project passes when a reviewer can name the owner of every object, see the evidence for every acceptance row, replay the promotion from its digests, and watch one failure recover without the edge and origin roots fighting. That is a stronger result than a green dashboard, and it is the result this capstone asks you to deliver.