There seem to be two different ways to configure Amplify. Some examples use a key-value properties format:
import aws_exports from "./aws-exports";
Amplify.configure(aws_exports);
Where the aws-exports is something like this:
const awsmobile = {
"aws_project_region": "ap-southeast-2",
"aws_appsync_graphqlEndpoint": "<my graphQL endpoint URL>",
"aws_appsync_region": "ap-southeast-2",
"aws_appsync_authenticationType": "API_KEY",
"aws_appsync_apiKey": "<my API key>",
"aws_cognito_region": "ap-southeast-2",
"aws_user_pools_id": "<my user pool id>",
"aws_user_pools_web_client_id": "<my user pool web client id>",
"aws_cognito_identity_pool_id": "<my cognito id pool id>",
};
export default awsmobile;
And other examples configure Amplify (and its modules) passing the properties in a json format:
Amplify.configure({
Auth: {
mandatorySignIn: true,
region: "ap-southeast-2",
userPoolId: "<my user pool id>",
identityPoolId: "<my cognito id pool id>",
userPoolWebClientId: "<my user pool web client id>"
},
});
The properties are similar but different. I currently use the key-value properties but want to reconfigure Appsync to use authenticationType AMAZON_COGNITO_USER_POOLS using the json format.
What is the difference in the two formats and how do the key-values translate to the Json structure?