Cloud Collections & Authentication
Connect Ansible to AWS and Azure.
Cloud Collections & Authentication is a free Ansible Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Ansible Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Ansible Speaks to the Cloud
Ansible can do more than configure servers. It can provision them too, creating real cloud resources by talking to AWS and Azure APIs. ☁️
Cloud Modules Live in Collections
Cloud functionality is not built in. It ships in collections you install separately, keeping the core install small and the modules up to date.
The amazon.aws Collection
AWS modules live in the amazon.aws collection. You install it from Ansible Galaxy with a single galaxy command.
ansible-galaxy collection install amazon.awsThe azure.azcollection Collection
Azure support comes from azure.azcollection. Install it the same way you install any other collection from Galaxy.
ansible-galaxy collection install azure.azcollectionCollections Need Python SDKs
Cloud modules call provider SDKs under the hood. For AWS you must also install boto3, the Python library Ansible uses to reach the API.
pip install boto3 botocoreAWS Authentication: Credentials
AWS needs an access key and secret key. Ansible reads them from the standard environment variables so secrets never sit in your playbook.
export AWS_ACCESS_KEY_ID=AKIA...
export AWS_SECRET_ACCESS_KEY=wJalr...AWS Config Files Work Too
If you already use the AWS CLI, Ansible reuses your ~/.aws/credentials profile automatically. No extra setup needed.
Pick a Region
Every AWS resource lives in a region. Set it with AWS_REGION or pass region as a module argument in each task.
export AWS_REGION=us-east-1Azure Authentication: Service Principal
Azure usually authenticates with a service principal: a client ID, secret, subscription and tenant exported as environment variables.
export AZURE_CLIENT_ID=...
export AZURE_SECRET=...
export AZURE_SUBSCRIPTION_ID=...Keep Secrets Out of Git
Never commit cloud keys. Pull them from environment variables or Ansible Vault so credentials stay out of version control.
Verify the Collection Is Installed
List what you have installed with ansible-galaxy collection list to confirm amazon.aws or azure.azcollection is ready to use.
ansible-galaxy collection listQuick Check
Where do AWS and Azure provisioning modules come from?
Recap
You set up cloud provisioning: install the amazon.aws or azure.azcollection collection, add the SDKs, and authenticate via environment variables. ✨
Frequently asked questions
Is the “Cloud Collections & Authentication” lesson free?
Yes — the full text of “Cloud Collections & Authentication” is free to read here on the web, and the Ansible Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Ansible Academy course, upgrade to CoddyKit PRO.
What will I learn in “Cloud Collections & Authentication”?
Connect Ansible to AWS and Azure. You practise Ansible Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Ansible Academy?
No prior experience is required. Ansible Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Cloud Collections & Authentication” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Ansible Academy lesson?
Yes. Every Ansible Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Cloud Collections & Authentication
- Launch EC2 Instances Declaratively
- Networking: VPCs, Subnets & Security Groups
- Provision Then Configure in One Flow