Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Comprehensive Cloudflare platform skill covering Workers, D1, R2, KV, AI, Durable Objects, and security.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/argo-smart-routing/configuration.md
1## Configuration Management23**Note on Smart Shield Evolution:** Argo Smart Routing is being integrated into Smart Shield. Configuration methods below remain valid; Terraform and IaC patterns unchanged.45### Infrastructure as Code (Terraform)67```hcl8# terraform/argo.tf9# Note: Use Cloudflare Terraform provider1011resource "cloudflare_argo" "example" {12zone_id = var.zone_id13smart_routing = "on"14tiered_caching = "on"15}1617variable "zone_id" {18description = "Cloudflare Zone ID"19type = string20}2122output "argo_enabled" {23value = cloudflare_argo.example.smart_routing24description = "Argo Smart Routing status"25}26```2728### Environment-Based Configuration2930```typescript31// config/argo.ts32interface ArgoEnvironmentConfig {33enabled: boolean;34tieredCache: boolean;35monitoring: {36usageAlerts: boolean;37threshold: number;38};39}4041const configs: Record<string, ArgoEnvironmentConfig> = {42production: {43enabled: true,44tieredCache: true,45monitoring: {46usageAlerts: true,47threshold: 1000, // GB48},49},50staging: {51enabled: true,52tieredCache: false,53monitoring: {54usageAlerts: false,55threshold: 100, // GB56},57},58development: {59enabled: false,60tieredCache: false,61monitoring: {62usageAlerts: false,63threshold: 0,64},65},66};6768export function getArgoConfig(env: string): ArgoEnvironmentConfig {69return configs[env] || configs.development;70}71```7273### Pulumi Configuration7475```typescript76// pulumi/argo.ts77import * as cloudflare from '@pulumi/cloudflare';7879const zone = new cloudflare.Zone('example-zone', {80zone: 'example.com',81plan: 'enterprise',82});8384const argoSettings = new cloudflare.Argo('argo-config', {85zoneId: zone.id,86smartRouting: 'on',87tieredCaching: 'on',88});8990export const argoEnabled = argoSettings.smartRouting;91export const zoneId = zone.id;92```9394## Billing Configuration9596Before enabling Argo Smart Routing, ensure billing is configured for the account:9798**Prerequisites:**991. Valid payment method on file1002. Enterprise or higher plan1013. Zone must have billing enabled102103**Check Billing Status via Dashboard:**1041. Navigate to Account → Billing1052. Verify payment method configured1063. Check zone subscription status107108**Note:** Attempting to enable Argo without billing configured will result in `editable: false` in API responses.109110## Environment Variable Setup111112**Required Environment Variables:**113```bash114# .env115CLOUDFLARE_API_TOKEN=your_api_token_here116CLOUDFLARE_ZONE_ID=your_zone_id_here117CLOUDFLARE_ACCOUNT_ID=your_account_id_here118119# Optional120ARGO_ENABLED=true121ARGO_TIERED_CACHE=true122```123124**TypeScript Configuration Loader:**125```typescript126// config/env.ts127import { z } from 'zod';128129const envSchema = z.object({130CLOUDFLARE_API_TOKEN: z.string().min(1),131CLOUDFLARE_ZONE_ID: z.string().min(1),132CLOUDFLARE_ACCOUNT_ID: z.string().min(1),133ARGO_ENABLED: z.string().optional().default('false'),134ARGO_TIERED_CACHE: z.string().optional().default('false'),135});136137export const env = envSchema.parse(process.env);138139export const argoConfig = {140enabled: env.ARGO_ENABLED === 'true',141tieredCache: env.ARGO_TIERED_CACHE === 'true',142};143```144145## CI/CD Integration146147**GitHub Actions Example:**148```yaml149# .github/workflows/deploy-argo.yml150name: Deploy Argo Configuration151152on:153push:154branches: [main]155paths:156- 'terraform/argo.tf'157158jobs:159deploy:160runs-on: ubuntu-latest161steps:162- uses: actions/checkout@v3163164- name: Setup Terraform165uses: hashicorp/setup-terraform@v2166167- name: Terraform Init168run: terraform init169working-directory: ./terraform170171- name: Terraform Apply172run: terraform apply -auto-approve173working-directory: ./terraform174env:175CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}176TF_VAR_zone_id: ${{ secrets.CLOUDFLARE_ZONE_ID }}177```178179## Enterprise Preview Program180181For early access to Argo Smart Routing features and Smart Shield integration:182183**Eligibility:**184- Enterprise plan customers185- Active Cloudflare support contract186- Production traffic >100GB/month187188**How to Join:**1891. Contact Cloudflare account team or support1902. Request Argo/Smart Shield preview access1913. Receive preview zone configuration192193**Preview Features:**194- Enhanced analytics and reporting195- Smart Shield DDoS integration196- Advanced routing policies197- Priority support for routing issues