VM::EC...T::dhcp(3pm)

πŸ“¦
version 1.28 Β· 7 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

VM::EC2::REST::dhcp β€” bestie, this is the page that teaches you how to manage DHCP Option objects ✨ (and yeah, it's page VM::EC2::REST::dhcp from the User Contributed Perl Documentation, we love a humble queen πŸ‘‘)


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so first things first, you gotta load it up:

use VM::EC2 qw(:vpn);

that's it. that's the whole vibe. πŸŽ€


✨ METHODS ✨

so these methods are all about DHCP Option objects, right? and the whole point of them is that you can take one of these bad boys and slap it onto a VPC to configure the DHCP options that get applied to your running instances. iconic behavior, honestly. πŸ’…

you get access to all of these when you import the tag :vpn β€” like, that's the entry fee, no cap.

Implemented:

  • AssociateDhcpOptions
  • CreateDhcpOptions
  • DeleteDhcpOptions
  • DescribeDhcpOptions

Unimplemented;

  • (none)
yes bestie, "Unimplemented;" really does have a semicolon in the original and honestly? she's serving punctuation chaos. we respect it. πŸ™ˆ

πŸ’œ $options = $ec2->create_dhcp_options(\%configuration_list)

this one creates a DhcpOption object. the one single required argument is a configuration list hash β€” and you can hand it over either as a hashref or as a flattened hash, dealer's choice, we don't gatekeep 🫢

inside that hash you can put one or more of these keys:

  • -domain_name β€” the domain name for instances running in this VPC. 🏠
  • -domain_name_servers β€” a scalar or an arrayref holding up to 4 IP addresses of domain name servers for this VPC.
  • -ntp_servers β€” a scalar or an arrayref holding up to 4 IP addresses of network time protocol servers. ⏰
  • -netbios_name_servers β€” a scalar or an arrayref holding up to 4 IP addresses for NetBIOS name servers.
  • -netbios_node_type β€” the NetBios node type (1, 2, 4 or 8). Amazon recommends using "2" at this time. πŸ‘€

when it works out, you get back a VM::EC2::VPC::DhcpOptions object. and then?? you can associate it with a VPC using the VPC object's set_dhcp_options() method. look at her go:

$vpc     = $ec2->create_vpc(...);
$options = $ec2->create_dhcp_options(-domain_name=>'test.com',
                                     -domain_name_servers=>['204.16.255.55','216.239.34.10']);
$vpc->set_dhcp_options($options);

ate. no crumbs. πŸ”₯


🌸 $success = $ec2->delete_dhcp_options($dhcp_id)

deletes the indicated DHCPOptions and returns true if it went through. πŸ’€βœ¨ you can also use the named argument -dhcp_options_id. (yes that's a double period at the end of the original sentence, she's mysterious like that)


🌈 @options = $ec2->describe_dhcp_options(@option_ids)

🌈 @options = $ec2->describe_dhcp_options(\%filters)

🌈 @options = $ec2->describe_dhcp_options(-dhcp_options_id=>$id, -filter => \%filters)

this one hands you back a whole list of VM::EC2::VPC::DhcpOptions objects β€” they're describing a set of DHCP options that you can assign to a VPC. 🎁

call it with zero arguments and it literally just returns all DhcpOptions. want to narrow it down? pass a list of option IDs or a filter hashref and boom, restricted search. πŸ’…

Optional arguments:

  • -dhcp_options_id β€” a scalar or an arrayref of DhcpOption IDs.
  • -filter β€” a hashref of filters.

the available filters are described over at: http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeDhcpOptions.html

(not me linking you the lore πŸ“š)


🧚 $success = $ec2->associate_dhcp_options($vpc_id => $dhcp_id)

🧚 $success = $ec2->associate_dhcp_options(-vpc_id => $vpc_id,-dhcp_options_id => $dhcp_id)

this associates a VPC ID with a DHCP option set. that's the whole job, she's focused. 🎯

and here's the little trick: pass an ID of 'default' to restore the default DHCP options for the VPC. periodt. πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘

  • VM::EC2

πŸ“ AUTHOR πŸ“

Lincoln Stein <lincoln.stein@gmail.com>.

Copyright (c) 2011 Ontario Institute for Cancer Research

This package and its accompanying libraries is free software; you can redistribute it and/or modify it under the terms of the GPL (either version 1, or at your option, any later version) or the Artistic License 2.0. Refer to LICENSE for the full license text. In addition, please see DISCLAIMER.txt for disclaimers of warranty.


and that's the whole page, bestie!! this one's from perl v5.38.2, dated 2024-08-10 β€” so go forth, associate those DHCP options, and slay πŸ’…πŸ’–βœ¨πŸ¦‹
πŸ“¦ where this page comes from