Giter Site home page Giter Site logo

aws-samples / aws-serverless-workshops Goto Github PK

View Code? Open in Web Editor NEW
4.1K 4.1K 2.6K 195.27 MB

Code and walkthrough labs to set up serverless applications for Wild Rydes workshops

Home Page: http://wildrydes.com

License: Apache License 2.0

HTML 1.03% JavaScript 89.95% CSS 2.03% Python 0.20% TypeScript 0.74% Go 0.06% Shell 0.05% Jupyter Notebook 0.54% SCSS 5.40%
aws lambda serverless tutorial

aws-serverless-workshops's Introduction

These workshops have been deprecated. For current serverless workshops, please visit: https://serverlessland.com/learn?type=Workshops


Wild Rydes Serverless Workshops

This repository contains a collection of workshops and other hands on content that will guide you through building various serverless applications using AWS Lambda, Amazon API Gateway, Amazon DynamoDB, AWS Step Functions, Amazon Kinesis, and other services.

Workshops

  • Web Application - This workshop shows you how to build a dynamic, serverless web application. You'll learn how to host static web resources with Amazon S3, how to use Amazon Cognito to manage users and authentication, and how to build a RESTful API for backend processing using Amazon API Gateway, AWS Lambda and Amazon DynamoDB.

  • Auth - This workshop shows you how to build in security at multiple layers of your application, starting with sign-up and sign-in functionality for your application, how to secure serverless microservices, and how to leverage AWS's identity and access management (IAM) to provide fine-grained access control to your application's users. You'll learn how AWS Amplify integrates with Amazon Cognito, Amazon API Gateway, AWS Lambda, and IAM to provide an integrated authentication and authorization experience.

  • Data Processing - This workshop demonstrates how to collect, store, and process data with a serverless application. In this workshop you'll learn how to build real-time streaming applications using Amazon Kinesis Data Streams and Amazon Kinesis Data Analytics, how to archive data streams using Amazon Kinesis Data Firehose and Amazon S3, and how to run ad-hoc queries on those files using Amazon Athena.

  • DevOps - In this workshop, you will learn how to start a new Serverless application from scratch using the Serverless Application Model (SAM) and how to fully automate builds and deployments by building a continous delivery pipeline using AWS CodeCommit, AWS CodeBuild and AWS CodePipeline. You will also learn how to test a Serverless application locally using the SAM CLI.

  • Image Processing - This module shows you how to build a serverless image processing application using workflow orchestration in the backend. You'll learn the basics of using AWS Step Functions to orchestrate multiple AWS Lambda functions while leveraging the deep learning-based facial recognition features of Amazon Rekogntion.

  • Multi Region - This workshop shows you how to build a serverless ticketing system that is replicated across two regions and provides automatic failover in the event of a disaster. You will learn the basics of deploying AWS Lambda functions, exposing them via API Gateway, and configuring replication using Route53 and DynamoDB streams.

  • Security - This workshop shows you techniques to secure a serverless application built with AWS Lambda, Amazon API Gateway and RDS Aurora. We will cover AWS services and features you can leverage to improve the security of a serverless applications in 5 domains: identity & access management, infrastructure, data, code, and logging & monitoring.

  • Machine Learning - This workshop shows you how to collect, process, and join disparate data sources using AWS Lambda and Amazon Athena. This data can be used to train a machine learning model using Amazon SageMaker. With the trained model hosted on Amazon S3, you will build a serverless API using Amazon API Gateway and AWS Lambda to predict the probability that a unicorn will request service after completing a ride.

  • Decoupled Microservices - This workshop demonstrates the use of asynchronous messaging patterns to build micro-services based architecture. It applies the well known enterprise integration patterns using AWS services like SQS and SNS to implement various use cases for wild rydes business. All the labs are self contained and users can choose to go on their own adventure based on their requirements.

  • Document Processing - This workshop demonstrates the use of AWS Lambda and Amazon Textract to extract text and data from large scale documents. It shows both asynchronous and synchronous architectural patterns to build an efficient document processing engine.

  • Go Serverless - In this workshop, you will learn by using Go and the AWS Serverless Application Model (SAM), how to create a simple web service using AWS Lambda functions. It will also cover testing and debugging your web service locally with SAM monitoring and also troubleshooting your web service with distributed tracing using AWS X-Ray.

  • Application Catalog - In this workshop, we will explore some of the ways you can implement a CI/CD pipeline on AWS for Serverless workloads in a standardized way across an entire organization, allowing Software Engineers to develop and test Serverless workloads as they would in a more traditional environment while DevOps teams can focus on building one single pipeline that satisfies multiple environments and can be distributed as a “product” across multiple development teams.

  • Event Driven Architecture - In this workshop we’ll cover the basics of event-driven design, using examples that involve Amazon EventBridge, Amazon SNS, Amazon SQS, AWS Lambda and more. You will learn how to choose the right AWS service for the job, as well as how to optimize for both cost and performance. Through hands on practice, this workshop will give you the skills bring event-driven design patterns into your own applications.

  • Innovator Island - Innovator Island is a popular theme park that’s rolling out a mobile app for thousands of visitors. The app provides wait times, photo opportunities, notification alerts, and language translation for visitors who need it. However, the lead developer has disappeared, and in this workshop, you’re part of a development team that’s assembling the pieces left behind. Learn and practice building a scalable serverless web app with limited development resources.

  • Serverlespresso - Serverlesspresso is a pop-up coffee shop that provides premium espresso drinks at conferences and events. The organizers have brought an elite team of the world’s best baristas to brew 1,000 drinks a day for customers. Your job today is to help build a serverless application to help them accept orders and notify customers when their drinks are ready. You must build a robust solution that scales to meet demand, handles the workflow of individual drinks, and authenticates the coffee drinkers. The coffee bar opens in 2 hours! Good luck!

