aws / aws/aws-sdk-php

SecretsManagerClient: Detect `PARAMETERS_SECRETS_EXTENSION_HTTP_PORT` and use extension directly

Open
#3,325 2 comments 0 reactions 1 assignee Claimed by @stobrien89 View on GitHub
feature-request
Dominant language
PHP
Stars
6.2k
Forks
1.3k
Avg merge
2h 53m
Merged PRs (30d)
7

Description

### Describe the feature

Hey there,

we recently read about the [AWS Secrets Extension Layer for Lambda functions](https://aws.amazon.com/de/blogs/compute/using-the-aws-parameter-and-secrets-lambda-extension-to-cache-parameters-and-secrets/).
I wonder if it is possible to have the AWS SDK detecting whether this extension is available and make use of it.

### Use Case

Once the extension is added as a layer to the lambda function, applications need to check on their own whether this extension is available or not.
If the client is detecting that layer, applications can keep using the `SecretsManagerClient` which is then querying either the secrets manager directly or the extension, depending on availability.

### Proposed Solution

Extend the logic of `SecretsManagerClient` to detect `PARAMETERS_SECRETS_EXTENSION_HTTP_PORT`. If available, assemble the URL for the secrets manager query respecting that environment variable and end-up querying that URL. AFAIK this would be something like `http://localhost:[PARAMETERS_SECRETS_EXTENSION_HTTP_PORT]/?secretId=`

I think this would be limited to reading secrets as I am not aware if the extension can actually write secrets, etc.

### Other Information

_No response_

### Acknowledgements

- [x] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### SDK version used

latest

### Environment details (Version of PHP (`php -v`)? OS name and version, etc.)

Debian, PHP 8.5

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.