2017 © Pedro Peláez
 

library aws-commands

image

michalvlcek/aws-commands

  • Thursday, March 31, 2016
  • by michalvlcek
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Useful (symfony) commands for working with AWS., (*1)

# installation

  • composer install
  • create .env file from example (cp .env.example .env) and setup credentials:
    • if you already have AWS credentials file ~/.aws/credentials you can copy access keys from there
    • if you don't you can create new access keys at http://aws.amazon.com/developers/access-keys/

# usage

  • php app.php - for list of all commands
  • php app.php name:of:command [[option] --argument]

# commands

name description
demo:greet Example command.
ec2:hosts-info Creating "/etc/hosts" records from all EC2 instances (name and IP).
iam:assumed-roles Lists assumed roles from group policies.

ec2:hosts-info

Command which allows to grab information from all EC2 instances (across all regions and sub-accounts) in "hosts" style format. Default call (with no argument) prints output to stdOut. If you set file argument output is appended to specified file., (*2)

php app.php ec2:hosts-info # dump to std output

```sh php app.php ec2:hosts-info --file=/etc/hosts # dump to file, (*3)


results in:

12.12.123.123 SomeName # i-c12ab06c 12.12.12.1 AnotherName # i-05fce0883ca1d7f12, (*4)


---- #### `iam:assumed-roles` Command attempts to extract all possible assumed roles. It is done by querying user associated groups and their policyes. Command which allows to grab informations from all EC2 instances (across all regions) in "hosts" style format. Default call (with no argument) prints output to stdOut. If you set `file` argument output is appended to specified file. ```sh php app.php iam:assumed-roles

results in:, (*5)

array:2 [
  0 => array:2 [
    "account" => "012345678901"
    "role" => "roleName"
  ],
  1 => array:2 [
    "account" => "112345678901"
    "role" => "anotherRoleName"
  ]
]

The Versions

31/03 2016
28/03 2016