Third Party Workshops

The following workshops are created and maintained by third parties and explore a variety of other topics and tools related to serverless development on AWS.

  • HERE Geocoding and Routing Extensions - These extensions to the Web Application and Data Processing workshops walk through how to enhance the base applications with geocoding and advanced routing features. You'll see how to launch applications from the AWS Serverless Application Repository and integrate these components into the existing architectures. You'll need to complete the primary Web Application or Data Processing workshop from this repository before starting the extensions.

aws-serverless-workshops's People

Contributors

aidinkhosrowshahi avatar alexcasalboni avatar angelarw avatar atomicaws avatar bls20aws avatar bugmang avatar chriscoombs avatar dependabot[bot] avatar doug-aws avatar gadams999 avatar homingli avatar jmcwhirter avatar jpignata avatar justonian avatar kylesomers avatar mcvader avatar michaeldclifford avatar mikedeck avatar mreferre avatar okaram avatar payalsin avatar rnzsgh avatar rts-rob avatar samdengler avatar sapessi avatar schallis avatar singledigit avatar sliedig avatar teknogeek0 avatar timothy-baker 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  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

aws-serverless-workshops's Issues

An error occurred when requesting your unicorn: Undefined

I have followed the tutorial step by step as well as looking at other problems similar however I cannot resolve the following error:

jquery-3.1.0.js:9392 OPTIONS https://sgx7hadawf.execute-api.ap-southeast-2.amazonaws.com/prod/ride 0 ()
send @ jquery-3.1.0.js:9392
ajax @ jquery-3.1.0.js:8999
requestUnicorn @ ride.js:19
handleRequestClick @ ride.js:87
dispatch @ jquery-3.1.0.js:5110
elemData.handle @ jquery-3.1.0.js:4918
ride.js:34 Error requesting ride: error , Details:
ajaxError @ ride.js:34
fire @ jquery-3.1.0.js:3243
fireWith @ jquery-3.1.0.js:3373
done @ jquery-3.1.0.js:9100
(anonymous) @ jquery-3.1.0.js:9332
error (async)
send @ jquery-3.1.0.js:9360
ajax @ jquery-3.1.0.js:8999
requestUnicorn @ ride.js:19
handleRequestClick @ ride.js:87
dispatch @ jquery-3.1.0.js:5110
elemData.handle @ jquery-3.1.0.js:4918
ride.js:35 Response: undefined
ajaxError @ ride.js:35
fire @ jquery-3.1.0.js:3243
fireWith @ jquery-3.1.0.js:3373
done @ jquery-3.1.0.js:9100
(anonymous) @ jquery-3.1.0.js:9332
error (async)
send @ jquery-3.1.0.js:9360
ajax @ jquery-3.1.0.js:8999
requestUnicorn @ ride.js:19
handleRequestClick @ ride.js:87
dispatch @ jquery-3.1.0.js:5110
elemData.handle @ jquery-3.1.0.js:4918

