aws-amplify / aws-amplify/amplify-cli
Analytics role not working
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 825
- Avg merge
- 11d 23h
- Merged PRs (30d)
- 2
Description
### Before opening, please confirm:
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-js/issues?q=is%3Aissue+) and [discussions](https://github.com/aws-amplify/amplify-js/discussions).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-js/blob/main/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
### JavaScript Framework
Angular
### Amplify APIs
Authentication, Analytics, REST API, GraphQL API, DataStore, Storage
### Amplify Categories
auth, analytics
### Environment information
```
# Put output below this line
```
### Describe the bug
Hi I just added the analytics category to my app and Im getting this error
ERROR Error: Uncaught (in promise): User: arn:aws:sts::XXXXX:assumed-role/us-east-2_qVBo3N2qI-AdminGroupRole/CognitoIdentityCredentials is not authorized to perform: mobiletargeting:PutEvents on resource: arn:aws:mobiletargeting:us-east-1:XXXXXX:apps/4a167a45b9784eba813852e3f3c86205/events
User: arn:aws:sts::704766592508:assumed-role/us-east-2_qVBo3N2qI-AdminGroupRole/CognitoIdentityCredentials is not authorized to perform: mobiletargeting:PutEvents on resource: arn:aws:mobiletargeting:us-east-1:704766592508:apps/4a167a45b9784eba813852e3f3c86205/events
also im getting this warning
AWSPinpointProvider - Please ensure you have updated your Pinpoint IAM Policy with the Action: "mobiletargeting:PutEvents" in order to record events
### Expected behavior
Events being recorded as expected
### Reproduction steps
Add the analytics category
Add the record event as shown in the docs
### Code Snippet
```javascript
// Put your code below this line.
```
### Log output
```
// Put your logs below this line
```
### 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_
Contributor guide
Research direction
Start with the Analytics category setup and the reproduction steps in the issue, then inspect how the CognitoIdentityCredentials role is authorized for Pinpoint events. Reproduce the reported mobiletargeting:PutEvents error and verify that events are recorded as expected without the warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, aws, javascript
- Domain
- authentication, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100