AWS Amplify has released a brand new CLI Toolchain that makes it easy to create & configure AWS cloud services on the fly directly from your local environment.
This CLI complements the AWS Amplify Library to provide an end to end solution for the creation, configuration, & implementation of scalable cloud-enabled applications with a Rails-like experience focusing on developer efficiency. AWS Amplify supports not only JavaScript applications & frameworks like Angular, React, & React Native, but also native iOS & native Android.
Build web apps and mobile apps quickly
AWS Amplify released only a couple of weeks ago – in September
Excited to tell you about it
With Cli+toolchain- have toolkit to build really interesting things
How to get up and running
How to use amplify in actual app
Intro self
Aws amplify: cli+toolchain for client
Get started easy
Sign up for an AWS account—no upfront charges
Install the CLI
Build your app: ios, android, web, react native
Provides ecosystem around building apps
Split in two parts
create +maintain sophisticated serverless backends for your apps
With minimal effort
Create, config services dir. From cmd line
comprehensive library for building sophisticated cloud-powered apps
Interact w/ diff svcs scaffolded into cli
Rapidly build apps
Dynamodb, rds, elastic search, diff rds engines
Custom apis, graphql apis
Get lambda up+running quickly dir from front-end
Authent – easily, authorization on diff. endopoints
Analytics w/ pinpoint
Hosting of web app, publish dir. From cmd line
Storage: s3
Auth w/ cognito — diff. things related to user reg+ auth
Forget pass, mfa
Time based one time passwords, e.g. sophisticated user auth scenarios
Create resources dir. From app, interact w/ them within app
Add auth around it
Lots cases that are not library specific: can write own modules
But standard use cases: Sign-up form, sign-in forms - use pre-config components
e.g. passwd policy failures: report out of box, no addt’l work requ’d
See auth failures, draw conclusions, e.g. relax requirements
Scaffold boiler plate code as starting point
Once api created: use JS lib to interact w/ api
Real-time
Use appsync console
Also can create graphql endpoint from cli
Similar to auth components: use react+RN components
Render queries dir from react/RN libs
Combo of ddb+lambda+apigw
Create resources, boilerplate code to interact
CRUD w/o lots of intermediate code – handled for you
Create standalone lambda fns
Test locally
Host website on AWS:
2 cmds to config website for hosting on s3
http interface
Cust. domain w/ route53 DNS
Will walk through
Show in slide first, then show demo
Go to app dir
Then run ‘init’
Scaffold project, to prep, then ready to go
Once app ready, add features
Auth code, get local config ready
Once all svcs you want are added locally
Start interact w/ them using amplify client lib
In same dir where we used amplify cli project
Install aws amplify: amplify js lib to use in your proj.
If js framework specific lib you want to use:
If react project: add aws-amplify-react
Angular project: use aws-amplify-angular
built-in components for vuejs lib: use aws-amplify-vue
Once local components installed, start using them
Auth to allow us to use the diff. features in Amazon cognito
Start interacting w/ services
Place in scope
Call Auth.signIn (user/pass)
Sign-in returns promise
If promise successful, log user in, typically start routing there
Error: simply log error
If want to learn more about Auth: has 30+ methods
Github doc, aws doc site have lots of details avbl and shows how the diff. components work
Summary:
Amplify is toolchain
Typically managing for startups or otherwise, expensive to hire devs, precious resource
Experiment
Want own auth service – takes many hours
Use amplify to try out diff. managed services
Try things out
If experiment works, scale out
If it doesn’t work, then didn’t invest lots of resources, try something else
Who here develops for ios?
Android?
Web?
create new react project
create new func in react app to sign-up+sign-in to app, add analytics, look resources in console
create-react-app amplifydemo
cd amplifydemo
amplify init — init new amplify project
# editor: chose if here, if not “none”
# dist: path where created code is put
# aws acct: use profile, or register+create iam user
amplify add auth
# default: email, user, pass, sms
# auth resources created, Cognito UP console
code
# index.js App.js aws-exports.js
Thanks
Build+send email with cool solutions
Loft: Devops day and topics rest of week
Ask an architect