GitHunt
NM

nmarghetti/aws_appsync

Check how to access AWS with graphql

AWS AppSync

Examples

Documentation

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 .aws folder in your home folder (%USERPROFILE% for Windows or ~ for Linux), in .aws folder 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 list

Setup IAM

Setup the project

Setup amplify for any new developer

  1. Create IAM developer policy and developer group

  2. 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 credentials file (profile set to something different than admin)
  3. 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.json

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