Missing "Save Changes" in Module 2, Step 2

In Module 2, Step 2 of the WildRydes app, it ends with Step 6 that tells you to make note of the App Client ID. I believe there should be a Step 7 where you click the Save Changes button.

Response field "RideId" should be "RidesId"

Error returned by Lambda console test is

{
  "statusCode": 500,
  "body": "{\"Error\":\"One or more parameter values were invalid: Missing the key RidesId in the item\",\"Reference\":\"049727f3-6456-11e8-b9eb-bbef4e5da3e8\"}",
  "headers": {
    "Access-Control-Allow-Origin": "*"
  }
}

Test is:

{
  "path": "/ride",
  "httpMethod": "POST",
  "headers": {
    "Accept": "*/*",
    "Authorization": "eyJraWQiOiJLTzRVMWZs",
    "content-type": "application/json; charset=UTF-8"
  },
  "queryStringParameters": null,
  "pathParameters": null,
  "requestContext": {
    "authorizer": {
      "claims": {
        "cognito:username": "the_username"
      }
    }
  },
  "body": "{\"PickupLocation\":{\"Latitude\":47.6174755835663,\"Longitude\":-122.28837066650185}}"
}

The test passes after changing RideId to RidesId on lines 59 and 92 of index.js (i.e. the lambda function). Not sure if it's the test or the scrip that needs to change.

Image disagrees with text in /DevOps/2_ContinuousDeliveryPipeline/README.md

The image /DevOps/2_ContinuousDeliveryPipeline/images/codepipeline-add-2.png should be corrected to have its Template input value changed from:
MyAppBuild::output.yaml to: MyAppBuild::app-sam-output.yaml to agree with the text that says:
"Enter MyAppBuild::app-sam-output.yaml for Template".

I missed that step.

DataProcessing workshop requires updates for console changes

In the module aws-serverless-workshops/DataProcessing/1_FileProcessing,
the instructions for creating IAM role do not correspond to updated IAM Console appearance.

The text is in the section
https://github.com/awslabs/aws-serverless-workshops/blob/master/DataProcessing/1_FileProcessing/README.md#3-create-an-iam-role-for-your-lambda-function

Also, the Lambda function console is slightly different than instructions https://github.com/awslabs/aws-serverless-workshops/blob/master/DataProcessing/1_FileProcessing/README.md#4-create-a-lambda-function-for-processing

Not able to register user

After updating config.js with cognito details and trying to register a user from the web page, there is no pop up and the user is not created.

Document map processing in Data Processing workshop

Please provide instructions, hints or suggestions of how to plot latitude and longitude on a map in the Data Processing workshop.

In the Extra Credit section of the "Module 5: Data Archiving" instructions of the DataProcessing workshop it is stated (emphasis mine):

Write a query for the latitude and longitude point pairs a unicorn traveled on a trip and plot them on a map to see the unicorn's path.

The Athena query creation is pretty straight forward (basically modify the provided query), but there is nothing in this lab that suggest how the result can be plotted on a map.

Potential unresolved issues with the Web Application workshop

We saw a couple of issues with the Web Application workshop that might need to be addressed:

  • The Esri map would not render in certain, older versions of Chrome (~51) on Windows. This seems to be a bug that was fixed. To address, we should be prescriptive about which versions of Firefox and Chrome can be used for this workshop.
  • We had several participants who experienced timeouts through the API Gateway endpoint to the Lambda function. I personally experienced this myself running through the workshop. For these cases we saw the functions timing out in CloudWatch Logs. In each case we increased the timeout above the default 3 seconds and the participants were able to proceed. I'm baffled as to why this was happening as the function does very little and usually executes within 100ms. There was very shoddy connectivity during the workshop, so one possibility that crossed my mind is that slow HTTP readers cause the Lambda function to run longer than they should, but this works against my understanding of how the API Gateway and Lambda integration works and I can't reproduce it artificially. To address, we should try to suss out what was happening here and create an instructors guide in the repo with common potential pitfalls like this if necessary.
  • Many participants' directions were not collapsed due to their browser not supporting those markup tags. To address, we should be prescriptive about which versions of Firefox and Chrome can be used for this workshop.
  • Some participants do not understand that they could expand the step-by-step directions and get stuck. To address, we should make the structure and directions clear in the presentation element of the workshop.
  • Many participants used the CloudFormation template because they thought it was the first step but actually wanted to go through the steps. To address, we should be very clear that this is just a potential bypass for the module. Potentially we could move this section to the bottom of the directions and link to it from the top.
  • As usual, the CLI setup was somewhat challenging and consumed the first 30 minutes of the workshop for a large number of participants. To address, we should put together a preliminary lab that includes installing and testing the CLI with appropriate credentials.

DevOps Module 4 IAM Policy Change KO in visual editor

https://github.com/aws-samples/aws-serverless-workshops/tree/master/DevOps/4_MultipleEnvironments#user-content-1c-update-codestarworkercodepipelinerolepolicy-iam-policy

1c. Update CodeStarWorkerCodePipelineRolePolicy IAM Policy
Step 2 : Update the allowed CloudFormation Resource pattern

Before: arn:aws:cloudformation:{region}:{accountId}:stack/awscodestar-uni-api-lambda/*

After: arn:aws:cloudformation:{region}:{accountId}:stack/awscodestar-uni-api-lambda*

This change does not work in the visual editor

image

Unable to locate credentials?

Hi,

When I attempt to execute the awscli command to upload the website assets to my S3 bucket I get the following error:

Fatal error: Unable to locate credentials

I have replaces the default bucket name & bucket region with my own.

Can you please advise? Thanks

Error when testing Lambda function - access to DynamoDB denied

Hi. Wondering if anyone can help me with this. I've set up my DynamoDB table, IAM role & lambda function as per module 3, but when I am testing, i'm getting an error: AccessDeniedException: User: arn:aws:sts::515605477066:assumed-role/WildRydesLambda/RequestUnicorn is not authorized to perform: dynamodb:PutItem on resource: arn:aws:dynamodb:eu-west-2:515605477066:table/Rides

The test action i'm using is as follows:

{
    "path": "/ride",
    "httpMethod": "POST",
    "headers": {
        "Accept": "*/*",
        "Authorization": "eyJraWQiOiJLTzRVMWZs",
        "content-type": "application/json; charset=UTF-8"
    },
    "queryStringParameters": null,
    "pathParameters": null,
    "requestContext": {
        "authorizer": {
            "claims": {
                "cognito:username": "the_username"
            }
        }
    },
    "body": "{\"PickupLocation\":{\"Latitude\":47.6174755835663,\"Longitude\":-122.28837066650185}}"
}

I have some questions about this, the Authorization header and cognito:username fields, should these be set to anything in particular? I'm just leaving it as it is, is this some special setup for testing that will work for everybody or do i have to change it to a particular value for my instance?

Log output from the failing test:

START RequestId: 01a2a113-93dd-11e7-83e5-19f3f6eea54c Version: $LATEST
2017-09-07T14:58:29.181Z	01a2a113-93dd-11e7-83e5-19f3f6eea54c	Received event ( 8b5EQSyDkCFGp9ILZFk2wg ):  { path: '/ride',
  httpMethod: 'POST',
  headers: 
   { Accept: '*/*',
     Authorization: 'eyJraWQiOiJLTzRVMWZs',
     'content-type': 'application/json; charset=UTF-8' },
  queryStringParameters: null,
  pathParameters: null,
  requestContext: { authorizer: { claims: [Object] } },
  body: '{"PickupLocation":{"Latitude":47.6174755835663,"Longitude":-122.28837066650185}}' }
