Skip to content

Instantly share code, notes, and snippets.

@markuman
Created March 27, 2020 09:29
Show Gist options
  • Save markuman/6d1fd6555135a465ef9c9164bf4e3ec9 to your computer and use it in GitHub Desktop.
Save markuman/6d1fd6555135a465ef9c9164bf4e3ec9 to your computer and use it in GitHub Desktop.
---
- hosts: localhost
connection: local
gather_facts: False
collections:
- community.aws
- amazon.aws
vars:
PROFILE: "{{ lookup('env', 'AWS_PROFILE' )}}"
module_defaults:
group/aws:
aws_access_key: "{{ lookup('ini', 'aws_access_key_id section=' + PROFILE + ' file=~/.aws/credentials') }}"
aws_secret_key: "{{ lookup('ini', 'aws_secret_access_key section=' + PROFILE + ' file=~/.aws/credentials') }}"
security_token: "{{ lookup('ini', 'aws_session_token section=' + PROFILE + ' file=~/.aws/credentials') }}"
region: eu-central-1
tasks:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment