VM::EC...T::dhcp(3pm)
π 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:
AssociateDhcpOptionsCreateDhcpOptionsDeleteDhcpOptionsDescribeDhcpOptions
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,4or8). 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
- debian trixie: libvm-ec2-perl 1.28-5 Β· Artistic-2.0 OR GPL-1.0-or-later
- ubuntu resolute: libvm-ec2-perl 1.28-5 Β· Artistic-2.0 OR GPL-1.0-or-later
- ubuntu stonking: libvm-ec2-perl 1.28-5 Β· Artistic-2.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms