Giter Site home page Giter Site logo

danilop / aws_lambda_in_action Goto Github PK

View Code? Open in Web Editor NEW
286.0 286.0 110.0 62 KB

This source code distribution is a companion to the AWS Lambda in Action book available from Manning Publications.

Home Page: https://www.manning.com/books/aws-lambda-in-action

JavaScript 58.55% Python 2.33% HTML 31.65% Shell 7.47%

aws_lambda_in_action's People

Contributors

danilop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws_lambda_in_action's Issues

Moving IdentityPoolId server side

Is it possible to move this ID server-side?

// Initialize the Amazon Cognito credentials provider
AWS.config.region = 'XXX'; // Region
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId: 'XXX',
});
There is no security issue involved. Just that my client is not comfortable showing region and ID here.

Not able to log in

I have followed all steps mentioned in Chapter 09 and all pages are working as expected including reset password. The only problem is that I am not able to log-in. I get the message "Not logged in" even if I try to log in after resetting the password.

Chapter4 - Code doesn't work

Program fails when calling gm(response.Body);

` function transformImage(response, next) {
console.log('response object: ', util.inspect(response, {depth: 5}));

		gm(response.Body).size(function(err, size) {
			
			if (err) {
				console.error('Error transforming image: ', util.inspect(err));
				return;					
			}
			
			const metadata = response.Metadata;
			console.log('Metadata:\n', util.inspect(metadata, {depth: 5}));
			
			let maxWidth = DEFAULT_MAX_WIDTH;
			if ('width' in metadata) {
				maxWidth = metadata.width;
			}

// rest of the code
}
`

LOGS

`INFO response object: {
AcceptRanges: 'bytes',
LastModified: 2020-09-13T23:24:54.000Z,
ContentLength: 118518,
ETag: '"f9883cd7f57c3772e01fa7a06db160b7"',
ContentType: 'image/jpeg',
Metadata: {},
Body: <Buffer ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 48 00 48 00 00 ff db 00 43 00 03 02 02 03 02 02 03 03 03 03 04 03 03 04 05 08 05 05 04 04 05 0a 07 07 06 ... 118468 more bytes>
}

ERROR Error transforming image: Error: write EPIPE
at afterWriteDispatched (internal/stream_base_commons.js:154:25)
at writeGeneric (internal/stream_base_commons.js:145:3)
at Socket._writeGeneric (net.js:786:11)
at Socket._write (net.js:798:8)
at doWrite (_stream_writable.js:403:12)
at writeOrBuffer (_stream_writable.js:387:5)
at Socket.Writable.write (_stream_writable.js:318:11)
at gm._spawn (/var/task/node_modules/gm/lib/command.js:253:18)
at gm._exec (/var/task/node_modules/gm/lib/command.js:190:17)
at gm.proto. [as size] (/var/task/node_modules/gm/lib/getters.js:68:12) {
errno: 'EPIPE',
code: 'EPIPE',
syscall: 'write'
}

`

What the licence for the code

Hi Danilo
I wonder if I may use your code (specifically from chapter 9 and 10) and refactor it to use python in lamdas and publish it on github?

Chapter 10 scripts

I set up the config.json in the chapter 10 folder and ran the init.sh and deploy.sh, and it set up everything as expected. the issue is that it will not send the validation email, I get the error Message Rejected: Email address is not verified. I checked the SES and the email address that is sending the email is verified. What would I need to do to fix this?

outdated codebase

I bought the book and realized that the code base is still node 4 and node 6. Node 6 won't be supported by AWS anymore by may 2019. Are there any plans to update the code base of this repo (and the book) accordingly?

avoid cognito?

Is it possible to query the dynamoDB data directly without using "cognito"?
I am asking this because there seems to be no way to back-up Cognito identity. How do I backup or transfer identities from one account to another?

Browser issue

I change password, then if I click on "back" and try to log-in, log-in fails. It works only after refreshing the browser. This is obviously a browser glitch. But I am raising an issue here for those who may face the same problem.

Chapter 11 - cannot install

Cannot install the program in the chapter 11 by running deploy script.

It contains aws lambda update function - but where is the create function? Such function should be run first.

Not able to change password

I tried Chapter 09 code and everything worked as expected. But I could not change password.
On the changePassword.html page, I get a message that user has logged in and then "Password not changed" message - instead of "Password changed".

ch7 - Simple Website - bug fixes

This is for the book.
You need to mention that in the API gateway, not only do you need to change the 'Integration Response' 200 body to 'text/html' , but you also need to change the 'Method Response' 200 body to 'text/html' , otherwise, it will render as JSON in your browser.

Also, your ejs code does not handle the extra /page/ URL path, so when you go to your <aws.com>// URL api, it will load your href links as <aws.com>//page-one and you will receive an error. Your EJS code doesn't know anything about the /page/ api. In the current state, the only way to get to your page-one, page-two, page-three URLs, is to manually put it into your browser as: <aws.com>//page/page-one, etc .

I fixed this by deleting the /page/{page}/get resource and recreated it as /{page} . This will allow for the proper redirects to the sub URLs in the website. One more minor lesson learned: <aws.com>// <--- make sure you put the trailing slash </> at the end. Otherwise the sub URLs will not load properly. This problem would go away if you redirected the API call to your real websites DNS.

Just an FYI for anyone else running into an issue. Thanks for the book!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.