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