NAME
AWS::CLIWrapper - Wrapper module for aws-cli
SYNOPSIS
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->{Reservations} }) {
for my $is (@{ $rs->{Instances} }) {
print $is->{InstanceId},"\n";
}
}
} else {
warn $AWS::CLIWrapper::Error->{Code};
warn $AWS::CLIWrapper::Error->{Message};
}
DESCRIPTION
AWS::CLIWrapper is wrapper module for aws-cli (recommend: awscli >= 0.7.0, botocore >= 0.7.0).
AWS::CLIWrapper is a just wrapper module, so you can do everything what you can do with aws-cli.
METHODS
- new($param:HashRef)
-
Constructor of AWS::CLIWrapper. Acceptable param are:
region region_name:Str profile profile_name:Str endpoint_url endpoint_url:Str
- autoscaling($operation:Str, $param:HashRef)
- cloudformation($operation:Str, $param:HashRef)
- cloudwatch($operation:Str, $param:HashRef)
- datapipeline($operation:Str, $param:HashRef)
- directconnect($operation:Str, $param:HashRef)
- ec2($operation:Str, $param:HashRef)
- elasticbeanstalk($operation:Str, $param:HashRef)
- elastictranscoder($operation:Str, $param:HashRef)
- elb($operation:Str, $param:HashRef)
- emr($operation:Str, $param:HashRef)
- iam($operation:Str, $param:HashRef)
- importexport($operation:Str, $param:HashRef)
- opsworks($operation:Str, $param:HashRef)
- rds($operation:Str, $param:HashRef)
- redshift($operation:Str, $param:HashRef)
- s3($operation:Str, $param:HashRef)
- ses($operation:Str, $param:HashRef)
- sns($operation:Str, $param:HashRef)
- sqs($operation:Str, $param:HashRef)
- storagegateway($operation:Str, $param:HashRef)
- sts($operation:Str, $param:HashRef)
- swf($operation:Str, $param:HashRef)
-
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.
You can specify
(boolean)
parameter by$AWS::CLIWrapper::true
or$AWS::CLIWrapper::false
.my $res = $aws->ec2('assign-private-ip-addresses', { network_interface_id => $eni_id, private_ip_addresses => [ $private_ip_1, $private_ip_2 ], allow_reassignment => $AWS::CLIWrapper::true, })
ENVIRONMENT
- AWS_CONFIG_FILE
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_DEFAULT_REGION
-
See documents of aws-cli.
AUTHOR
HIROSE Masaaki <hirose31 _at_ gmail.com>
REPOSITORY
https://github.com/hirose31/AWS-CLIWrapper
git clone git://github.com/hirose31/AWS-CLIWrapper.git
patches and collaborators are welcome.
SEE ALSO
http://aws.amazon.com/cli/, https://github.com/aws/aws-cli, http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Welcome.html, https://github.com/boto/botocore,
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.