如何解决区域 eu-west-2 不适用于 aws 模块 boto.ec2 最新版
我正在使用 python3 运行 boto 并且我正在运行 ansible playbook 来设置一些 ec2 实例。
一切正常,创建实例、安全组、密钥对以及 eu-west-2
中的所有内容。
当弹性 IP 的任务运行时,它会失败并显示以下消息:
Region eu-west-2 does not seem to be available for aws module boto.ec2. If the region definitely exists,you may need to upgrade boto or extend with endpoints_path
我使用 -e ansible_python_interpreter="/usr/bin/python3"
运行 ansible。
我安装了最新的 boto。
> python3 -m pip freeze | grep boto
boto==2.44.0
boto3==1.4.2
botocore==1.16.19
> python3
>>> import boto.ec2
>>> for i in boto.ec2.regions():
... print(i)
...
RegionInfo:ap-northeast-1
RegionInfo:ap-northeast-2
RegionInfo:ap-south-1
RegionInfo:ap-southeast-1
RegionInfo:ap-southeast-2
RegionInfo:ca-central-1
RegionInfo:cn-north-1
RegionInfo:eu-central-1
RegionInfo:eu-west-1
RegionInfo:sa-east-1
RegionInfo:us-east-1
RegionInfo:us-east-2
RegionInfo:us-gov-west-1
RegionInfo:us-west-1
RegionInfo:us-west-2
您看到它缺少 eu-west-2
区域吗?它应该在那里。有什么想法吗?
我使用的 ansible 模块是 ec2_eip。如果这是 boto 的限制,我如何为该模块强制使用 boto3?
解决方法
我求助于使用社区模块来获取弹性 ip。
所以 community.aws.ec2_eip
而不是 ec2_eip
。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。