Installing the AWS Python SDK
In this recipe, we’ll cover the steps to install the necessary Python libraries for Ansible to interact with AWS. Installing these libraries (botocore and boto3) on the same Python environment Ansible uses is essential because they abstract the interaction with AWS’ API. These packages must be installed on the Ansible Python environment, as all Ansible AWS modules depend on one of these libraries to function.
By following these steps, you will make sure that your Ansible execution environment is ready to use:
- Check that the
amazon.awsAnsible collection is installed:root@cookbook-lab:~/cookbook-lab# ansible-galaxy collection list amazon.aws # /usr/local/lib/python3.10/dist-packages/ansible_collections Collection Version ---------- ------- amazon.aws 8.2.1 - We can verify that the Ansible AWS module needs the
botocoreandboto3Python packages to run:root@cookbook-lab:~/cookbook-lab#...