Amazon ec2 Ansible-区域us-east-2a似乎不适用于aws模块boto.ec2

Amazon ec2 Ansible-区域us-east-2a似乎不适用于aws模块boto.ec2,amazon-ec2,ansible,amazon,boto,Amazon Ec2,Ansible,Amazon,Boto,我正在尝试使用Ansible创建EC2实例,但它显示以下错误: 美国东部2a区似乎不适用于aws模块boto.ec2。如果该区域确实存在,您可能需要升级boto或使用端点扩展路径。 我不得不说我使用的是Ansible版本2.3.1.0和Boto 2.480 尝试创建安全组后立即显示错误: --- - name: Provision an EC2 Instance hosts: localhost connection: local gather_facts: Fals

我正在尝试使用Ansible创建EC2实例,但它显示以下错误:

美国东部2a区似乎不适用于aws模块boto.ec2。如果该区域确实存在,您可能需要升级boto或使用端点扩展路径。

我不得不说我使用的是Ansible版本2.3.1.0和Boto 2.480

尝试创建安全组后立即显示错误:

---
  - name: Provision an EC2 Instance
    hosts: localhost
    connection: local
    gather_facts: False
    tags: provisioning
    # Necessary Variables for creating/provisioning the EC2 Instance
    vars_files: 
      - variables.yml
      - aws_auth.yml
    # Task that will be used to Launch/Create an EC2 Instance
    tasks:
      -   name: Create security group
              ec2_group:
              name: "{{ project_name }}_security_group"
              description: "{{ project_name }} security group"
              region: "{{ aws_region }}"
          rules:
              - proto: tcp
                type: ssh
                from_port: 22
                to_port: 22
                cidr_ip: 0.0.0.0/0
              - proto: tcp
                type: http
                from_port: 80
                to_port: 80
                cidr_ip: 0.0.0.0/0
              - proto: tcp
                type: https
                from_port: 443
                to_port: 443
                cidr_ip: 0.0.0.0/0
          rules_egress:
              - proto: all
                type: all
                cidr_ip: 0.0.0.0/0
      register: basic_firewall
正确导出访问密钥和密钥。我可以运行/etc/ansible/ec2.py——列出并显示所有预期数据


谢谢。

us-east-2a
不是一个地区,而是一个可用区。该地区称为
us-east-2


我在使用ansible(2.9.6)和模块时发现了这个问题:

问题是我正在配置一个Ubuntu 16.04实例和
python boto
包。可用的boto库很旧,因此它没有所需的区域,我可以使用python确认:

>>> import boto.ec2
>>> for i in boto.ec2.regions():
...   print(i)
...
RegionInfo:us-east-1
RegionInfo:cn-north-1
RegionInfo:ap-northeast-1
RegionInfo:eu-west-1
RegionInfo:ap-southeast-1
RegionInfo:ap-southeast-2
RegionInfo:us-west-2
RegionInfo:us-gov-west-1
RegionInfo:us-west-1
RegionInfo:eu-central-1
RegionInfo:sa-east-1
我安装了库的更新版本以修复此问题:

pip install boto --upgrade
以下是升级库的结果:

>>> import boto.ec2
>>> for i in boto.ec2.regions():
...   print(i)
...
RegionInfo:us-west-1
RegionInfo:us-east-1
RegionInfo:ap-northeast-1
RegionInfo:ap-southeast-2
RegionInfo:sa-east-1
RegionInfo:ap-northeast-2
RegionInfo:us-east-2
RegionInfo:ap-southeast-1
RegionInfo:ca-central-1
RegionInfo:cn-north-1
RegionInfo:us-west-2
RegionInfo:us-gov-west-1
RegionInfo:ap-south-1
RegionInfo:eu-central-1
RegionInfo:eu-west-1
RegionInfo:eu-west-2

嗨,迈克尔。是的,你是对的。它与我们合作——东方2号。现在我有一个权限问题…:D.我无法创建安全组。但我会看看我能做些什么。需要吸收大量的文档,我必须在几天内完成这项工作。非常感谢。
>>> import boto.ec2
>>> for i in boto.ec2.regions():
...   print(i)
...
RegionInfo:us-west-1
RegionInfo:us-east-1
RegionInfo:ap-northeast-1
RegionInfo:ap-southeast-2
RegionInfo:sa-east-1
RegionInfo:ap-northeast-2
RegionInfo:us-east-2
RegionInfo:ap-southeast-1
RegionInfo:ca-central-1
RegionInfo:cn-north-1
RegionInfo:us-west-2
RegionInfo:us-gov-west-1
RegionInfo:ap-south-1
RegionInfo:eu-central-1
RegionInfo:eu-west-1
RegionInfo:eu-west-2