Thanks Allen, I'll give it a try !
On Wed, May 18, 2016 at 3:32 PM, Allen Sanabria
wrote:
> You can use a Ansible Filter Plugin.
>
> I have a repo with all of my filter plugins. Line 8 has the function you
> need.
>
> def get_account_id(region):
> client =
You can use a Ansible Filter Plugin.
I have a repo with all of my filter plugins. Line 8 has the function you
need.
def get_account_id(region):
client = boto3.client('iam', region_name=region)
try:
account_id = client.list_users()['Users'][0]['Arn'].split(':')[4]
return