Coder Social home page Coder Social logo

aws-samples / aws-serverless-workshop-innovator-island Goto Github PK

View Code? Open in Web Editor NEW
552.0 36.0 224.0 33.61 MB

Welcome to the Innovator Island serverless workshop! This repo contains all the instructions and code you need to complete the workshop.

License: MIT No Attribution

Shell 31.47% JavaScript 63.24% Python 5.29%
aws lambda serverless apigateway sam webapplication vuejs workshop

aws-serverless-workshop-innovator-island's Introduction

Welcome to the Innovator Island workshop!

InnovatorIsland

For workshop instructions, visit AWS Workshop Studio

Have an idea for this workshop? Found a bug?

If you have an idea for a module or feature in this workshop, or you have found a bug or need to report a problem, let us know!

Contact the author @jbesw for any additional help or support requests.

aws-serverless-workshop-innovator-island's People

Contributors

alan-churley avatar alandooz avatar amazon-auto avatar bastleblanc avatar bmcnamar-amazon avatar cornelcroi avatar enmudine avatar gaeshi avatar guikcd avatar heyparkerj avatar jbesw avatar julianwood avatar kevinremhof avatar machafer avatar singledigit avatar sthulb avatar teknogeek0 avatar vfulco avatar wagneraw 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

aws-serverless-workshop-innovator-island's Issues

The base layer for theme-park-photos-chromakey lambda function in eu-central-1 is missing cv2 dependency

Hello,
I'm following the current edition of AWS Serverless Innovator Island Workshops.

