aws-amplify / aws-amplify/amplify-cli

Permissions Error when recording events with KinesisStream provider from Analytics

Open
#11,631 5 comments 1 reaction 0 assignees View on GitHub
analytics bug p2
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### How did you install the Amplify CLI?

npm

### If applicable, what version of Node.js are you using?

16.4

### Amplify CLI Version

10.5.2

### What operating system are you using?

Mac

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No

### Describe the bug

I am using the Kinesis Streams provider from the Analytics feature set - and I am getting an error when trying to use Analytics.record

{"__type":"AccessDeniedException","Message":"User: arn:aws:sts::613607431007:assumed-role/amplify-nextjsplayground-dev-205355-unauthRole/CognitoIdentityCredentials is not authorized to perform: kinesis:PutRecords on resource: arn:aws:kinesis:us-west-2:613607431007:stream/undefined because no identity-based policy allows the kinesis:PutRecords action"}

If I try updating the Project by using `amplify update analytics` I get an error from the CLI and I cannot proceed.

### Expected behavior

Permission errors for the UnAuth role should not be shown when using the Kinesis Stream provider.

### Reproduction steps

1. Add amplify by using `amplify add analytics`
2. Choose Kinesis Streams as the provider
3. Allow Auth and UnAuth roles to access the Analytics resource
4. Register the Kinesis pluggable into the NextJS app
5. Try using the `Analytics.record` API
6. The error shows up in the console

### Project Identifier

07d8fa9a07058e596960d73808ea0ff5

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

### Before submitting, please confirm:

- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

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.