# Getting vars using AWS dynamic inventory plugin

**URL:** <https://forum.ansible.com/t/getting-vars-using-aws-dynamic-inventory-plugin/28231>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [August 2, 2018, 4:45am UTC](https://forum.ansible.com/t/getting-vars-using-aws-dynamic-inventory-plugin/28231 "2018-08-02T04:45:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rob\_White](https://avatars.discourse-cdn.com/v4/letter/r/71c47a/32.png) [@Rob\_White](https://forum.ansible.com/u/Rob_White)\
**Post date:** [August 2, 2018, 4:45am UTC](https://forum.ansible.com/t/getting-vars-using-aws-dynamic-inventory-plugin/28231/1 "2018-08-02T04:45:26Z")

</div>

I want to set some static vars alongside my AWS inventory plugin config but I can’t find any doc. Maybe this isn’t supported or maybe my syntax is incorrect.

`

plugin: aws\_ec2  
iam\_role\_arn: arn:aws:iam::1234567890:role/assumed-ansible  
regions:

- ap-southeast-1  
hostnames:
- ip-address  
strict\_permissions: False  
strict: False  
keyed\_groups:
- prefix: tag  
key: tags

all:  
vars:  
aws\_account\_name: myaccount

`

With a simple playbook to just output aws\_account\_name it always fails with…

`  
‘aws\_account\_name’ is undefined

`

I’ve also tried the AWS group name like

`aws_ec2: vars: aws_account_name: myaccount`

but that doesn’t work either
