When i ve tried to send logs from Android client to Cloudwatch i ve received next error:
com.amazonaws.AmazonServiceException: Credential should be scoped to correct service: 'logs'. (Service: AmazonCloudWatchLogs; Status Code: 400; Error Code: InvalidSignatureException;
i m using aws-android-sdk-logs library.
Client has access and secret key, i ve setted correct region...
What i m doing wrong ?
Thank you @eashevchenko for reporting to us. What version of SDK are you using? Can you share a code snippet and the stacktrace?
I m using aws-android-sdk-logs:2.6.18 . And i have implemented client like this: https://stackoverflow.com/questions/36876563/amazon-cloud-watch-log-putlogeventsrequest-the-given-sequencetoken-is-invali
Hello @eashevchenko
This is a bug due to incorrect configuration for signer. It will be fixed in next release of the SDK.
Thanks,
Rohan
Before Rohan fix that you can use a temporal solution: set ServiceName directly.
The issue is that AmazonCloudWatchLogsClient use wrong service name.
By def service name will be initialized using def httpClientName. To avoid it you can set ServiceName by yourself:
AmazonCloudWatchLogsClient client = new AmazonCloudWatchLogsClient(credential);
client.setServiceNameIntern("logs");
// .. use client after ..
You are right @olehspavl
Thats a good work-around till we have the release out!
Fixed in version 2.6.19
Most helpful comment
Before Rohan fix that you can use a temporal solution: set ServiceName directly.
The issue is that AmazonCloudWatchLogsClient use wrong service name.
By def service name will be initialized using def httpClientName. To avoid it you can set ServiceName by yourself: