NOTICE: Some AWS services used may not be covered by the Free tier after 12 months.
Before you deploy, you must have the following in place:
- AWS Account
- GitHub Account
- Node 10 or greater
- Amplify CLI 4.13.1 or greater installed and configured
- Stripe Account
- Take note of your testing
Secret KeyandPublic Keylocated in the Stripe Dashboard
- Take note of your testing
For prototyping, you need the following:
Follow these instructions to deploy the Serverless Airline application:
- Use 1-click deployment button above
- Expand
environment variablesand add your Stripe's keysSTRIPE_PUBLIC_KEYSTRIPE_SECRET_KEY
- If you don't have an IAM Service Role, create one
- Amplify Console forked this repository in your GitHub account, clone your fork repo locally
- Within your new app in Amplify Console, wait for deployment to complete (this may take a while)
- Choose Backend environments, and select the environment you see
- Under Edit backend, copy the
amplify pullcommand displayed - Within your forked repository locally, run the command you copied and follow the instructions
- This command synchronizes what's deployed to your local Amplify environment
Within Amplify Console, you should see an auto-generated URL under Frontend environment - You can now sign-up for a new user, and add your first flight
NOTE: We're currently working on an ETL feature to automatically add flights as part of CI.
Provided you have followed deployment instructions and signed up your first user, take the steps below to log in to AWS AppSync and run a createFlight mutation:
- Open Amplify variable file
src/frontend/aws-exports.jsand take note ofaws_user_pools_web_client_id - Go to the AWS AppSync Console, and select the
Serverless Airline API - Go to
Querieson the left menu, and selectLogin with User Pools - Within
ClientIduse the value you took note inStep 1, and use the credentials of your newly created Cognito user - Within your fork, copy any of the
createFlightmutations provided insample-queries-mutations.gql - Open up the front-end, and search for a flight from
LGWtoMADfor December 2nd, 2019
To delete the Serverless Airline from your AWS Account, you need:
- Git branch name - Branch you connected in Amplify Console (e.g. twitch)
- Root Stack name - Root CloudFormation Stack name, available in System Manager Parameter Store (e.g. /twitch/stackName)
By running the commands below within the project source code, you will
- Fetch the root stack name into STACK_NAME environment variable
- Export the
git branch nameused in Amplify Console - you need to replace with the correct value - Delete all back-ends managed by Serverless Application Model (SAM) in the correct order
- Delete all resources managed by Amplify (API, DynamoDB Table, Cognito)
# export AWS_BRANCH="twitch"
export AWS_BRANCH="<<Git Branch Name you used>>"
export STACK_NAME=$(aws ssm get-parameter --name /${AWS_BRANCH}/service/amplify/deployment/stackName --query 'Parameter.Value' --output text)
make delete
amplify deleteLastly, deployment S3 buckets may remain untouched. You can safely delete buckets starting with awsserverlessairline-<<<timestamp>>>-deployment, use either via Console, CLI or SDK