管理aws route53中超过100条加权记录的python包。
route53weightedrecords的Python项目详细描述
路线53加权记录
python包,用于在aws route53中的一个url下管理超过100条加权记录。
此软件包解决的问题
如果要将请求分发到单个端点后面的100多个端点 在route53中,您必须管理一个类似树的记录结构,因为 Route53只支持单个记录最多100个备选响应。
http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/TutorialManagingOver100WRR.html
这个库为您的url提供了一个简单的创建/删除接口,并管理 幕后的树结构。
用法
配置aws凭据
首先确保boto有正确的访问权限来修改route53记录。 许可可以通过以下任何方式进行配置: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
代码示例
from route53weightedrecords import Route53Manager
# Create the manager (replace the hosted zone id and url with your own)
manager = Route53Manager("my-hosted-zone-id", "my-cool-url.com.")
# Create the record sets
manager.create_record_sets(["192.168.1.1", "192.168.1.2", "192.168.1.3"])
# The DNS entries should now show up in your Route53 console the proper weights!
# Delete the record sets
manager.delete_record_sets(["192.168.1.1", "192.168.1.2", "192.168.1.3"])
注意事项
此包为所有响应分配相同的权重,因此对URL的请求将 在你添加的IP之间保持平衡。无法配置特定 此时的回应。
此包仅支持给定url的10000条weigted记录,而不支持完整的 AWS允许的1000000条记录。
Route53的速率限制为每秒5个请求,因此请确保遵守该限制。
未来工作
- 一个URL最多支持1000000个响应。
- 为URL插入响应时支持权重。