Skip to content

Commit b85111f

Browse files
authored
SecretsManager Client (#1036)
* [SecretsManager] Create service with tests * [Core] Add factory for SecretsManager * Make SecretsManager test work when running all tests * [SecretsManager] Add docs * [SecretsManager] Code style fix * Update psalm baseline to include SecretsManager
1 parent ce7e00d commit b85111f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/AwsClientFactory.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use AsyncAws\Rekognition\RekognitionClient;
2525
use AsyncAws\Route53\Route53Client;
2626
use AsyncAws\S3\S3Client;
27+
use AsyncAws\SecretsManager\SecretsManagerClient;
2728
use AsyncAws\Ses\SesClient;
2829
use AsyncAws\Sns\SnsClient;
2930
use AsyncAws\Sqs\SqsClient;
@@ -251,6 +252,19 @@ public function s3(): S3Client
251252
return $this->serviceCache[__METHOD__];
252253
}
253254

255+
public function secretsManager(): SecretsManagerClient
256+
{
257+
if (!class_exists(SecretsManagerClient::class)) {
258+
throw MissingDependency::create('async-aws/secret-manager', 'SecretsManager');
259+
}
260+
261+
if (!isset($this->serviceCache[__METHOD__])) {
262+
$this->serviceCache[__METHOD__] = new SecretsManagerClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
263+
}
264+
265+
return $this->serviceCache[__METHOD__];
266+
}
267+
254268
public function ses(): SesClient
255269
{
256270
if (!class_exists(SesClient::class)) {

0 commit comments

Comments
 (0)