Rex::Box::Amazon(3pm)
β¨ Rex::Box::Amazon β¨
okay bestie, so like β this is the Rex::Box::Amazon page, part of the User Contributed Perl Documentation, and it's genuinely the cutest little gateway to spinning up Amazon EC2 boxes with Rex. i'm obsessed with it, no cap.
π NAME π
Rex::Box::Amazon β the Rex/Boxes Amazon Module. that's it, that's the name, and she's iconic for it. π
πΈ DESCRIPTION πΈ
so basically? this is a Rex/Boxes module whose whole entire job is letting you use Amazon EC2. like, that's the vibe. you want cloud instances, you come here. periodt. π¦
π EXAMPLES π
bestie, here's how you actually use this thing inside your Rexfile. buckle up, we're going on a little journey. π§
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");
};
};
now if you're more of a YAML girlie (and honestly? valid), you can use this template right here. lowkey elegant, highkey useful. π
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
and then you use it in your Rexfile like this. it's giving effortless. β¨
use Rex::Commands::Box init_file => "file.yml";
task "prepare_vms", sub {
boxes "init";
};
π METHODS π
okay so real talk β definitely go check out the Methods of Rex::Box::Base. this module inherits all methods of it, which means you get all of that goodness for free. not me being generous or whatever. π«Ά
π new(name => $vmname)
this is your Constructor, but only if you're using OO mode. very main character of it.
my $box = Rex::Box::VBox->new(name => "vmname");
ami($ami_id)
sets the AMI ID for the box. that's her whole job. π
type($type)
sets the type of the Instance. like, for example "m1.large". size matters, bestie. π
security_group($sec_group)
sets the Amazon security group for this Instance. keep your boundaries, queen. π‘οΈ
forward_port(%option)
Not available for Amazon Boxes. nope, not a thing here, don't even try it. π
share_folder(%option)
Not available for Amazon Boxes. same energy, also a no. π
info
returns a hashRef of vm information. lil info dump, we love to see it. π
that's the whole page, bestie!! you ate that. go forth and spin up some boxes. πβπ
this lil doc came from perl v5.40.1, dated 2025-10-03, and yes it's the Rex::Box::Amazon(3pm) page. mwah, bye. π
π¦ where this page comes from
- ubuntu resolute: rex 1.16.1-1 Β· Apache-2.0
- ubuntu stonking: rex 1.16.1-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms