calc/backend/app/core/config.py

145 lines
6.1 KiB
Python
Raw Normal View History

2025-04-02 16:57:05 +08:00
import os
from dotenv import load_dotenv
# 加载环境变量
load_dotenv()
# AWS EBS定价(GP3)
AWS_PRICING_EBS = {
"us-east-1": 0.08,
"us-east-2": 0.08,
"us-west-1": 0.096,
"us-west-2": 0.08,
"af-south-1": 0.1047,
"ap-east-1": 0.1056,
"ap-south-1": 0.0912,
"ap-northeast-3": 0.096,
"ap-northeast-2": 0.0912,
"ap-southeast-1": 0.096,
"ap-southeast-2": 0.096,
"ap-northeast-1": 0.096,
"ca-central-1": 0.088,
"eu-central-1": 0.0952,
"eu-west-1": 0.088,
"eu-west-2": 0.0928,
"eu-west-3": 0.0928,
"eu-north-1": 0.0836,
"me-central-1": 0.0968,
"sa-east-1": 0.152,
}
# 区域中文名称映射
AWS_REGION_NAMES = {
"af-south-1": "非洲 (开普敦)",
2025-04-02 16:57:05 +08:00
"ap-northeast-1": "亚太地区 (东京)",
"ap-northeast-2": "亚太地区 (首尔)",
"ap-northeast-3": "亚太地区 (大阪)",
"ap-east-1": "亚太地区 (香港)",
"ap-south-1": "亚太地区 (孟买)",
"ap-south-2": "亚太地区 (海得拉巴)",
2025-04-02 16:57:05 +08:00
"ap-southeast-1": "亚太地区 (新加坡)",
"ap-southeast-2": "亚太地区 (悉尼)",
"ap-southeast-3": "亚太地区 (雅加达)",
"ap-southeast-4": "亚太地区 (墨尔本)",
"ap-southeast-5": "亚太地区 (马来西亚)",
"ap-southeast-7": "亚太地区 (泰国)",
2025-04-02 16:57:05 +08:00
"ca-central-1": "加拿大 (中部)",
"ca-west-1": "加拿大西部 (卡尔加里)",
2025-04-02 16:57:05 +08:00
"eu-central-1": "欧洲 (法兰克福)",
"eu-central-2": "欧洲 (苏黎世)",
"eu-north-1": "欧洲 (斯德哥尔摩)",
"eu-south-1": "欧洲 (米兰)",
"eu-south-2": "欧洲 (西班牙)",
2025-04-02 16:57:05 +08:00
"eu-west-1": "欧洲 (爱尔兰)",
"eu-west-2": "欧洲 (伦敦)",
"eu-west-3": "欧洲 (巴黎)",
"il-central-1": "以色列 (特拉维夫)",
2025-04-02 16:57:05 +08:00
"me-central-1": "中东 (阿联酋)",
"me-south-1": "中东 (巴林)",
"mx-central-1": "墨西哥 (中部)",
"sa-east-1": "南美洲 (圣保罗)",
"us-east-1": "美国东部 (弗吉尼亚北部)",
"us-east-2": "美国东部 (俄亥俄)",
"us-east-2-mci-1": "美国东部 (堪萨斯城)",
"us-gov-east-1": "AWS GovCloud (美国东部)",
"us-gov-west-1": "AWS GovCloud (美国西部)",
"us-west-1": "美国西部 (加利福尼亚北部)",
"us-west-2": "美国西部 (俄勒冈)",
"ap-northeast-1-tpe-1": "亚太地区 (台湾)",
"ap-northeast-1-wl1-kix1": "亚太地区 (KDDI) - 大阪",
"ap-northeast-1-wl1-nrt1": "亚太地区 (KDDI) - 东京",
"ap-northeast-2-wl1-cjj1": "亚太地区 (SKT) - 大田",
"ap-northeast-2-wl1-sel1": "亚太地区 (SKT) - 首尔",
"ca-central-1-wl1-yto1": "加拿大 (BELL) - 多伦多",
"eu-central-1-wl1-ber1": "欧洲 (沃达丰) - 柏林",
"eu-central-1-wl1-dtm1": "欧洲 (沃达丰) - 多特蒙德",
"eu-central-1-wl1-muc1": "欧洲 (沃达丰) - 慕尼黑",
"eu-west-2-wl1-lon1": "欧洲 (沃达丰) - 伦敦",
"eu-west-2-wl1-man1": "欧洲 (沃达丰) - 曼彻斯特",
"eu-west-2-wl2-man1": "欧洲 (英国电信) - 曼彻斯特",
"eu-west-3-wl1-cmn1": "摩洛哥 (卡萨布兰卡)",
"us-east-1-wl1": "美国东部 (Verizon) - 波士顿",
"us-east-1-wl1-atl1": "美国东部 (Verizon) - 亚特兰大",
"us-east-1-wl1-bna1": "美国东部 (Verizon) - 纳什维尔",
"us-east-1-wl1-chi1": "美国东部 (Verizon) - 芝加哥",
"us-east-1-wl1-clt1": "美国东部 (Verizon) - 夏洛特",
"us-east-1-wl1-dfw1": "美国东部 (Verizon) - 达拉斯",
"us-east-1-wl1-dtw1": "美国东部 (Verizon) - 底特律",
"us-east-1-wl1-iah1": "美国东部 (Verizon) - 休斯顿",
"us-east-1-wl1-mia1": "美国东部 (Verizon) - 迈阿密",
"us-east-1-wl1-msp1": "美国东部 (Verizon) - 明尼阿波利斯",
"us-east-1-wl1-nyc1": "美国东部 (Verizon) - 纽约",
"us-east-1-wl1-tpa1": "美国东部 (Verizon) - 坦帕",
"us-east-1-wl1-was1": "美国东部 (Verizon) - 华盛顿特区",
"us-west-2-wl1": "美国西部 (Verizon) - 旧金山湾区",
"us-west-2-wl1-den1": "美国西部 (Verizon) - 丹佛",
"us-west-2-wl1-las1": "美国西部 (Verizon) - 拉斯维加斯",
"us-west-2-wl1-lax1": "美国西部 (Verizon) - 洛杉矶",
"us-west-2-wl1-phx1": "美国西部 (Verizon) - 凤凰城",
"us-west-2-wl1-sea1": "美国西部 (Verizon) - 西雅图",
"af-south-1-los-1": "尼日利亚 (拉各斯)",
"ap-south-1-ccu-1": "印度 (加尔各答)",
"ap-south-1-del-1": "印度 (德里)",
"ap-southeast-1-bkk-1": "泰国 (曼谷)",
"ap-southeast-1-mnl-1": "菲律宾 (马尼拉)",
"ap-southeast-2-akl-1": "新西兰 (奥克兰)",
"ap-southeast-2-per-1": "澳大利亚 (珀斯)",
"eu-central-1-ham-1": "德国 (汉堡)",
"eu-central-1-waw-1": "波兰 (华沙)",
"eu-north-1-cph-1": "丹麦 (哥本哈根)",
"eu-north-1-hel-1": "芬兰 (赫尔辛基)",
"me-south-1-mct-1": "阿曼 (马斯喀特)",
"us-east-1-atl-1": "美国东部 (亚特兰大)",
"us-east-1-bos-1": "美国东部 (波士顿)",
"us-east-1-bue-1": "阿根廷 (布宜诺斯艾利斯)",
"us-east-1-chi-1": "美国东部 (芝加哥)",
"us-east-1-dfw-1": "美国东部 (达拉斯)",
"us-east-1-iah-1": "美国东部 (休斯顿)",
"us-east-1-lim-1": "秘鲁 (利马)",
"us-east-1-mci-1": "美国东部 (堪萨斯城 2)",
"us-east-1-mia-1": "美国东部 (迈阿密)",
"us-east-1-msp-1": "美国东部 (明尼阿波利斯)",
"us-east-1-nyc-1": "美国东部 (纽约市)",
"us-east-1-phl-1": "美国东部 (费城)",
"us-east-1-qro-1": "墨西哥 (克雷塔罗)",
"us-east-1-scl-1": "智利 (圣地亚哥)",
"us-west-2-den-1": "美国西部 (丹佛)",
"us-west-2-hnl-1": "美国西部 (火奴鲁鲁)",
"us-west-2-las-1": "美国西部 (拉斯维加斯)",
"us-west-2-lax-1": "美国西部 (洛杉矶)",
"us-west-2-pdx-1": "美国西部 (波特兰)",
"us-west-2-phx-1": "美国西部 (凤凰城)",
"us-west-2-sea-1": "美国西部 (西雅图)"
2025-04-02 16:57:05 +08:00
}
# 可以添加其他云平台的配置
AZURE_REGION_NAMES = {
# 待添加Azure区域
}
ALIYUN_REGION_NAMES = {
# 待添加阿里云区域
}
# 支持的平台列表
SUPPORTED_PLATFORMS = ["aws", "azure", "aliyun"]