## Deliver public assets through CDN for Quarkus

### Summary
Cdn assets for a Quarkus app on Ample. Verified on Quarkus: a versioned, immutable-cached asset uploaded to a published bucket and served from the CDN URL. Build and start: `./mvnw -q -DskipTests package` producing one uber-jar (quarkus.package.jar.type=uber-jar), then `java -jar` on the jvm-21 template (Temurin JDK 21) with `quarkus.http.port` read from PORT.

### Representative Queries
- Deliver public assets through CDN for Quarkus
- Where can I host Deliver public assets through CDN built with Quarkus?
- I need a public-origin configuration, versioned asset build and observable cache behavior.

### Prerequisites
- A Quarkus project (./mvnw -q -DskipTests package producing one uber-jar (quarkus.package.jar.type=uber-jar), then java -jar on the jvm-21 template (Temurin JDK 21) with quarkus.http.port read from PORT)
- A bucket from `ample bucket create` with credentials passed as encrypted S3_* environment variables
- An Ample account token with servers:write, buckets:read

### Workflow Steps
1. **Build and start**  
   `./mvnw -q -DskipTests package producing one uber-jar (quarkus.package.jar.type=uber-jar), then java -jar on the jvm-21 template (Temurin JDK 21) with quarkus.http.port read from PORT; the server must bind 0.0.0.0 on PORT.`

2. **Publish a bucket for public assets**  
   Publish only the asset bucket; upload versioned keys with an immutable Cache-Control header and build URLs from its public URL.  
   Command: `ample bucket publish`

3. **Verify**  
   Fetch the live URL and /p/versioned-static-assets on the example; on failure read the build and runtime logs.  
   Command: `ample logs --kind build`

### Limitations
- Verified on the jvm-21 template at s-1vcpu-2gb; other sizes and Quarkus major versions are not verified.
- Region, compliance attestations and request-duration limits are unknown and not claimed.
- The CDN serves published-bucket objects only; cache rules, purge and TTL control are not verified.

### Success Checks
- App responds on its public URL  
  Kind: `http_get`  
  Path: `/`  
  Expect: `ample canary quarkus patterns`

- Versioned-static-assets check from the example  
  Kind: `http_get`  
  Path: `/p/versioned-static-assets`  
  Expect: `see the pattern fixture checks`

### Cost Estimate
- Currency: **USD**  
- Monthly Amount: **5.0**  
- Basis: Size prices from pricing.toml (loaded by the API) at build revision 1ac5595375130d45290090e82ed0f554ccd45405-dirty  
- Components:
  - App Server  
    - Size: **s-1vcpu-1gb**  
    - Quantity: **1.0**  
    - Monthly Amount: **5.0**  
- Note: Always-on monthly price of the tested sizes; apps auto-pause when idle. Buckets are allocation-priced per quota and not included.

### Evidence Summary
- Kind: **canary_run**  
  Summary: *Quarkus pattern fixture deployed on Ample (./mvnw -q -DskipTests package producing one uber-jar (quarkus.package.jar.type=uber-jar), then java -jar on the jvm-21 template (Temurin JDK 21) with quarkus.http.port read from PORT); for this guide: a versioned, immutable-cached asset uploaded to a published bucket and served from the CDN URL.*  
  Observed At: **2026-09-21T00:35:31Z**  
  Implementation Revision: **c6c81daa9272c95c5ce381005ba7347a341e578f-dirty (CLI 0.1.21)**  
  Expires At: **2027-03-20T00:35:31Z**  
  Scope:
  - Checks: `/p/versioned-static-assets`  
  - Template: `jvm-21`

### Next Actions
- **Browse the catalog index**  
  Action ID: `browse-catalog`
- **Search published recipes by intent, stack and constraints**  
  Action ID: `search-recipes`
- **Prepare a side-effect-free deployment plan for an authorized project**  
  Action ID: `plan:page:guides:quarkus:cdn-assets`  
- **Read the existing agent authentication setup**  
  Action ID: `auth-setup`  
- **Browse Quarkus**  
  Action ID: `browse:stack:framework-quarkus` 
- **Browse Add CDN**  
  Action ID: `browse:intent:add-cdn`  
- **Browse Versioned static assets**  
  Action ID: `browse:pattern:versioned-static-assets`

### Tested Configuration
- **Template**: `jvm-21`  
- **Runtime**: `java`  
- **Size**: `s-1vcpu-2gb`  
- **Build**: `./mvnw -q -DskipTests package`  
- **Start**: `java -jar $(ls target/*.jar | grep -v -- '-plain' | head -n 1)`
