aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 821 forks source link

How do I add AdminQueries when i am using Imported Cognito Auth #13666

Open rexwreyes opened 6 months ago

rexwreyes commented 6 months ago

Amplify CLI Version

12.10.1

Question

How do I add AdminQueries when i am using Imported Cognito Auth? I have been following the docs in setting up everything. When i have my auth set up to use an existing cognito, running amplify update auth returns "Updating imported Auth resource is not supported". I am not trying to update the existing i want to add AdminQueries. Is this just not supported?

rexwreyes commented 6 months ago

Just to add some context here. I have an app with different backend environments (Prod, stage, dev) and i want them different other than the auth which is a shared cognito user pool. the 1st environment i created has the adminqueries as the auth was created there and not imported

ykethan commented 6 months ago

@rexwreyes thank you for reaching out. This is currently an unsupported workflow, as Amplify CLI does not maintain the lifecycle of an imported auth resource. Did notice the documentation provides information on using a existing auth resource which may be attributing this. You should be able to manually create a REST API and function with access to the imported auth resource and build the function queries. Marking this feature-request and documentation to add callout on using a imported auth resource.

rexwreyes commented 6 months ago

@ykethan the documentation i was following was this, then this.

Thanks for the response. i think i'll try doing what i need through aws-sdk