2017-09-07T14:58:29.252Z	01a2a113-93dd-11e7-83e5-19f3f6eea54c	Finding unicorn for  47.6174755835663 ,  -122.28837066650185
2017-09-07T14:58:30.312Z	01a2a113-93dd-11e7-83e5-19f3f6eea54c	{ AccessDeniedException: User: arn:aws:sts::515605477066:assumed-role/WildRydesLambda/RequestUnicorn is not authorized to perform: dynamodb:PutItem on resource: arn:aws:dynamodb:eu-west-2:515605477066:table/Rides
    at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:48:27)
    at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
  message: 'User: arn:aws:sts::515605477066:assumed-role/WildRydesLambda/RequestUnicorn is not authorized to perform: dynamodb:PutItem on resource: arn:aws:dynamodb:eu-west-2:515605477066:table/Rides',
  code: 'AccessDeniedException',
  time: 2017-09-07T14:58:30.274Z,
  requestId: 'L82F6F37UM162SMU2K80ILNC8VVV4KQNSO5AEMVJF66Q9ASUAAJG',
  statusCode: 400,
  retryable: false,
  retryDelay: 1.7480077488618573 }
END RequestId: 01a2a113-93dd-11e7-83e5-19f3f6eea54c
REPORT RequestId: 01a2a113-93dd-11e7-83e5-19f3f6eea54c	Duration: 1213.33 ms	Billed Duration: 1300 ms 	Memory Size: 128 MB	Max Memory Used: 37 MB	

Cheers!

Minor: inconsistency in Lambda name between module 3 and 4

In module 3, the suggested Lambda name is "RequestUnicorn", and then in module 4 it says to use the "RequestRide" lambda you created in the previous module.

Since the API Gateway /ride Resource Action setup doesn't provide a dropdown of options, but has you type in your Lambda name, it would be nice if the names in the instructions were consistent.

Thanks.

Error on signup page

Hi,

I'm getting error on signup page "There is no user pool configured in /js/config.js. You'll configure this in Module 2 of the workshop" even after making changes(Module 2) in /js/config.js .
Strange thing is the changes are reflected in bucket /js/config.js file but on signup page i see error.

IAM Role needed dynamodb:BatchWriteItem not PutItem

I was working on the data processing where I ran into what I believe is an error in the documentation. I had to use the BatchWriteItem permission not the PutItem permission. AWS Lambda was throwing permission errors. Here is what finally worked for me..

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt1502216829000",
            "Effect": "Allow",
            "Action": [
                "dynamodb:BatchWriteItem"
            ],
            "Resource": [
                "arn:aws:dynamodb:us-east-1:<id>:table/UnicornSensorData"
            ]
        },
        {
            "Sid": "Stmt1502216880000",
            "Effect": "Allow",
            "Action": [
                "s3:GetObject"
            ],
            "Resource": [
                "arn:aws:s3:::wildrydes-uploads-mattorahood/*"
            ]
        }
    ]
}

Bucket Doesn't Exist - S3 JSON File

Issue, the S3 Bucket doesn't exist when you try to upload the JSON File.

This XML file does not appear to have any style information associated with it. The document tree is shown below.

NoSuchBucket
The specified bucket does not exist
wildrydes-data-processing
7FCB9F89ED40FEFA

FWJtls3V6qcoOIvaB2bB0/yoN+5lB1527Fc7s5tRpLpea9nZ1JxGCTOFGsbRp9JbfQdjqe8tgsw=

s3://wildrydes-data-processing/data/shadowfax-2016-02-12.json

As a workaround, had the partner download this file directly. https://github.com/aws-samples/aws-serverless-workshops/blob/master/DataProcessing/1_FileProcessing/data/shadowfax-2016-02-12.json from github and upload this to the S3 bucket.
Issue, the S3 Bucket doesn't exist when you try to upload the JSON File. You should download this file https://github.com/aws-samples/aws-serverless-workshops/blob/master/DataProcessing/1_FileProcessing/data/shadowfax-2016-02-12.json from github and upload this to the S3 bucket.

Problem with external font JS

