---
name: "VM::EC2::Security::CredentialCache"
section: "3pm"
platform: "linux"
package: "libvm-ec2-security-credentialcache-perl"
version: "0.25-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/VM::EC2::Security::CredentialCache"
---

# VM::EC2::Security::CredentialCache(3pm)

## NAME

VM::EC2::Security::CredentialCache -- Cache credentials respecting expiration time for IAM roles.

## SYNOPSIS

Retrieves the current EC2 instance's IAM credentials and caches them until they expire.

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

## DESCRIPTION

This module provides a cache for an EC2's IAM credentials represented by VM::EC2::Security::Credentials.  Rather than retriving the credentials for every possible call that uses them, cache them until they expire and retrieve them again if they have expired.
