# AWS CloudFront CDN Configuration
# This file contains example configuration for AWS CloudFront CDN integration

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: cloudfront-config
  namespace: veza-production
data:
  # CloudFront Distribution ID
  distribution-id: "your-cloudfront-distribution-id"
  
  # CloudFront Domain
  cloudfront-domain: "d1234567890.cloudfront.net"
  
  # Origin settings
  origin-domain: "app.veza.com"
  origin-protocol: "https"
  
  # Cache behaviors
  cache-behaviors: |
    # Default cache behavior
    PathPattern: "*"
    ViewerProtocolPolicy: redirect-to-https
    AllowedMethods: GET, HEAD, OPTIONS
    CachedMethods: GET, HEAD
    CachePolicyId: CachingOptimized
    
    # Static assets - long cache
    PathPattern: "/static/*"
    ViewerProtocolPolicy: redirect-to-https
    AllowedMethods: GET, HEAD, OPTIONS
    CachedMethods: GET, HEAD
    CachePolicyId: CachingOptimized
    MinTTL: 31536000  # 1 year
    
    # Audio files - medium cache
    PathPattern: "/audio/*"
    ViewerProtocolPolicy: redirect-to-https
    AllowedMethods: GET, HEAD, OPTIONS
    CachedMethods: GET, HEAD
    CachePolicyId: CachingOptimized
    MinTTL: 2592000  # 30 days
    
    # API - no cache
    PathPattern: "/api/*"
    ViewerProtocolPolicy: https-only
    AllowedMethods: GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE
    CachedMethods: GET, HEAD
    CachePolicyId: CachingDisabled

---
# Note: AWS credentials should be stored in a secret
# kubectl create secret generic aws-secrets \
#   --from-literal=access-key-id=your-access-key \
#   --from-literal=secret-access-key=your-secret-key \
#   -n veza-production