We ran into several times is related to the code below. This library needs some sort of registration of source domains (cloudfront.net and/or the s3 static domain) or it fails for some (I hit two cases on Windows).

I do not have an Adobe account or I would patch myself.

<script src="https://use.typekit.net/dmq4txp.js"></script>
<script>try{Typekit.load({ async: true });}catch(e){}</script>

Make WorkshopTemplate and documentation more robust

A few notes about changes I'd like to make around the template when time permits:

  • Standardize on format of module documentation
    • Introduction
    • Implementation Instructions
    • Implementation Validation
    • Extra Credit
  • Create a skeletal set of template files that can be cloned to begin module development
  • Create a gulp task that accepts a workshop name and sets up the file structure and related templates
  • Either we should create a pre-lab or strike references to it

error in DataProcessing workshop

Hello,

The Function WildRydesFileProcessor is failing at event.Records.map() call.

Cannot read property 'map' of undefined.

I have submitted the following input as test

{"Name":"Shadowfax","StatusTime":"2016-02-12 00:00:00.000","Distance":1317,"MinMagicPoints":146,"MaxMagicPoints":149,"MinHealthPoints":144,"MaxHealthPoints":149}

and

{
"Records": [
{"Name":"Shadowfax","StatusTime":"2016-02-12 00:00:00.000","Distance":1317,"MinMagicPoints":146,"MaxMagicPoints":149,"MinHealthPoints":144,"MaxHealthPoints":149}
]
}

thanks for helping.

Step 65 - lambda function trigger "invocation error"

I am getting on the lambda function: Batch size: 1Last result: PROBLEM: Function call failed

I think without a Node "console", debugging gets tricky - will be nice to have some kind of console to help debug as a feature in AWS Lambda.

Regardless, any idea if the Node function having some problem, or somewhere else?

WildRydes maps crashed in OSX Sierra

This is a bug report on WebApplication, 4_RESTfulAPIs section.

In Section 4_RESTfulAPIs of the WebApplication workshop the final application crashes when the users loads the ride.html page after a success authentication.

In the last step of Secton 4_RESTfulAPIs :

Implementation Validation

Visit /ride.html under your website domain.

When the page renders in a Mac installation, the page crashed and as the result, the map and users data are not displayed on the right side of the control widget. (see attached images)

When I open the debugger there is a javascript exception and as follows:

init.js:1797 Uncaught TypeError: Cannot read property 'getParameter' of null
    at new a (init.js:1797)
    at l.attach (MapView.js:305)
    at c.e.attachChild (MapView.js:294)
    at c.k.attachChildren (MapView.js:301)
    at c.k.render (MapView.js:297)
    at c.e.render (MapView.js:293)
    at c.renderFrame (MapView.js:292)
    at Object.render (MapView.js:290)
    at h._animationFrame (init.js:332)

Here are some screenshots of the crash:

Website screenshot at time of crash

Stack trace

Chrome version file

Here is some hardware information

MacBook Pro
Processor 2.3 GHz Intel Core i5
Memory 8 GB 1333 MHz DDR3
Graphics Intel HD Graphics 3000 512 MB

Software

OSX Sierra version 10.12.6

Browser

Google Chrome 60.0.3112.113 (attached version text file)

an error occured when requesting your unicorn:undefined

Hi
I have a problem at very last stage for the webapplication, which is the error message after i click on map then request unicorn, an message occured: an error occured when requesting your unicorn:undefined

I am new with AWS, so I actually went through the whole process twice, just to make sure every step is right,but both end with same error message, so have to come here seek help.
any idea what could be wrong ?

many thanks

Can't execute Lambda function

When executing the Lambda function for subscribing an email, I receive the following error
{
"errorMessage": "RequestId: ffff-ffffff-fffffffffffffff Process exited before completing request"
}

TypeError: Cannot read property 'forEach' of undefined
at exports.handler.event.Records.forEach (/var/task/index.js:5:16)

Web security vulnerability- WebApplication's configure.js's cognito pool information exposed to the public

Hi:
Thanks for releasing this tutorial about serverless web application. I am big fun of AWS serverless stack.

