amplify-cli
amplify-cli copied to clipboard
amplify add pinpoint - There was an error adding the analytics resource
How did you install the Amplify CLI?
yarn
If applicable, what version of Node.js are you using?
18.16.0
Amplify CLI Version
12.8.1
What operating system are you using?
Windows 11
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Describe the bug
After amplify pull --appId xxxxx --envName prod
amplify analytics add --debug
Output:
? Select an Analytics provider Amazon Pinpoint √ Provide your pinpoint resource name: · appui ConfigurationError: The imported auth config is not compatible with the specified analytics config at configure (C:\snapshot\amplify-cli\build\node_modules@aws-amplify\amplify-category-analytics\lib\provider-utils\awscloudformation\service-walkthroughs\pinpoint-walkthrough.js:61:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.executeAmplifyCommand (C:\snapshot\amplify-cli\build\node_modules@aws-amplify\amplify-category-analytics\lib\index.js:169:3) at async executePluginModuleCommand (C:\snapshot\amplify-cli\build\node_modules@aws-amplify\cli-internal\lib\execution-manager.js:139:5) at async executeCommand (C:\snapshot\amplify-cli\build\node_modules@aws-amplify\cli-internal\lib\execution-manager.js:37:9) at async Object.run (C:\snapshot\amplify-cli\build\node_modules@aws-amplify\cli-internal\lib\index.js:121:5) 🛑 There was an error adding the analytics resource
I read that: https://github.com/aws-amplify/amplify-cli/issues/13240 but after enabled guest doesn't work (i didn't found unauthenticated users feature):
Expected behavior
add pinpoint
Reproduction steps
- launch "amplify add pinpoint"
Project Identifier
No response
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.
Hey @dotto95, thank you for reaching out. Tried reproducing the issue with the following steps and latest Amplify CLI version.
- created a new user pool with app client and sample providers
-
created an identity pool with guest access and Authenticated access enabled. Authenticated identity source as Cognito user pool
-
amplify import auth
->Cognito User Pool and Identity Pool
-
amplify add analytics
->Pinpoint
the analytics resource was successfully added. Does the reproduction steps align with your current environment?
Hey there,
Thank you for the detailed walkthrough. The steps you've described do align with my environment, and the analytics resource was added successfully.
However, I'm looking to integrate this with my existing Cognito user pool, where I already have users registered. As you can see in the screenshots, I've also enabled guest users.
During my testing, I encountered an error when using the amplify pull command.
amplify pull --appId yyyyyyyyyyyyyyyyyy--envName xxxxxxxxxxxxxx --debug
Opening link: https://eu-central-1.admin.amplifyapp.com/admin/xxxxxxxxxxxxxx/prodrest/verify/?loginVersion=1
⠋ Confirm login in the browser or manually paste in your CLI login key:
Successfully received Amplify Studio tokens.
Amplify AppID found: xxxxxxxxxxxxxx. Amplify App name is: appui
Backend environment prodrest found in Amplify Console app: appui
? Choose your default editor: Visual Studio Code
√ Choose the type of app that you're building · javascript
Please tell us about your project
? What javascript framework are you using react
? Source Directory Path: src
? Distribution Directory Path: build
? Build Command: yarn build
? Start Command: yarn start
No AppSync API configured. Please add an API
TypeError: Cannot read properties of undefined (reading 'length')
Skipping UI component generation since none are found.
? Do you plan on modifying this backend? Yes
/ Fetching updates to backend environment: prodrest from the cloud.Overrides functionality is not implemented for this category
√ Successfully pulled backend environment prodrest from the cloud.
✅
✅ Successfully pulled backend environment prodrest from the cloud.
Run 'amplify pull' to sync future upstream changes.
No AppSync API configured. Please add an API
TypeError: Cannot read properties of undefined (reading 'length')
Skipping UI component generation since none are found.
Could you provide guidance on how to integrate Amplify with an existing Cognito user pool and resolve the issue encountered with amplify pull?
Thanks in advance for your assistance.
Hey @dotto95, curious when running amplify import auth
are you importing both the user pool and identity pool?
you should be able to import the existing user pool and the identity pool. Diving the code here: https://github.com/aws-amplify/amplify-cli/blob/52aea18fddd95af6f855d1c6d9e3e4b16a8d1146/packages/amplify-category-analytics/src/provider-utils/awscloudformation/service-walkthroughs/pinpoint-walkthrough.ts#L65
the resource check if the project has an identity pool and unauthenticated access enabled.
Closing the issue due to inactivity. Do reach out to us if you require any assistance.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.