AWS Lambda in Action: Event-driven serverless applications by Danilo Poccia
Author:Danilo Poccia
Language: eng
Format: mobi, epub
Publisher: Manning Publications Co.
Published: 2019-01-31T23:00:00+00:00
Exercise
Add a name field to the Sign Up page and have the name stored on the DynamoDB table and in the validation email.
* * *
Tip
In Amazon DynamoDB, you need to specify only the primary key (the email in this case), and you can add different attributes in any item of the table. As a consequence, no changes in the IAM role used by the Lambda function are required.
* * *
Solution
To add a name, you need to change the HTML page (signUp.html), the client-side JavaScript file (signUp.js), and the Lambda function (createUser). A possible solution is presented in bold in the following listings, with the changes compared to the standard implementation.
signUpWithName.html (Sign Up page)
<html>
<head>
<title>Sign Up - Sample Authentication Service</title>
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.3.16.min.js"></script>
</head>
<body>
<h2>Sample Authentication Service</h2>
<h1>Sign Up</h1>
<form role="form" id="signup-form">
<div>
<label for="email">Email:</label>
<input type="email" id="email">
</div>
<div>
<label for="name">Email:</label>
<input type="text" id="name">
</div>
<div>
<label for="password">Password:</label>
<input type="password" id="password">
</div>
<div>
<label for="password">Verify Password:</label>
<input type="password" id="verify-password">
</div>
<button type="submit" id="signup-button">Sign Up</button>
</form>
<div id="result">
</div>
<a href="index.html">Back</a>
<script src="js/signUp.js"></script>
</body>
</html>
signUpWithName.js (JavaScript in the browser)
AWS.config.region = '<REGION>';
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId: '<IDENTITY_POOL_ID>'
});
Download
AWS Lambda in Action: Event-driven serverless applications by Danilo Poccia.epub
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12528)
Hello! Python by Anthony Briggs(9875)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9763)
The Mikado Method by Ola Ellnestam Daniel Brolund(9754)
Dependency Injection in .NET by Mark Seemann(9300)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8264)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7748)
Grails in Action by Glen Smith Peter Ledbrook(7673)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7523)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(6772)
Microservices with Go by Alexander Shuiskov(6541)
Practical Design Patterns for Java Developers by Miroslav Wengner(6434)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6412)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6385)
Angular Projects - Third Edition by Aristeidis Bampakos(5801)
The Art of Crafting User Stories by The Art of Crafting User Stories(5325)
NetSuite for Consultants - Second Edition by Peter Ries(5266)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5086)
Kotlin in Action by Dmitry Jemerov(5025)
