VM::EC...lCache(3pm)

πŸ“¦
version 0.25 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– VM::EC2::Security::CredentialCache πŸ’–

okay so bestie, you know that page in the manual called VM::EC...lCache(3pm)? that's literally this one. it lives in the User Contributed Perl Documentation corner of the world, and it's here to talk about caching credentials for IAM roles, with full respect for expiration time. slay. πŸ‘‘


✨ NAME ✨

VM::EC2::Security::CredentialCache β€” the way that it caches credentials while respecting expiration time for IAM roles. no cap. πŸ’…


🌸 SYNOPSIS 🌸

so the whole vibe is: it goes and grabs the current EC2 instance's IAM credentials, and then it caches them until they expire. iconic behaviour honestly.

use VM::EC2::Security::CredentialCache;

# return a VM::EC2::Security::Credentials if available undef otherwise.
my $credentials = VM::EC2::Security::CredentialCache->get();

that get() call is giving main character energy β€” it hands you a VM::EC2::Security::Credentials if one's available, and undef otherwise. fr fr. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜•: this module provides a cache for an EC2's IAM credentials, which are represented by VM::EC2::Security::Credentials.

and the reason it exists? instead of retrieving the credentials for every single possible call that uses them (exhausting, honestly, we're not doing that), it caches them until they expire. and then β€” the moment they've expired β€” it goes and retrieves them all over again. obsessed with the efficiency. ✨


lowkey a whole glow-up for your API calls: cache it, respect the expiration, refresh when needed, periodt. πŸ’–

and that's the whole page, bestie! this gorgeous little doc came from perl v5.34.0, dated 2022-06-28, and the footer it rode in on was just the manual name VM::EC...lCache(3pm) again β€” so consider it shouted out. πŸŽ€ stay cached, stay fresh, iykyk. πŸŒˆπŸ’…

πŸ“¦ where this page comes from