I noticed the attributes such as cognito user pool id , pool client id and region are exposed to public through configure.js. This is could be very serious web security issue. Those information should be hidden into lamba code side. The user registration, verification and login , this tutorial is built on client javascript's talking with cognito directly, which might not be the best design. Those events should be migrated to Lambda side.

capture

DevOps/0_CodeStar README.md Should Be Prescriptive About Regions to Use

The existing README.md shows that CodeStar can be launched in several regions but the CloudFormation template referenced in https://github.com/awslabs/aws-serverless-workshops/tree/master/DevOps/1_ServerlessApplicationModel#2-seed-the-uni-api-codecommit-git-repository only allows for us-east-1 and us-west-1.

The README in DevOps/0_CodeStar should state that while CodeStar is available in other regions only us-east-1 and us-west-1 should be used for the purpose of this lab.

Set bucket name to all lowercase in Module 1

When launching the CloudFormation template for Module 1, if the user has capital letters in the bucket name the deployment fails. Please update the CF template to force the bucket name parameter to all lowercase.

Needed to execute template.yml file twice to get changes into API Gateway

@samdengler , thanks for the help you provided me today during the workshop at the AWS conference. I was going through the DevOps workshop, and I noticed something unexpected that suggested the possibility of a bug. While working through the "API Enhancement" section of:
DevOps/2_ContinuousDeliveryPipeline
after I pushed my changes via git into the remote origin and confirmed that the source, build, and deploy steps ran and completed successfully in CodeStar and confirmed in the pipeline history that the changes to the template.yml file were indeed included in the deployment, when I checked API Gateway and refreshed the page, the PUT action was still missing from /unicorns/{name}. (The GET action for that path was created, however.)
I wasn't sure how to get the deployment to re-run the template file, so I changed the template.yml file by removing a newline character from the very end of the file. I then pushed this change into origin, and after the CodeStar pipeline completed the deployment task, to my great surprise, in API Gateway, the PUT action had miraculously been created as expected.

Is there a reason I needed to execute the task twice to get the changes to propagate? I'm wondering if I experienced another known issue. Any ideas?

DevOps Module 2 returns an empty array

I finished module 1 last night, without problems. I started Module 2 up to, but not including the "test" phase.

This morning, when I try the test phase, I get no unicorns. The table is empty, even though I have "updated" it to include Shadowfox (with a 200 status). Looking at the table (it's the only table on my account), the storage capacity is zero. There were no errors AFAICS, so this seems to be broken

how to use a non default profile

➜ ./producer -region us-east-1
NoCredentialProviders: no valid providers in chain. Deprecated.
	For verbose messaging see aws.Config.CredentialsChainVerboseErrors

Spelling mistake in 3_ServerlessBackend

3_ServerlessBackend
3. Create a Lambda Function for Handling Requests -> Step-by-step instructions (expand for details) ->
9. Scroll down to the Function code section and replace the exiting code in the index.js code editor

says exiting instead of existing

Step 4 in the Implementation instructions contains a typo

In the step four, there is stated that one can reach the static assets at: <bucket-name>.s3-website-<AWS-region>.amazonaws.com

That is incorrect since the AWS-region should be . delimited from the s3-website as follows :

<bucket-name>.s3-website.<AWS-region>.amazonaws.com

Lint errors

There are a significant number of eslint errors and warnings (896 and 58 respectively) in the workshops merged in recently. We should conform these examples to the standards outlined in the estlint config in the root or override settings for these modules to conform to a different standard.

cc: @samdengler @angelarw @mikedeck

No Unicorn Icon?

So, everything seems to work fine, but I can't get a unicorn icon to fly to my location for pickup...

JSON not writing to ddb table - access denied

I am working (and having issues) with the Data Processing Workshop. I am in Module 1 : Data Processing. Please let me know if this is not the correct forum for a question like this.

When I load the json file to my S3 bucket, the Lambda function is being invoked, but with an error. The JSON entries never show up in my table. I am stuck... i have created and recreated. I am a newbie, but I did try everything I could think of before requesting assistance. :)

