AWS::CLIWrapper - Wrapper module for aws-cli
use AWS::CLIWrapper; my $aws = AWS::CLIWrapper->new( region => 'us-west-1', ); my $res = $aws->ec2('describe-instances', { instance_ids => ['i-XXXXX', 'i-YYYYY'], }); if ($res) { for my $rs ( @{ $res->{reservationSet} }) { for my $is (@{ $rs->{instancesSet} }) { print $is->{instanceId},"\n"; } } } else { warn $AWS::CLIWrapper::Error->{Code}; warn $AWS::CLIWrapper::Error->{Message}; }
AWS::CLIWrapper is wrapper module for aws-cli.
AWS::CLIWrapper is a just wrapper module, so you can do everything what you can do with aws-cli.
Constructor of AWS::CLIWrapper. Acceptable param are:
region region_name:Str profile profile_name:Str endpoint_url endpoint_url:Str
AWS::CLIWrapper provides methods same as services of aws-cli. Please refer to `aws help`.
First arg "operation" is same as operation of aws-cli. Please refer to `aws SERVICE help`.
Second arg "param" is same as command line option of aws-cli. Please refer to `aws SERVICE OPERATION help`.
Key of param is string that trimmed leading "--" and replaced "-" to "_" for command line option (--instance-ids -> instance_ids). Value of param is SCALAR or ARRAYREF or HASHREF.
See documents of aws-cli.
HIROSE Masaaki <hirose31 _at_ gmail.com>
https://github.com/hirose31/AWS-CLIWrapper
git clone git://github.com/hirose31/AWS-CLIWrapper.git
patches and collaborators are welcome.
http://aws.amazon.com/cli/, https://github.com/aws/aws-cli, http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Welcome.html,
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install AWS::CLIWrapper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AWS::CLIWrapper
CPAN shell
perl -MCPAN -e shell install AWS::CLIWrapper
For more information on module installation, please visit the detailed CPAN module installation guide.