Closed vojtech-simko closed 2 years ago
Hi @vojtech-simko 👋 thanks for raising this issue. I was able to reproduce the error and will label this as a bug for the team to look into further.
Thank you @chrisbonifacio 👍
Any update on this or workaround? I have currently the issue, that my amplify application does not send the records to Kinesis stream, and therefore or do not get a trigger on my lambda function for post-process the data.
Would be happy about some hints.
I'm highly interested in a solution to this issue. Do you have a timeline until when it will be fixed?
I have worked around this issue by using the Kinesis pluggable provider itself.
The sample code is as follows:
const KinesisProvider = Analytics.getPluggable('AWSKinesis');
KinesisProvider.record({
event:{
data: "Hello world",
partitionKey: 'myPartitionKey',
streamName: 'firstangulartrialKinesis-dev' // Please refer "kinesisStreamId" output of the amplify-meta json for the correct stream name created by Amplify. 'amplify/backend/amplify-meta.json'
},
provider:"AWSKinesis"
})
Please make Kinesis Provider is registered before this.
import { Analytics, AWSKinesisProvider } from 'aws-amplify';
Analytics.addPluggable(new AWSKinesisProvider());
Please confirm if this works for you.
Hi this issue is now fixed and merged in the latest release. Please let us know if this is still an issue and we can re-open this issue.
Before opening, please confirm:
JavaScript Framework
Angular
Amplify APIs
Authentication, Analytics, GraphQL API, Storage
Amplify Categories
auth, storage, function, api, analytics
Environment information
Describe the bug
After upgrading from
aws-amplify@3.4.3
toaws-amplify@4.3.16
and later to modular packages @aws-amplify/... type-checking throws an error forAmplify.record
method when trying to stream data via AWSKinesisProvider. (problem is there if I importAmplify
fromaws-amplify
as well as from@aws-amplify/analytics
)In documentation it's written:
But when I try to use it this way it throws an error:
I assume the problem is caused by
AnalyticsEvent
only defining structure for sending events to Pinpoint and not Kinesis.Expected behavior
Analytics.record
should allow me to send events via Kinesis provider without type-check errors.Reproduction steps
npm i aws-amplify
ornpm i @aws-amplify/core @aws-amplify/analytics
Amplify.configure(awsconfig);
Analytics.addPluggable(new AWSKinesisProvider()); Analytics.configure({ AWSKinesis: { region: awsconfig.aws_project_region } });
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response