Rex::Box::Amazon(3)

πŸ“¦ version 1.14.3, in nixos 26.05, nixpkgs unstable

πŸ’– Rex::Box::Amazon(3) πŸ’–

okay so welcome to this User Contributed Perl Documentation page for Rex::Box::Amazon(3) β€” she has main character energy, she's iconic, and we're gonna get you comfy with her. 🫢


πŸ’– NAME πŸ’–

Rex::Box::Amazon - Rex/Boxes Amazon Module. the way that name section ate and left no crumbs, periodt. πŸ‘‘

✨ DESCRIPTION ✨

okay so this is a Rex/Boxes module to use Amazon EC2. literally it's giving Amazon EC2 realness, slay. πŸ’…

🌸 EXAMPLES 🌸

To use this module inside your Rexfile, you can use the following commands, fr fr. πŸŽ€

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");
  };
};

If you want to use a YAML file you can use the following template. the YAML template is giving organized fairy vibes πŸ§šπŸ¦‹

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 can use it the following way in your Rexfile. not me being obsessed with how clean this is πŸ˜­πŸ’–

use Rex::Commands::Box init_file => "file.yml";

task "prepare_vms", sub {
  boxes "init";
};

πŸ‘‘ METHODS πŸ‘‘

vibe check: also go peek at the Methods of Rex::Box::Base β€” this module inherits all methods of it, no cap. 🌈

πŸ’… new(name => $vmname)

Constructor if used in OO mode. πŸŽ€

my $box = Rex::Box::VBox->new(name => "vmname");

⭐ ami($ami_id)

Set the AMI ID for the box. πŸ“

⭐ type($type)

Set the type of the Instance. For example "m1.large", bestie. πŸ”₯

⭐ security_group($sec_group)

Set the Amazon security group for this Instance. πŸ’œ

🚫 forward_port(%option)

🚫 Not available for Amazon Boxes. lowkey that's the whole tea. πŸ˜­πŸ’€

🚫 share_folder(%option)

🚫 Not available for Amazon Boxes. highkey same energy, bestie. πŸ™ˆ

⭐ info

Returns a hashRef of vm information. iconic. πŸ‘‘


mwah πŸ’– β€” this page is perl v5.42.3, dated 2023-08-05, for Rex::Box::Amazon(3). bye bestie! 🫢

πŸ“¦ where this page comes from