-
Notifications
You must be signed in to change notification settings - Fork 64
How to use it?
For now, all inventories are executed, so this script may be a little long. By default, all known services are inventoried. You just have to type :
$ python ./inventory
There are a couple of useful arguments to know.
First, you may call this script only for desired services. For instance :
$ python ./inventory --services efs ecs acm
It will reduce the time of processing, of course.
A log file is created and updated during execution. You may choose the level of logging by using one of these keywords, added anywhere in the command line :
- debug
- info
- warning
- error
The default level is warning (when you don't use any log level in command line).
$ python ./inventory --log debug
will log all possibles messages.
$ python ./inventory --services ec2 acm --log error
will only log errors trapped by the script.
Don't forget to execute the script with appropriate IAM rights, that means your user has all the rights described in the policy files. You can attach directly the policies to the user, or to a group bound to the user, or to a role.
If you have multiple profiles in your AWS CLI configuration file (in [HOME]\.aws\credentials
), you can choose which one to use. By default, it's... default. The script will stop in case of non-existent profile.
$ python ./py inventory.py --profile toto --services ec2 s3 efs
If you want to execute this script within multiple AWS accounts, you should use AWS roles.
To come. Or not.