I have been following the steps described in Module 3 Subsection 1 of the workshops (as defined here: https://github.com/aws-samples/aws-serverless-workshop-innovator-island/blob/master/3-photos/1-chromakey/README.md).

However, it seems that the base layer for theme-park-photos-chromakey lambda function (as defined here: https://github.com/aws-samples/aws-serverless-workshop-innovator-island/blob/master/3-photos/1-chromakey/README.md in eu-central-1 - arn:aws:lambda:eu-central-1:678705476278:layer:Chromakey:1) is missing the cv2 dependency.

Sending a test event of:

{
  "Records": [
      {
          "s3": {
              "bucket": {
                  "name": "theme-park-backend-uploadbucket-1hnjnkn2kab67"
              },
              "object": {
                  "key": "green-screen-test.png"
              }
          }
      }
    ]
}

Results in following execution result:

{
  "errorMessage": "Unable to import module 'lambda_function': No module named 'cv2'",
  "errorType": "Runtime.ImportModuleError"
}
START RequestId: d0fcfed7-9a4c-4201-9f31-669fd1b82e70 Version: $LATEST
[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'cv2'END RequestId: d0fcfed7-9a4c-4201-9f31-669fd1b82e70
REPORT RequestId: d0fcfed7-9a4c-4201-9f31-669fd1b82e70	Duration: 2.05 ms	Billed Duration: 100 ms	Memory Size: 3008 MB	Max Memory Used: 53 MB	Init Duration: 119.05 ms	

Is this something you could verify?

Everything runs without error but .jpg file has error

In Module #3: section 2...

When running the final test of this module, the .jpg won't open and gives 'error could not load image "green-screen-test.jpg" Error interpreting JPEG image file (not a jpeg file: starts with 0x89 0x50)'.

Please advise. Thanks.

After creating the photo composting Lambda function and uploading image with same filename, the Lambda is not triggered

Describe the bug
After creating the photo composting Lambda function and uploading image with same filename as used to test the Chromakey Lambda function, the new composting Lambda is not triggered.

Link to workshop URL
https://www.eventbox.dev/published/lesson/innovator-island/3-photos/2-backend/2-compositing.html#step-by-step-instructions-2

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://www.eventbox.dev/published/lesson/innovator-island/3-photos/2-backend/2-compositing.html#step-by-step-instructions-2
  2. After completing Step 4 ("Copy the local testing image to your upload bucket.")
  3. In AWS Console open S3 bucket 'theme-park-backend-finalbucket'
  4. Observe that the image is not present.
  5. In AWS Console open the Lambda function, and Monitor tab
  6. Observe that the Lambda was not triggered.

Expected behavior
The composting Lambda is triggered and an image is present in the finalbucket.

Desktop (please complete the following information):
Any

Smartphone (please complete the following information):
Any

Additional context
Deleting the image used in the first Lambda test from the upload bucket, then re-uploading, resolves the issue.

In QuickSight 'ride rating' visualisation, setting colour rating aggregation to 'Average' isn't possible

Describe the bug
In 'Building visualizations #4' (the tree map), aggregating rider rating by average isn't possible

Link to workshop URL
https://www.eventbox.dev/published/lesson/innovator-island/5-parkstats/3-quicksight/4-visual.html#step-by-step-instructions

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://www.eventbox.dev/published/lesson/innovator-island/5-parkstats/3-quicksight/4-visual.html#step-by-step-instructions
  2. Follow instructions 1-9 to create the visual
  3. In step 10, "Click the dropdown arrow next to the rating field in the well, select the Aggregate sub-menu and choose Average"
  4. Observe that the only available options are 'Count' or 'Count distinct'.

Expected behavior
'Average' should be an option for rating aggregation.

Screenshots
image

Desktop (please complete the following information):

  • Windows 10

Smartphone (please complete the following information):

  • Firefox 88.0

Additional context
N/A

00-cleanup missing S3, ride-times stack

Hey, just cleaning up after a great workshop last week and I noticed that the upload, processing, etc buckets need to be emptied before the associated Cloudformation stacks will delete. Also there was a stack that didn't have the "theme-park-" naming convention: ride-times.

Points on map entry data abnormality

Describe the bug
When following the steps and applying the entry event filter, data is isolated only to a small part of the south of the USA and clumped in one bunch. This does not align with the screenshot provided in the module.

Link to workshop URL
(https://www.eventbox.dev/published/lesson/innovator-island/5-parkstats/3-quicksight/2-visual.html)

To Reproduce
Steps to reproduce the behavior:

  1. Following the steps exactly as described in BUILDING VISUALIZATIONS 2

Expected behavior
Data is expected to be scattered around various parts of USA (as per screenshot on eventbox). However, when applying the filter for "entry" events only, data is isolated to just the south of USA (see attached screenshot below).

Screenshots

image

Desktop (please complete the following information):

  • OS: MacOS 12.3.1
  • Browser: Chrome
  • Version: Version 101.0.4951.64 (Official Build) (x86_64)

Additional context
Add any other context about the problem here.

Is the backend code anywhere?

Describe the bug

I'm able to get the frontend code using the command indicated in the workshop:

wget https://innovator-island.s3-us-west-2.amazonaws.com/front-end/theme-park-frontend-202110.zip

That downloads the VUE app, but I can't figure out how to get the backend code. It isn't stated in the workshop either (https://www.eventbox.dev/published/lesson/innovator-island/1-deploy/3-backend.html).

It looks to me frontend and backend code used to be together. But that isn't the case anymore. Could that be?

How could I get access to the backend's SAM project?

Link to workshop URL
A link to the workshop URL with the issue.

Step 1 - Amplify Console deployment fails at Build stage

Hi,

I'm getting this error at the build stage when deploying the frontend:

There was an issue connecting to your repo provider, click "Re-authenticate app" in General Settings, and then try your build again.

I've done that ("Reconnect repository"), but the same message appears again at the next deployment.

The frontend code has been pushed to CodeCommit correctly, and this seems like an IAM issue.

Any suggestions?

new translations button

on the module 4
Push to CodeCommit and deploy via Amplify:
step no 2 & 3.
where it says translations button should have appeared in the menu bar at the top of the display. I do not see anything except for the zoom in and zoom out button. I must have missed something out. I am new at this. Need help. Thanks

Firehose > S3 reaches QuickSight's limits extremely quickly

Thank you so much for this amazing workshop. I was in dire need of an easy analytics solution and deployed your day 4 end to end without trouble and had some great charts. Then important all my historical data and again all was well. I recently went to do a refresh of the data and it is failing due to the 1000 file limit https://docs.aws.amazon.com/quicksight/latest/user/data-source-limits.html being reached. I have some enterprise support cases open but am hoping you can provide some advice.

I did a little math at at Firehose's slowest writes of 15 minutes, you reach 1000 files within 11 days if you have steady traffic.

To make matters worse, if any of your files are <5MB you cannot use some of the common S3 tools to concatenate files together with MULTIPART upload.

To stick with S3 it seems one needs a daily and then monthly job to join files together. Have you seen anyone do this?

I would kindly suggest you add a little warning to day 4 that as is it is really proof of concept.

Thank you!

Users all share same photo gallery

Are all the users supposed to share the same photo gallery? Should Cognito be allowing for logins? I did this workshop at re:Invent this year and again at home. Did I implement something incorrectly?

Issues creating theme-park-ridetimes Lambda function with Firefox

Firefox 77 (64bit) for Windows 10 Pro throws a bunch of errors when loading the function code:

SyntaxError: illegal character autosave.js:1
ERROR Error dialog shown: Unhandled Error, reporting in developer mode only. Check the console logs for details. Message: The following plugins failed to load:
126: setup is not a function environment-default.js:26128:41
EXCEPTION The following plugins failed to load:
126: setup is not a function - details: {"url":"https://d3fopt2osyq14i.cloudfront.net/ide-69a1b9dfeecbb6b24a94bd6338a16c2e982bac3c/index.html?fn=theme-park-ridetimes&origin=https://us-west-2.console.aws.amazon.com&readonly=false","version":"undefined (undefined)","useragent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0","stack":["Architect</Architect.prototype.activate:126","createApp/<:96"]} environment-default.js:48377:8
Error: The following plugins failed to load:
126: setup is not a function environment-default.js:126:9

When I opened up the same function in Chrome, it turned out none of the app.js code that had been copied into the index.js file had been saved. So this error appears to be also affecting that, although visibly it looks like the code saved.

Seems like a serious bug.

Step 1 - backend deployment (without a Layer)

After deploying the backend stack in step 1, the documentation says:

SAM has now used CloudFormation to deploy a stack of backend resources which will be used for the rest of the workshop, 2 x Lambda functions and a Lambda Layer, 3 x S3 buckets, a DynamoDBTable, Cognito UserPool, AWS IoT thing and a number of IAM Roles and Policies.

But there is no Lambda Layer in the stack. Is this a documentation error, or maybe we'll add it later?

It might be confusing for customers.

add to dashboard button

on module 6.
step 3: Creating the dashboard
on the bullet point where it says: add to dashboard.
the button seems to be not working or something is wrong with it.
I did hard refresh to all the pages tried multiple times but no progess so far.

cloudwatch

Can not see update on site after I followed each step.

Describe the bug
The browser caches the older version of the site even I perform a hard fresh on Chrome.

Link to workshop URL
https://pages.awscloud.com/AWS-Learning-Path-Build-a-Serverless-Web-App-for-a-Theme-Park_2020_LP_0005-SRV.html
https://www.eventbox.dev/published/lesson/innovator-island/1-deploy/4-update.html

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'AWS Amplify Console'
  2. Click on the URL of theme-park-frontend
  3. See error: My site does not change even I followed each step.
  4. On the console, see issue 'Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform'

Expected behavior
A step-by-step instruction to fix this issue.

Screenshots
ๆˆชๅฑ2021-09-14 ไธ‹ๅˆ4 25 54

Desktop (please complete the following information):

  • OS: [iOS]
  • Browser [chrome]
  • Version [92.0.4515.159]

Additional context
Add any other context about the problem here.

Workshop Cleanup Script

It would be great to have a cleanup script for this workshop. It took me quite a while to go through the 10 different areas and make sure everything was deleted (and I am still not sure I got everything).

Frontend Error

There is an error logged in the browser console in what I think is normal operation. This has been confusing to customers who think that something is wrong. Screenshot attached.

Can this error be captured and logged as something else?

Thanks,

Screenshot 2021-01-27 at 11 49 31

Spice Capacity

Yesterday I helped run this workshop of a customer and we hit a problem with the Amazon QuickSight module.

We hit a 'Not enough SPICE capacity' error (screenshot attached).

As a work around we deleted data from the S3 bucket. Can the workshop be modified so this doesn't happen?

Thanks,

Screenshot 2021-01-27 at 14 25 37

Step 2 - IAM permission documentation

At the end of step 2, in the module review we say:

Set up IAM permissions so your Lambda function could write this message to the application's DynamoDB table, and publish the message to the IoT topic for the front end.

But we didn't actually do that in this step.

When creating the new Lambda function, we've simply reused an existing IAM role.

Should we clarify this statement?

User ID and Password request

I took a break from the workshop for a day and now when I run the command 'git push' I am being asked for a user ID and password and I have no idea which one to try

This is in the translate module

Update Instructions to Prevent Variable Error message

Describe the bug
In section 5, as we are instructed to run the simulator, we are told to run the command in the fourth step:
sam package --output-template-file packaged.yaml --s3-bucket $s3_deploy_bucket

The issue I ran into running this command is that there was no previous direction to set the s3_deploy_bucket. This resulted in a command failing to run.

I think having a step on setting that step would help if anyone runs into this problem

Link to workshop URL
https://www.eventbox.dev/published/lesson/innovator-island/5-parkstats/2-simulator.html

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Step 5 - Kinesis Firehose buffering conditions

Because the simulation is generating 5MB of logs every 6-7 seconds, we could recommend customers to configure a larger buffering condition to minimize the # of S3 PUT requests.

Something like 10MB or 20MB?

Environment Variables assumed to be set when calling sam commands in https://www.eventbox.dev/published/lesson/innovator-island/3-photos/2-backend/2-compositing.html

Describe the bug
In the workshop on the step 2-backend/2-compositing (full URL provided below), the following commands assume environment variables to be already set

sam build

sam package --output-template-file packaged.yaml --s3-bucket $s3_deploy_bucket

sam deploy --template-file packaged.yaml --stack-name theme-park-photos --capabilities CAPABILITY_IAM --parameter-overrides "FinalBucketName"=$FINAL_BUCKET

When I was going through this lab, neither the $s3_deploy_bucket nor the $FINAL_BUCKET were set, so the command failed. I had to manually set these variables and re-run the commands. It is possible that the variables may have been set in an earlier step, but if Cloud9 has to be re-started because of auto-logout, all environment variable settings are lost. It will be good to add a step so set the variables before they are actually used.

Link to workshop URL
https://www.eventbox.dev/published/lesson/innovator-island/3-photos/2-backend/2-compositing.html

To Reproduce
Steps to reproduce the behavior:

  1. Before doing the step in the URL above, log out of the account.
  2. Log back in and restart Cloud9
  3. Then try running this part of the lab with the sam commands described above

Expected behavior
The variables $s3_deploy_bucket and $FINAL_BUCKET need to be reset just before being used in the sam commands, even if they were set earlier

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Step 1 - backend environment variables and logical name bug

You're asked to define these env variables after deploying the backend stack during step 1:

AWS_REGION=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed 's/\(.*\)[a-z]/\1/')
FINAL_BUCKET=$(aws cloudformation describe-stack-resource --stack-name theme-park-backend --logical-resource-id FinalBucket --query "StackResourceDetail.PhysicalResourceId" --output text)
PROCESSING_BUCKET=$(aws cloudformation describe-stack-resource --stack-name theme-park-backend --logical-resource-id ProcessingBucket --query "StackResourceDetail.PhysicalResourceId" --output text)
UPLOAD_BUCKET=$(aws cloudformation describe-stack-resource --stack-name theme-park-backend --logical-resource-id UploadBucket --query "StackResourceDetail.PhysicalResourceId" --output text)
DDB_TABLE=$(aws cloudformation describe-stack-resource --stack-name theme-park-backend --logical-resource-id DynamoDBTable --query "StackResourceDetail.PhysicalResourceId" --output text)

But in this first step we've only created the DDB table.

Also, the logical resource name should be DDBtable (not DynamoDBTable), otherwise you get an error.

Step 1 - init API Gateway endpoint (not created)

You're asked to

Call the API Gateway endpoint URL which SAM has created. First, run the following command in the console to show the endpoint URL:

aws cloudformation describe-stacks --stack-name theme-park-backend --query "Stacks[0].Outputs[?OutputKey=='InitStateApi'].OutputValue" --output text

But this resource does not exist in the stack. We only defined and deployed a function named AppConfigurationLambda (with no event/endpoint).

Maybe we just need to invoke the function directly?

Missing checkbox ticking instruction in Park Stats module (module 5)

Describe the bug
In the 'Configure and use QuickSight' instructions, there are instructions to uncheck

Link to workshop URL
https://www.eventbox.dev/published/lesson/innovator-island/5-parkstats/3-quicksight.html#step-by-step-instructions

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://www.eventbox.dev/published/lesson/innovator-island/5-parkstats/3-quicksight.html#step-by-step-instructions
  2. Scroll down to "4. In the next page in the sign-up process:"
  3. Where the text says:

Uncheck any checked boxes - this creates a popup.
This doesn't create a popup - checking 'S3 buckets' creates a popup.

Expected behavior
Text should read something like:

Uncheck any checked boxes, then check the 'S3 buckets' checkbox - this creates a popup.

Desktop (please complete the following information):
Any

Smartphone (please complete the following information):
Any

Additional context
N/A

The Instruction Site for Serverless workshop Innovator-island

Describe the bug
There are some inconsistencies in the serverless innovator island workshop.

  1. The description "The Flow & Traffic Controller exists in a separate AWS account owned by the theme park. You are provided with the SNS topic ARN to use." in the chapter of "2. Real-time ride wait times - > Backend" seems not correct, need to be rephrase.

The reason is that the lambda "theme-park-ride-times-UpdateRides" is created in the step of "1. Deploy the application - > Backend" to update the Rides information to SNS Topic "theme-park-ride-times-FATcontroller", and the topic is subscribed by another lambda; this is why I think the current description is not correct. Further more, Though "theme-park-ride-times-UpdateRides" is created, it's not mentioned in the architecture diagram.

Link to workshop URL
https://www.eventbox.dev/published/lesson/innovator-island/

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://www.eventbox.dev/published/lesson/innovator-island/'
  2. Click on '2. Real-time ride wait times'
  3. Click the sub menu "Backend"
  4. Scroll down to the architecture diagram 'Real-time Serverless Backend' and find the sentence "The Flow & Traffic Controller exists in a separate AWS account owned by the theme park. You are provided with the SNS topic ARN to use."
  5. The sentence is not correct, as the "Flow & Traffic Controller" should be in the same account and should already be created in the previous step of "1. Deploy the application" in this workshop instructor.

Expected behavior
The wrong description should be corrected as "A lambda named 'theme-park-ride-times-UpdateRides-XXXXXXXX' is already created in step 1 in the same account and it is triggered by EventBridge(CloudWatch Event) every minute to publish updates to an Amazon SNS topic."

In the meanwhile, It would be good if the CloudWatchEvent and Lambda of UpdateRides can be reflected on the architecture diagrams.

Screenshots
Screen Shot 2021-09-27 at 6 12 23 PM
Screen Shot 2021-09-27 at 6 13 04 PM

UPLOAD_BUCKET variable not set in Module 3

Describe the bug

Instructions in the module 3 only retrieve the AWS Region and final bucket, but not the upload bucket (which is needed for subsequent operations in this module. There are instructions in module 1 that sets this variable.

If I run module 3 at a subsequent time or in a new terminal, I won't have the $UPLOAD_BUCKET variable set properly.

Furthermore, instructions in the aforementioned paged ask the user to replace the bucket name manually (aws s3 cp ./green-screen-test.png s3://youruploadbucketname), while the next section uses that variable (aws s3 cp ./green-screen-test.png s3://$UPLOAD_BUCKET).

Link to workshop URL

https://www.eventbox.dev/published/lesson/innovator-island/3-photos/2-backend.html

To Reproduce
Steps to reproduce the behavior:

  1. Create a new terminal window
  2. Follow instructions in module 3
  3. Get an error when testing the photo compositing Lambda function

Expected behavior

The UPLOAD_BUCKET should be set at the beginning of module 3.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Cloud9

Smartphone (please complete the following information):

  • N/A

Additional context
Add any other context about the problem here.

Step 3 - final end-to-end test with png sample photo

The "Add ride photo" button only accept jpg files:

<input id="file" accept="image/jpeg" type="file" style="display: none;">

Because of this, I couldn't easily use the the provided png file named green-screen-test.png (from the browser, since I've been doing this workshop from home, without a real greenscreen).

If you just rename the file to green-screen-test.jpg it works fine, but I think this unnecessary friction. We could simply provide a jpg sample image, or simply use accept="image/jpeg,image/png" in the HTML.

Step 3 - eval in Lambda function code

We're passing HSV_LOWER and HSV_UPPER a python tuples.

lower_range = eval(os.environ["HSV_LOWER"])
upper_range = eval(os.environ["HSV_UPPER"])

I think this is not something we'd want to recommend in production.

I can think of two better options:

  1. provide the values as a json list -> [36, 100, 100] instead of (36, 100, 100), then simply tuple(json.loads(os.environ["HSV_LOWER"]))
  2. Make these env variables optional and simply use the default values (no need to eval of json.loads)

Incorrect line numbers in Translation module (module 4)

Describe the bug
Line numbers referenced in instructions are incorrect in the Translation module.

Link to workshop URL
https://www.eventbox.dev/published/lesson/innovator-island/4-translate/2-backend.html#step-by-step-instructions

To Reproduce
Steps to reproduce the behavior:
In the text

Select your target languages. On line 36, the targetLanguages array shows a list of languages for translation. Currently this is set to French, Spanish and Japanese - you can modify this array to include of the supported language codes (show on line 29 in the possibleLanguages array). Choose 4-5 different languages.

the line numbers are incorrect.
Line 23 has the targetLanguages array.
Line 16 has the possibleLanguages array.

Expected behavior
Line 23 has the targetLanguages array.
Line 16 has the possibleLanguages array.

Screenshots
N/A

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):
N/A

Additional context
N/A

Deprecated uuid sintax in theme-park-backend-S3UploaderFunction

Running in module errors in this function. Per npm docs:

Deep Requires No Longer Supported
Deep requires like require('uuid/v4') which have been deprecated in uuid@7 is no longer supported.

Changes made in code:
//const uuidv4 = require('uuid/v4')
const { v4: uuidv4 } = require('uuid')

Redeploy and now works like a charm.

Step 1 - Import DDB items error (ValidationException)

When running the importData.js script, I got these errors:

$ node ./importData.js $AWS_REGION $DDB_TABLE
Trying batch:  0
Trying batch:  1
Error:  { ValidationException: The provided key element does not match the schema
    at Request.extractError (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/protocol/json.js:51:27)
    at Request.callListeners (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
  message: 'The provided key element does not match the schema',
  code: 'ValidationException',
  time: 2020-10-08T08:44:40.736Z,
  requestId: 'VDH25CO810GC2ROD3SAC0RI5Q7VV4KQNSO5AEMVJF66Q9ASUAAJG',
  statusCode: 400,
  retryable: false,
  retryDelay: 43.84522548134123 }
Error:  { ValidationException: The provided key element does not match the schema
    at Request.extractError (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/protocol/json.js:51:27)
    at Request.callListeners (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/home/ec2-user/environment/theme-park-backend/1-app-deploy/local-app/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
  message: 'The provided key element does not match the schema',
  code: 'ValidationException',
  time: 2020-10-08T08:44:40.743Z,
  requestId: 'SP2IF6EG5RD8AOMBVVCQKQA3OBVV4KQNSO5AEMVJF66Q9ASUAAJG',
  statusCode: 400,
  retryable: false,
  retryDelay: 6.5104707208255785 }

Only the first 16 items have been imported into my DDB tabl (up to ID=ride-016).

Invalid cleanup step instruction

Describe the bug
In Cleanup section Step 7 (Kinesis Firehose) script

aws kinesis delete-stream --stream-name theme-park-streaming-data

does not work.

Instead working one:

aws firehose delete-delivery-stream --delivery-stream-name theme-park-streaming-data

Link to workshop URL
A link to the workshop URL with the issue.

To Reproduce
Steps to reproduce the behavior:

  1. execute
aws kinesis delete-stream --stream-name theme-park-streaming-data

Output:

An error occurred (ResourceNotFoundException) when calling the DeleteStream operation: Stream theme-park-streaming-data under account XXX not found.

Expected behavior
Successful resource deletion.

Desktop (please complete the following information):

  • Cloud9 virtual environment
  • t3.small
  • us-east-1
  • pre installed:
aws-cli/1.19.112 Python/2.7.18 Linux/4.14.273-207.502.amzn2.x86_64 botocore/1.20.112

Module 5 Incompatible QuickSight options

Module 5: Analyzing visitor stats - (c) Configure and use QuickSight
Creating a QuickSight account

Step 3 says to select Standard Edition,
Step 4 says to Leave Use Role Based Federation (SSO) selected. this is however an enterprise feature, and the screenshot for this stage shows an enterprise setup.

Is enterprise needed, if so the Step 3 should be updated to reflect this

No background colour if wait time == 0

Describe the bug

On the park map, if the ride wait time is zero minute, the wait time badge doesn't have a background color. Thus, the text is then white on light gray, which is hard to read.

It looks like it comes from the src/components/ParkMap.vue file, lines 92 and following:

    getVariantFromWait: (wait) => {
      if (wait > 100) return 'bg-danger'
      if (wait > 90) return 'bg-warning'
      if (wait > 60) return 'bg-info'
      if (wait > 0) return 'bg-success'
    }

Should be:

    getVariantFromWait: (wait) => {
      if (wait > 100) return 'bg-danger'
      if (wait > 90) return 'bg-warning'
      if (wait > 60) return 'bg-info'
      return 'bg-success'
    }

Link to workshop URL

To Reproduce

Expected behavior

All possible wait times should have a background color.

Screenshots

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Step 5 - IAM least privileges for Kinesis Firehose

The simular app includes this policy:

- Statement:
    - Effect: Allow
       Resource: '*'
       Action:
          - firehose:PutRecordBatch

Since we've just created the Kinesis Firehose Delivery Stream, it'd be pretty straightforward to show customers how to update this policy with the Delivery Stream ID (instead of Resource: '*'), using the StreamName CloudFormation parameter.

Or we could at least limit the policy to that specific stream name in all regions:

Resource: !Sub arn:aws:firehose:*:*:deliverystream/${StreamName}

Workshop Feedback

Hi, I recently completed most of this workshop. I wanted to give some feedback to James and the team. First, thank you for producing workshops and introducing new AWS developers to Serverless. That said, there are a couple things I wish had been done differently.

The workshop has far too much clickops in the AWS Console. I cringed every time we were asked to run a command and then copy and past the value somewhere else. This is an unacceptable strategy, especially for a beginner workshop. We need everyone learning the right way to develop IaC. Please don't reinforce bad practices. My wish is that this whole workshop be redone without a single input step using the AWS Console. You know what the console is good for, reading CloudWatch logs.

The other area where this workshop lost me was QuickSight. Serverless developers are not the audience for QuickSight. I can only guess that some upper management type insisted that James include the most poorly performing AWS product in the workshop to artificially boost a utilization metric.

Anyways, I hope no one's ego has been damaged by my feedback here. I'm the first to praise good work in person, and I only have the guts to criticize anyone if I can remain anonymous. So it is.

Revisit CORS issue

I'm afraid that I cannot upload photos from the application due to CORS issues:

Access to XMLHttpRequest at 'https://b3tduirkm1.execute-api.us-west-2.amazonaws.com/Prod/Upload' from origin 'https://master.d1scdwkrvbfu7c.amplifyapp.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I know you covered this at the beginning of Day 3, but I missed that due to other issues, so it would be nice if you could revisit that.

Step 3.2 - Lambda Access Denied

Module 3.2: I had to remove ACL: 'public-read' from outParams in /theme-park-backend/3-photos/2-compositing/lambdaFunction/app.js otherwise the Lambda function was getting Access Denied error when writing to $FINAL_BUCKET.

Step 2 - IAM permission documentation

At the end of step 2, in the module review we say:

Set up IAM permissions so your Lambda function could write this message to the application's DynamoDB table, and publish the message to the IoT topic for the front end.

But we didn't actually do that in this step.

When creating the new Lambda function, we've simply reused an existing IAM role.

Should we clarify this statement?

IoT core vs EventBridge

Describe the feature you'd like
A clear and concise description of what you want to happen.

Module 3 - Make it possible to view processed pictures in case the S3 bucket hosting them is not public

Currently the front-end JS gives following errors in the console:
GET https://theme-park-backend-finalbucket-vi3m5d3fag5l.s3.amazonaws.com/5f3de0fc-687c-49a5-aaa4-fcae894ad1e7.jpg 403 (Forbidden)
5f3de0fc-687c-49a5-aaa4-fcae894ad1e7.jpg:1 GET https://theme-park-backend-finalbucket-vi3m5d3fag5l.s3.amazonaws.com/5f3de0fc-687c-49a5-aaa4-fcae894ad1e7.jpg 403 (Forbidden)

Maybe pre-signed URLs will address the issue.

Photo Compositing Lambda Function Fails With "Access Denied" Error

Describe the bug
Lamda function, theme-park-photos-CompositeFunction-XXXXXXXXX in "Section 3 - On-Ride photo processing" fails with Access denied error, while processing a photo that is uploaded into "upload" S3 bucket.

Link to workshop URL
https://www.eventbox.dev/published/lesson/innovator-island/3-photos/2-backend/2-compositing.html

To Reproduce
Steps to reproduce the behavior:

  1. Complete the steps detailed in the link here - https://www.eventbox.dev/published/lesson/innovator-island/3-photos/2-backend/2-compositing.html
  2. Check the CloudWatch logs for the Lambda function - "theme-park-photos-CompositeFunction-XXXXXXXXX"

Expected behavior
The photo uploaded in ''upload" S3 bucket should be processed by the Lambda function and saved to "final" S3 bucket

Additional context
Add any other context about the problem here.

Module 1: Access denied when trying to use the S3 bucket

Not sure if that's an issue with my account or something similar but maybe somebody is able to help me here:
I'm currently stuck on step 5 of the Backend part in module 1.
I successfully created an S3 deployment bucket and I can see it was created in the AWS Control Management Console (when I navigate to S3). But every time I enter the first commands from step 5 ...
sam package --output-template-file packaged.yaml --s3-bucket $s3_deploy_bucket

... I get an error like this:

Error: Unable to upload artifact fatController/ referenced by CodeUri parameter of UpdateRides resource.
An error occurred (AccessDenied) when calling the PutObject operation: Access Denied

I read this article: https://aws.amazon.com/de/premiumsupport/knowledge-center/s3-access-denied-bucket-policy/ But I can't find any IAM roles, that have anything to do with S3 (there are new roles for Cloud9 and Amplify though). But I'm not sure if you need such a rule at all for S3.

When looking at the settings of the S3 Bucket, my user has full rights to read and write to the bucket. Maybe Cloud9 doesn't have the needed permissions (if that matters).

Any idea what's wrong here? I'm not sure what to do (being a complete newbie to AWS and all).

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.