$session= $this->environment->variable('AWS_SESSION_TOKEN');
$access= $this->environment->variable('AWS_ACCESS_KEY_ID');
$secret= new Secret($this->environment->variable('AWS_SECRET_ACCESS_KEY'));
After:
$credentials= $this->environment->credentials();
API
public class com.amazon.aws.lambda.Credentials implements lang.Value {
public function __construct(string $accessKey, string|util.Secret $secretKey, ?string $sessionToken)
public function accessKey(): string
public function secretKey(): util.Secret
public function sessionToken(): ?string
public function hashCode(): string
public function toString(): string
public function compareTo(var $value): int
}
Access to the access keys obtained from the function's execution role, see https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime
What this pull request simplifies
Before:
After:
API