Skip to main content

AWS Setup for React Native Apps with Amplify

Use this page only when your app package includes an AWS or Amplify backend. If your app uses Firebase, follow the Firebase Integration section instead.

Quick Answer

Install and authenticate the Amplify CLI according to the app package requirements, initialize or pull the included Amplify backend, deploy Cognito, AppSync, Lambda, and S3 resources, configure Lambda environment variables, update the app config, then verify sign-up, API reads/writes, media upload, and backend logs.

What the AWS Backend Can Include

AWS servicePurpose
Amazon CognitoUser sign up, login, password reset, and auth tokens.
AWS AppSyncGraphQL API used by app provider modules.
AWS LambdaBackend actions, triggers, validation, notifications, or cleanup.
Amazon S3Media and file storage.
DynamoDBData tables behind AppSync.
CloudWatchLogs for Lambda and backend debugging.

The exact resources depend on the app package. Inspect the included amplify/ folder before deploying.

1. Confirm the App Is AWS-Backed

From the app root:

find . -maxdepth 3 -name "amplify" -o -name "aws-exports.js"
rg "Amplify|api/aws|src/core/aws|aws-exports" src amplify

If no AWS files are present, this page does not apply to that package.

2. Prepare AWS and Amplify CLI

Use an AWS account owned by the product or client. Avoid deploying production resources from a personal temporary account.

Install and configure the Amplify CLI using the workflow required by the package and your AWS organization. Prefer AWS profiles or SSO when available instead of long-lived access keys on developer machines.

At minimum, verify:

aws sts get-caller-identity
amplify --version

3. Initialize or Pull the Backend

If the package includes an Amplify backend:

amplify status

If the backend is not connected to your AWS account yet, initialize or pull the environment according to the package README:

amplify init
# or
amplify pull

Use clear environment names such as dev, staging, and prod.

4. Deploy Backend Resources

Review pending changes:

amplify status

Deploy resources:

amplify push

For large apps, deploy in a controlled order if your backend requires it:

amplify push auth
amplify push api
amplify push function
amplify push storage

Use the order documented by the downloaded package when it differs.

5. Configure Lambda Environment Variables

Some packages require Lambda environment variables for Cognito, AppSync, admin users, third-party APIs, or backend credentials.

Update function configuration:

amplify update function

Common variables:

COGNITO_CLIENT_ID
COGNITO_USER_POOL_ID
ADMIN_USER_USERNAME
ADMIN_USER_PASSWORD

Do not commit secrets or private credentials into React Native source code. Backend secrets belong in AWS-managed configuration.

6. Install Function Dependencies

If a function folder contains its own package.json, install dependencies from that function's source directory before deploy when the package README requires it.

Example:

cd amplify/backend/function/<functionName>/src
corepack yarn install --immutable
# or use the package manager declared by that function

Repeat for each function that has separate dependencies.

7. Update the App Config

After Amplify deploys, confirm the app points to your AWS resources:

  • generated aws-exports.js or equivalent config is present;
  • provider exports use AWS paths for AWS-backed modules;
  • Cognito app client values match the deployed environment;
  • AppSync endpoint and auth mode match the deployed API;
  • S3 bucket and region match your environment.

Provider modules are explained here:

8. Verify App Flows

Run the app and test:

  1. user sign-up;
  2. login and logout;
  3. password reset if enabled;
  4. one API read;
  5. one API write;
  6. media upload if Storage is enabled;
  7. one Lambda-triggered flow;
  8. CloudWatch logs for errors.

Production Checklist

  • AWS account ownership is correct.
  • Separate environments exist for staging and production.
  • Cognito app clients match the app environment.
  • AppSync auth rules protect user data.
  • S3 bucket policies are not public unless intentionally configured.
  • Lambda environment variables are set.
  • CloudWatch logs are reviewed during smoke tests.
  • No demo account ids, secrets, or sample credentials remain.
  • AWS budgets or billing alerts are enabled.

Troubleshooting

ProblemFix
Auth failsCheck Cognito user pool, app client, generated config, and active provider export.
GraphQL calls failCheck AppSync endpoint, auth mode, schema deployment, and API permissions.
Media upload failsCheck S3 bucket, identity permissions, storage provider, and file rules.
Function failsOpen CloudWatch logs and verify environment variables and dependencies.
App still uses Firebase pathsSearch provider exports and switch the active module API to AWS.
Deploy targets the wrong accountCheck AWS profile, SSO session, and aws sts get-caller-identity.

Next Steps