amazon-ec2ansiblebotoelastic-ip

Region eu-west-2 not available for aws module boto.ec2 latest


I'm running boto with python3 and I'm running an ansible playbook to setup some ec2 instances. Everything is fine, creating instances, security groups, key pairs, everything in eu-west-2. When the task for Elastic IPs runs it fails with this message: 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

I'm running ansible with -e ansible_python_interpreter="/usr/bin/python3". I have latest boto installed.

> 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

You see that it's missing the eu-west-2 region ? It should be there. Any ideas ?

The ansible module I'm using is ec2_eip. If this is a limitation of boto how do I force boto3 for that module ?


Solution

  • I resorted to using the community module for elastic ip. So community.aws.ec2_eip instead of ec2_eip.