Lambda error message (from CloudWatch)
2017-12-23T21:02:53.820Z a3639ae8-e824-11e7-a442-2f62625222a6
{ "errorMessage": "Access Denied", "errorType": "AccessDenied", "stackTrace": [ "Request.extractError (/var/runtime/node_modules/aws-sdk/lib/services/s3.js:577:35)", "Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:105:20)", "Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:77:10)", "Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:683:14)", "Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)", "AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)", "/var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10", "Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)", "Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:685:12)", "Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:115:18)" ] }

I checked the IAM access advisor usage and my Dynamo BatchWriteItem permission is never being granted / accessed.

This is somehow most likely related to the issues I am having. When I create the IAM role, and the associated policy for the DynamoDB BatchWriteItem, I keep getting warnings when I define the resource for the BatchWriteItem. When I create it, I add the ARN for the DynamoDB Table, but then when I go back in and look at the configuration via the Edit Policy button in the console, I see the warnings. My ARN shows up for 'Resources, but not for the newly added table section. I then add the ARN to the table, but it gets removed after saving and then check it out again.

complete JSON Policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"dynamodb:BatchWriteItem"
],
"Resource": [
"arn:aws:s3:::/wildrydes-uploads-tim-armstrong/*",
"arn:aws:dynamodb:us-east-1:289247328022:table/UnicornSensorData"
]
}
]
}

Final Test Not Working

Hello,

I went throught the entire workshop step by step and at the end when requesting a unicorn, i get an error of. Are there any ways to debug this?
image

Validating Lambda function gives me error

I get error message

{
"statusCode": 500,
"body": "{"Error":"One or more parameter values were invalid: Missing the key RideID in the item","Reference":"a05123a5-522c-11e7-86dd-9bc16202cf58"}",
"headers": {
"Access-Control-Allow-Origin": "*"
}
}

Lambda log output says

START RequestId: a05123a5-522c-11e7-86dd-9bc16202cf58 Version: $LATEST
2017-06-16T00:42:08.041Z a05123a5-522c-11e7-86dd-9bc16202cf58 Received event ( ci75T980Y1zFRSlRPW3PXA ): { path: '/ride',
httpMethod: 'POST',
headers:
{ Accept: '/',
Authorization: 'eyJraWQiOiJLTzRVMWZs',
'content-type': 'application/json; charset=UTF-8' },
queryStringParameters: null,
pathParameters: null,
requestContext: { authorizer: { claims: [Object] } },
body: '{"PickupLocation":{"Latitude":47.6174755835663,"Longitude":-122.28837066650185}}' }
2017-06-16T00:42:08.041Z a05123a5-522c-11e7-86dd-9bc16202cf58 Finding unicorn for 47.6174755835663 , -122.28837066650185
2017-06-16T00:42:08.242Z a05123a5-522c-11e7-86dd-9bc16202cf58 { ValidationException: One or more parameter values were invalid: Missing the key RideID in the item
at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:48:27)
at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:678:14)
at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)
at Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:680:12)
at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
message: 'One or more parameter values were invalid: Missing the key RideID in the item',
code: 'ValidationException',
time: 2017-06-16T00:42:08.242Z,
requestId: '3H734FLH2T7OT5KNPUQ8PJEITRVV4KQNSO5AEMVJF66Q9ASUAAJG',
statusCode: 400,
retryable: false,
retryDelay: 32.63472032648866 }
END RequestId: a05123a5-522c-11e7-86dd-9bc16202cf58
REPORT RequestId: a05123a5-522c-11e7-86dd-9bc16202cf58 Duration: 252.40 ms Billed Duration: 300 ms Memory Size: 128 MB Max Memory Used: 34 MB

S3 WebSite Endpoint incorrect for US-EAST-1

For the Web Application (WildRydes):

#In module 1, Under Architecture, the listed endpoint is incorrect for US-EAST-1:
http://{your-bucket-name}.s3-website.{region}.amazonaws.com

It should be a - (dash) in between s3-website and {region}

Better feedback please

Invalid HTTP methods in SAM template are not reported in error messages.

Build should break

master.zip not in sync

The instructions for Static website mentions downloading master.zip file and uploading it to S3. There is a big different between the files in repo and the zip file. Please update the zip file or change the instructions.

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.