Skip to content

Eduard3000/aws-brain-dump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-brain-dump

All about AWS

awswhoami

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)

About

All about AWS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages