Coder Social home page Coder Social logo

chalice-workshop's Introduction

AWS Chalice Workshop

This repository contains code for the AWS Chalice workshop. You can read the rendered content on ReadTheDocs at: http://chalice-workshop.readthedocs.io/en/latest/

Repo Layout

  • docs/ - The step-by-step documentation for completing each tutorial in the workshop. This is a sphinx project and can be used to generate both html as well as a pdf of the guide.
  • code/ - The code to use for the workshop. Each tutorial will have a final/ directory reflecting the end code for application once the tutorial is complete.

Building the Docs

Install requirements:

$ pip install -r requirements.txt

Build html docs:

$ make html

chalice-workshop's People

Contributors

dumoknam avatar efxshipon avatar hyandell avatar jamesls avatar kyleknap avatar stealthycoin avatar tuxpower avatar xke 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

chalice-workshop's Issues

Update all code to use python3.7

Python 2.7 is officially deprecated as of Jan 1st. 2020. We should update code to use python3 and remove references to python2.

Also, looking at our pypi stats for Chalice, a majority of downloads/installs use python3 so I think it's reasonable to no longer support both py2 and py3 in the workshop code (https://pypistats.org/packages/chalice). It also simplifies the code for customers to not have to follow additional code paths/modules to support python2 and 3.

todo-app/final: App code does not have permission to access DB when deployed

Running the application using the API endpoint non-locally, leads to a permission failure when running a simple "list" request.

botocore.exceptions.ClientError: An error occurred (AccessDeniedException) when calling the Query operation: User: arn:aws:sts::xxxxxxxx:assumed-role/portal-app-dev/portal-app-dev is not authorized to perform: dynamodb:Query on resource: arn:aws:dynamodb:eu-west-1:xxxxxxxx:table/todo-app-56e56944-c8d5-4722-9bbb-2e77c5a9a138

Adding the AmazonDynamoDBFullAccess to the permission for the Lambda role, fixed the problem.

So it looks as if the chalice deploy does not add the correct permissions to the role.

Amendments to Readme

  1. Correct Readme text to say pip install -r requirements-dev.txt etc.
  2. Add note to ignore suggestion to update pip, when running the requirements-dev.txt, requirements.txt pip commands

todo-app/final: utils.py needs check on table existence before accessing, or Exception handler

List of table entries
`python users.py -l

Traceback (most recent call last):
File "users.py", line 86, in
main()
File "users.py", line 80, in main
list_users(args.stage)
File "users.py", line 53, in list_users
for item in table.scan()['Items']:
File "xxx/venv/lib/python3.8/site-packages/boto3/resources/factory.py", line 520, in do_action
response = action(self, *args, **kwargs)
File "xxx/venv/lib/python3.8/site-packages/boto3/resources/action.py", line 83, in call
response = getattr(parent.meta.client, operation_name)(*args, **params)
File "xxx/venv/lib/python3.8/site-packages/botocore/client.py", line 316, in _api_call
return self._make_api_call(operation_name, kwargs)
File "xxx/venv/lib/python3.8/site-packages/botocore/client.py", line 635, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.errorfactory.ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the Scan operation: Requested resource not found
`

force Python 3.6 for OSX

In https://github.com/aws-samples/chalice-workshop/docs/source/env-setup.rst

git checkout f2a764e /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/python.rb did not work

Digging the git history found that 'git checkout f2a764ef9 /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/python.rb' works.

Change f2a764e to f2a764ef9

Not able to create user using command "python users.py -c"

Getting the following error for the command "python users.py -c"

(venv38) Thirumals-Air-2:vfc-lambda thirumal$ python users.py -c
Username: thirumal
Password: 
Traceback (most recent call last):
  File "users.py", line 85, in <module>
    main()
  File "users.py", line 77, in main
    create_user(args.stage)
  File "users.py", line 25, in create_user
    password_fields = encode_password(password)
  File "users.py", line 40, in encode_password
    hashed = hashlib.pbkdf2_hmac('sha256', password, salt, rounds)
TypeError: a bytes-like object is required, not 'str'

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.