* Which Category is your question related to? *
Usage / Feature Request
* What AWS Services are you utilizing? *
AWS Appsync, Cognito UserPools
* Provide additional details e.g. code snippets *
I would like to add existing UserPools and APIs to the local amplify project.
For amplify codegen
this is possible by the command amplify add codegen --apiId xyz
Are there similar commands for amplify auth
and amplify api
?
If not, I would wish for something like that.
The Amplify CLI does not currently have this functionality, but it is certainly a good suggestion with many use cases, so I'm tagging this as a feature request.
+1 for this feature. It would be extremely useful.
For when will the feature be?
+1
+1
+1
+1 I'm migrating from Mobilehub to Amplify and it doesn't look like amplify allows me to hook up to my existing userpool. If someone can point me in the right direction, it would be much appreciated.
+1 to add existing API Gateway, AppSync, MongoDB, AuroraDB, Coginto UserPool, Coginto Identity pool and Coginto AppClient.
+1
+1 I'm migrating from Mobilehub to Amplify and it doesn't look like amplify allows me to hook up to my existing userpool. If someone can point me in the right direction, it would be much appreciated.
You can manually add user pools, you just need to figure your app with proper resource data. EI, replace IDs with the one for your existing resources.
+1
+1
+1
+1
BTW, There is a way to add existing Cognito User Pools to your vue app. Please visit https://aws-amplify.github.io/docs/js/start?platform=vue and scroll to bottom till you reach Existing AWS Resources
.
TLDR;
In your App.js instead of doing Amplify.configure(awsmobile)
, do:
Amplify.configure({
Auth: {
// REQUIRED - Amazon Cognito Identity Pool ID
identityPoolId: 'XX-XXXX-X:XXXXXXXX-XXXX-1234-abcd-1234567890ab',
// REQUIRED - Amazon Cognito Region
region: 'XX-XXXX-X',
// OPTIONAL - Amazon Cognito User Pool ID
userPoolId: 'XX-XXXX-X_abcd1234',
// OPTIONAL - Amazon Cognito Web Client ID
userPoolWebClientId: 'XX-XXXX-X_abcd1234',
}
});
+1
Any updates on this issue?
+1 Any update on this?
+1
I have to say from all AWS service that I am using (AppSync, DynamoDb, Cognito, Android-sdk) the amplify cli is by far the most obscure.
Maybe it would be a better workflow to do the schema transformation directly in the AWS console and only download the ready to use configuration, similar to the amplify add codegen
command.
In my point of view, this would be much more consistent.
+1
Our whole team tried to figure out how to take our existing AppSync (which works great with React JS on the web) and build an Amplify iOS/Android app that consumes it... the solution definitely seems occluded.
It is as though the entire Amplify product is focused solely on greenfield apps and not really thought through for existing use cases...
Sorry thats more of a criticism than anything, as I don't really have much to offer in the way of a solution.
@Genkilabs here is a solution I am using on my project, the code is for React Native, but should apply to Swift/Java. We use .env files and ENVFILE environment variable to store configuration information for amplify, rather than aws-exports. We then manually set all needed fields as below. We have added new app consumers to an existing project this way.
function onMount() {
async function go() {
Amplify.configure({
aws_project_region: Config.AWS_PROJECT_REGION,
aws_cognito_identity_pool_id: Config.AWS_COGNITO_IDENTITY_POOL_ID,
aws_cognito_region: Config.AWS_COGNITO_REGION,
aws_user_pools_id: Config.AWS_USER_POOLS_ID,
aws_user_pools_web_client_id: Config.AWS_USER_POOLS_WEB_CLIENT_ID,
Auth: {
identityPoolId: Config.AWS_COGNITO_IDENTITY_POOL_ID,
region: Config.AWS_PROJECT_REGION
}
});
if (Config.ENABLE_ANALYTICS) {
Analytics.configure({
autoSessionRecord: true,
AWSPinpoint: {
appId: Config.AWS_PINPOINT_APP_ID,
region: Config.AWS_PINPOINT_REGION,
mandatorySignIn: true
}
});
}
API.configure({
endpoints: [
{
name: "xxx",
endpoint: `https://lxxx-${Config.ENV}/invocations`,
service: "lambda",
region: "eu-west-2"
}
]
});
It would be really nice if there were docs on settings up amplify without using the wizard. It's way too restrictive if you're already making use of AWS's extensive tooling.
+1 - would love to see this feature! :)
+1.
I wasted a few hours trying to configure the parameters, but none could do.
I don't understand why this wasn't implemented in the first place, since your supposed to be using the custom pools you create. If Amplify makes custom user pools unusable, where's the point of providing them ?
To me this is a HUGE mistake from AWS....
+1 on this, our AppSync Api uses Lambdas as data sources to then connect to Neptune. We would like to leverage Amplify and would need to have the ability to use an existing AppSync Api. Thanks
Well, you can useamplify pull
, select your project, and it will copy your configurations settings like is descripted here https://aws-amplify.github.io/docs/cli-toolchain/quickstart#multiple-frontends
@abrahamAlonzo Yes but you won't be able to use a previously created UserPool, also note that amplify pull
ovewrites your local configuration and Environment variables
Hi folks - we're looking into an ability to import existing AWS resources review the RFC here: #3977
Please re-open if you believe this doesn't cover your workflow.
I managed to solve this as I described on this thread:
https://github.com/aws-amplify/amplify-js/issues/4704#issuecomment-633189931
Most helpful comment
The Amplify CLI does not currently have this functionality, but it is certainly a good suggestion with many use cases, so I'm tagging this as a feature request.