.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Rex::Box::Amazon 3pm" .TH Rex::Box::Amazon 3pm "2020-09-18" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Rex::Box::Amazon \- Rex/Boxes Amazon Module .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a Rex/Boxes module to use Amazon \s-1EC2.\s0 .SH "EXAMPLES" .IX Header "EXAMPLES" To use this module inside your Rexfile you can use the following commands. .PP .Vb 8 \& use Rex::Commands::Box; \& set box => "Amazon", { \& access_key => "your\-access\-key", \& private_access_key => "your\-private\-access\-key", \& region => "ec2.eu\-west\-1.amazonaws.com", \& zone => "eu\-west\-1a", \& authkey => "default", \& }; \& \& task "prepare_box", sub { \& box { \& my ($box) = @_; \& \& $box\->name("mybox"); \& $box\->ami("ami\-c1aaabb5"); \& $box\->type("m1.large"); \& \& $box\->security_group("default"); \& \& $box\->auth( \& user => "root", \& password => "box", \& ); \& \& $box\->setup("setup_task"); \& }; \& }; .Ve .PP If you want to use a \s-1YAML\s0 file you can use the following template. .PP .Vb 10 \& type: Amazon \& amazon: \& access_key: your\-access\-key \& private_access_key: your\-private\-access\-key \& region: ec2.eu\-west\-1.amazonaws.com \& zone: eu\-west\-1a \& auth_key: default \& vms: \& vmone: \& ami: ami\-c1aaabb5 \& type: m1.large \& security_group: default \& setup: setup_task .Ve .PP And then you can use it the following way in your Rexfile. .PP .Vb 1 \& use Rex::Commands::Box init_file => "file.yml"; \& \& task "prepare_vms", sub { \& boxes "init"; \& }; .Ve .SH "METHODS" .IX Header "METHODS" See also the Methods of Rex::Box::Base. This module inherits all methods of it. .ie n .SS "new(name => $vmname)" .el .SS "new(name => \f(CW$vmname\fP)" .IX Subsection "new(name => $vmname)" Constructor if used in \s-1OO\s0 mode. .PP .Vb 1 \& my $box = Rex::Box::VBox\->new(name => "vmname"); .Ve .SS "ami($ami_id)" .IX Subsection "ami($ami_id)" Set the \s-1AMI ID\s0 for the box. .SS "type($type)" .IX Subsection "type($type)" Set the type of the Instance. For example \*(L"m1.large\*(R". .SS "security_group($sec_group)" .IX Subsection "security_group($sec_group)" Set the Amazon security group for this Instance. .SS "forward_port(%option)" .IX Subsection "forward_port(%option)" Not available for Amazon Boxes. .SS "share_folder(%option)" .IX Subsection "share_folder(%option)" Not available for Amazon Boxes. .SS "info" .IX Subsection "info" Returns a hashRef of vm information.