AWS | Setup AppSync API – Connect App with AWS DynamoDB Database

To Connect App with DynamoDB Database, we need to setup & configure AppSync API. Refer below steps to set up AppSync API:


STEP 1: #

  1. Sign in to the AWS Console, Navigate/Search for AppSync
  2. Click on “AWS AppSync

STEP 2: #

  1. Click on “APIs” from the left menu
  2. Select the correct “Region” where you already had setup the Authentication Pool
  3. Click “Create API” button to Create a new API.

STEP 3: #

  1. Select “GraphQL APIs” as the API type
  2. Select “Design from scratch” as Data source.

Click Next

STEP 4: #

Enter “DBConnectAPI” as the API name and hit Next

STEP 5: #

Select “Create GraphQL resources later” and click Next.

STEP 6: #

Review & Click Create API


STEP 7: #

  1. From the left menu, Click the newly created “DBconnectAPI
  2. Navigate to Settings tab
  3. Setup Default authorization mode
  4. Select “Amazon Cognito User Pool” under API-level
  5. Select the “AWS Region” where you already have set up the Authentication Pool
  6. Select “CustomAuthenticationPool” from the User pool list.


STEP 8: #

Click on “New” button to add an Additional authorization providers.

Select “AWS Identity and Access management (IAM)“from the list & hit Submit

STEP 9: #

Click “Save” to save the changes done in Authorization mode

STEP 10: #

👏 Congratulations! AppSync API is now created.

  1. Navigate to “AppSync” section from the AWS Console
  2. Click on “APIs” from the left menu
  3. Make sure you have the correct “AWS Region” selected
  4. The newly created “DBConnectAPI” will be shown here

Copy AWS_APPSYNC_API_NAME, AWS_GRAPHQL_API_ENDPOINT and AWS_APPSYNC_API_ID as shown below and use it in the app setup wherever required.

STEP 11: #

Next, we have to Configure the AppSync API that was recently created.

Powered by BetterDocs