AWS AppSync
Examples
- 01_aws_apikey: Simple call with AWS and APIKEY
- 02_aws_appsync_apikey: Simple call using Apollo with AppSync and APIKEY
- 03_aws_appsync_iam: Simple call using Apollo with AppSync and IAM
- 04_aws_appsync_cognito: Simple call using Apollo with AppSync and Congnito/IAM
- 05_aws_appsync_apollo3: Simple call using Apollo 3 with AppSync and Congnito/IAM
- 10_react_app_authentication: React app with amplify authenticator to check sign in
- 11_react_app_queries: React app with graphql queries with class and apollo 2
- 12_react_app_queries_hooks: React app with graphql queries with hooks and apollo 3
Documentation
- Amplify: Amplify CLI, Authentication, Team work commands
- AWS profile, AWS multi env
- AWS SDK for Node.js
- AppSync: Documentation, Security
- GraphQL API Security with AWS AppSync and Amplify
- Apollo: Client, VSCode extension, Server
Start amplify from scratch
Configure your AWS credentials
-
Get you access key and secret from AWS console (on your account menu, select
My Security Credentials) -
Create your profile
# It will ask you for your access key and secret ./scripts/amplify_config.sh -p admin # It can be useful to define a default profile, better create another user that does not have admin rights ./scripts/amplify_config.sh -p default
That will create 2 files in
.awsfolder in your home folder (%USERPROFILE% for Windows or ~ for Linux), in.awsfolder the file.aws/credentials with such content:-
credentials
[admin] aws_access_key_id = <admin access key id> aws_secret_access_key = <admin secret key> [default] aws_access_key_id = <default access key id> aws_secret_access_key = <default secret key>
-
config
[admin] region=eu-west-1 [default] region=eu-west-1
-
Initialize the differents environments for your application
# If you dont set a profile it will save access key and secret in a file in .amplify/awscloudformation (better avoid that)
AWS_PROFILE=admin AMPLIFY_ENV=prod ./scripts/amplify_init.sh <project_name>
AWS_PROFILE=admin AMPLIFY_ENV=test ./scripts/amplify_init.sh <project_name>
AWS_PROFILE=admin AMPLIFY_ENV=dev ./scripts/amplify_init.sh <project_name>You can then check your environments
amplify env listSetup IAM
Setup the project
Setup amplify for any new developer
-
Create IAM developer policy and developer group
-
Create developer environment
- Create the new user in IAM with developer group
- Provide the new developer its Access key and secret or ask to log in AWS console
- Ask the developer to set its
credentialsfile (profile set to something different than admin)
-
Ask developer to clone the repo and and setup its amplify env
amplify init # Do you want to use an existing environment? Yes # Choose the environment you would like to use: dev # Choose your default editor: Visual Studio Code # Do you want to use an AWS profile? Yes # Please choose the profile you want to use -> select the one your put in your credentials file
npx tsconfig.jsonOn this page
Languages
JavaScript66.9%TypeScript11.1%Shell9.2%Python6.7%HTML3.1%CSS3.0%
Contributors
GNU General Public License v3.0
Created October 1, 2020
Updated March 4, 2023