{
  "_comment": "AWS统一账单分析和导出工具配置文件",
  
  "settings": {
    "_comment": "全局功能开关",
    "awsBillingCutoverDate": "2025-10-01",
    "awsBillingNoPayerDataset": "gcp-digital-bi.aws_billing_no_payer",
    "awsCur2ProductField": "product_servicecode",
    "awsCur2RegionField": "product_region_code",
    "awsLineItemTypeInclude": [
      "Usage",
      "SavingsPlanCoveredUsage"
    ],
    "awsLineItemTypeExclude": [
      "Tax",
      "Credit",
      "Refund",
      "Fee",
      "RIFee",
      "SavingsPlanNegation"
    ],
    "enableAccountScopedServiceMonitor": false,
    "_comment_account_scoped_service_monitor": "账户级服务监控（不可打标签，生产环境）",
    "accountScopedServiceMonitorEnvironments": ["prod"],
    "accountScopedServiceMonitorMinTotalCost": 5,
    "accountScopedServiceMonitorServices": [
      "AWS Budgets",
      "AWS Config",
      "AWS CloudTrail",
      "AWS Cost Explorer",
      "AWS GuardDuty",
      "AWS Security Hub",
      "AWS Audit Manager",
      "Amazon GuardDuty"
    ],
    "_comment_untagged_tag_monitor": "漏打业务标签监控（tag_usedby/tag_servicetype，出现即告警）",
    "enableUntaggedTagMonitor": false,
    "untaggedTagMonitorEnvironments": ["prod"],
    "_comment_untagged_tag_monitor_accounts": "仅监控指定账户（留空表示监控该环境全部账户）",
    "untaggedTagMonitorAccounts": [],
    "untaggedTagMonitorMinCost": 0,
    "_comment_untagged_tag_monitor_ignored_services": "忽略无法/无需打业务标签的全局服务",
    "untaggedTagMonitorIgnoredServices": [
      "AWS Config",
      "AWS CloudTrail",
      "AWS GuardDuty",
      "AWS Security Hub",
      "AWS Audit Manager",
      "Amazon GuardDuty",
      "Amazon CloudWatch"
    ]
  },
  
  "webhook_urls": {
    "_comment": "飞书webhook通知地址（云级统一通道）",
    "cloud": "https://open.feishu.cn/open-apis/bot/v2/hook/your-aws-webhook-url",
    "_comment_account_scoped_service_monitor": "账户级服务监控专用话题群（可选，未配置则使用 cloud）",
    "accountScopedServiceMonitor": "https://open.feishu.cn/open-apis/bot/v2/hook/your-account-scoped-service-webhook-url",
    "_comment_business_type_summary": "按标签业务类型成本汇总专用话题群（可选，未配置则使用 cloud）",
    "businessTypeSummary": "https://open.feishu.cn/open-apis/bot/v2/hook/your-business-type-webhook-url"
  },
  
  "thresholds": {
    "_comment": "异常检测阈值配置",
    "account_warning": 1.4,
    "account_critical": 1.8,
    "service_warning": 1.8, 
    "service_critical": 2.5,
    "min_cost_threshold": 3.0,
    "new_service_threshold": 10.0,
    "_comment_no_tenant": "No-Tenant资源监控阈值（仅生产环境）",
    "no_tenant_warning": 1.5,
    "no_tenant_critical": 2.0,
    "min_no_tenant_cost_threshold": 10.0,
    "new_no_tenant_threshold": 20.0,
    "total_no_tenant_threshold": 100.0
  },
  
  "export_settings": {
    "_comment": "数据导出相关设置",
    "max_workers": 8,
    "cache_hours": 48,
    "outputDir": "aws_billing_exports",
    "exclude_recent_days": {
      "_comment": "数据延迟处理：排除最近N天的数据",
      "nonprod": 2,
      "prod": 1
    }
  },

  "mysqlConfig": {
    "_comment": "MySQL 同步配置，开启后导出的账单会写入数据库",
    "enabled": false,
    "host": "127.0.0.1",
    "port": 3306,
    "username": "billing_writer",
    "password": "change-me",
    "databaseName": "cloud_billing",
    "defaultCurrency": "USD",
    "poolSize": 5,
    "maxOverflow": 5,
    "useTls": true,
    "caCertificatePath": "/etc/ssl/certs/server-ca.pem",
  },
  
  "account_classification": {
    "_comment": "账户自动分类配置（未来功能预留）",
    "auto_detect_patterns": {
      "_comment": "基于账户名称自动检测环境类型的关键字",
      "prod_keywords": ["prod", "production", "prd"],
      "test_keywords": ["test", "dev", "staging", "nonprod", "stg"]
    },
    "validation": {
      "_comment": "验证和日志设置",
      "strict_mode": true,
      "log_mismatches": true
    }
  },
  
  "ignored_services": {
    "_comment": "分析时需要忽略的AWS服务（非直接资源费用）",
    "_services": [
      "ComputeSavingsPlans",
      "Savings Plans for Compute", 
      "EC2-Instance Savings Plans",
      "SageMaker Savings Plans",
      "AWS Support (Business)",
      "AWS Support (Enterprise)",
      "Tax"
    ]
  },
  
  "_comment_deprecated_prod_accounts": "生产账户与数据集的映射请在 aws_account_details.csv 中维护"
}
