Skip to content

Commit f4f008d

Browse files
authored
Added CloudWatchLogs client (#543)
* Added CloudWatchLogs client * Fixed typo * Added docs for CloudWatchLogs
1 parent 5858f35 commit f4f008d

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
@@ -5,6 +5,7 @@
55
namespace AsyncAws\Core;
66

77
use AsyncAws\CloudFormation\CloudFormationClient;
8+
use AsyncAws\CloudWatchLogs\CloudWatchLogsClient;
89
use AsyncAws\CodeDeploy\CodeDeployClient;
910
use AsyncAws\CognitoIdentityProvider\CognitoIdentityProviderClient;
1011
use AsyncAws\Core\Credentials\CacheProvider;
@@ -98,6 +99,19 @@ public function cloudFormation(): CloudFormationClient
9899
return $this->serviceCache[__METHOD__];
99100
}
100101

102+
public function cloudWatchLogs(): CloudWatchLogsClient
103+
{
104+
if (!class_exists(CloudWatchLogsClient::class)) {
105+
throw MissingDependency::create('async-aws/cloud-watch-logs', 'CloudWatchLogs');
106+
}
107+
108+
if (!isset($this->serviceCache[__METHOD__])) {
109+
$this->serviceCache[__METHOD__] = new CloudWatchLogsClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
110+
}
111+
112+
return $this->serviceCache[__METHOD__];
113+
}
114+
101115
public function codeDeploy(): CodeDeployClient
102116
{
103117
if (!class_exists(CodeDeployClient::class)) {

0 commit comments

Comments
 (0)