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 service | Purpose |
|---|---|
| Amazon Cognito | User sign up, login, password reset, and auth tokens. |
| AWS AppSync | GraphQL API used by app provider modules. |
| AWS Lambda | Backend actions, triggers, validation, notifications, or cleanup. |
| Amazon S3 | Media and file storage. |
| DynamoDB | Data tables behind AppSync. |
| CloudWatch | Logs 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.jsor 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:
- user sign-up;
- login and logout;
- password reset if enabled;
- one API read;
- one API write;
- media upload if Storage is enabled;
- one Lambda-triggered flow;
- 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
| Problem | Fix |
|---|---|
| Auth fails | Check Cognito user pool, app client, generated config, and active provider export. |
| GraphQL calls fail | Check AppSync endpoint, auth mode, schema deployment, and API permissions. |
| Media upload fails | Check S3 bucket, identity permissions, storage provider, and file rules. |
| Function fails | Open CloudWatch logs and verify environment variables and dependencies. |
| App still uses Firebase paths | Search provider exports and switch the active module API to AWS. |
| Deploy targets the wrong account | Check AWS profile, SSO session, and aws sts get-caller-identity. |