All about AWS
- 1st aws cli + jq (https://github.com/stedolan/jq): put into .bashrc
alias awswhoami='aws iam list-account-aliases | jq -r '\''.AccountAliases[0]'\'''
then source and
awswhoami
will print your current default account alias
- 2nd perl
#!/usr/bin/perl
use Paws;
my $iam = Paws->service('IAM');
my $alias = $iam->ListAccountAliases;
print $alias->AccountAliases->[0],"\n";
- 3rd php
<?php
require '/home/fusers/php/aws/vendor/autoload.php';
use Aws\Iam\IamClient;
$aws = IamClient::factory(array(
'version' => '2010-05-08',
'profile' => 'default',
'region' => 'eu-central-1'
));
$result = $aws->listAccountAliases([]);
echo $result['AccountAliases'][0];
echo "\n";
?>
- 4th powershell, its simple, but first start is a bit slooow...
Get-IAMAccountAlias
for more awswhoami
- Get initial windows Administator pw with private key, aws cli, jq and openssl
aws ec2 get-password-data --instance-id $1 | jq -c -r '.PasswordData' | xargs echo -n | base64 -d -i | openssl rsautl -decrypt -inkey ./your_private_key.pem | xargs echo
BASH and for perl version see this
aws list all policies and their actions, incl. dump from "today"(sic)