Giter Site home page Giter Site logo

antahiap / dsr-serverless-course Goto Github PK

View Code? Open in Web Editor NEW

This project forked from markus-hinsche/dsr-serverless-course

0.0 0.0 0.0 5.57 MB

Teaching material for DSR bootcamp - AWS Serverless https://datascienceretreat.com

Shell 75.27% Python 24.73%

dsr-serverless-course's Introduction

DSR Serverless Course (AWS Lambda)

Pre-requisites

  • Git

    • macOS: brew install git
    • Linux (Ubuntu): sudo apt-get update && sudo apt-get install git-all
  • conda

    • macOS

         wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O ~/miniconda.sh
         bash ~/miniconda.sh -b -p $HOME/miniconda
      

      For MacOS Catalina:

      If you are on macOS Catalina, the new default shell is zsh. You will instead need to run

         source <path to conda>/bin/activate && conda init zsh.
      
    • Linux (Ubuntu)

Creating AWS Account

Follow the instructions in this page

Preparing your local env

Clone the github repo

$ git clone [email protected]:markus-hinsche/dsr-serverless-course.git
cd dsr-serverless-course

Create python3.9 virtual env, use

$ conda create -n dsr-serverless-py39 python=3.9 -y

Activate this environment, use

 $ conda activate dsr-serverless-py39

Install needed libraries, use

 $ pip install -r requirements.txt

Note: to deactivate an active environment, use

 $ conda deactivate

Intall zip command:

  • Ubuntu: sudo apt-get install -y zip

  • Manjaro: sudo pacman -S zip

    Note: In case if you get any error while installing the package, try the command below and repeat the previous commands sudo pacman -Rs zip

Configuring your local CLI with AWS

Before using aws-cli, you need to configure it with your AWS credentials. You can create a user in https://console.aws.amazon.com/iam/ and export the credentials csv. If the user name is cli-user, run the following:

$ aws configure --profile cli-user
AWS Access Key ID: foo
AWS Secret Access Key: bar
Default region name [us-west-2]: eu-central-1
Default output format [None]: json

$ export AWS_PROFILE=cli-user

If you have an issue

To test if you have access, run the following and you shouldn't see an error:

$  aws iam get-user
{
    "User": {
    "Path": "/",
    "UserName": "cli-user",
    "UserId": "HASH",
    "Arn": "arn:aws:iam::account-id:user/cli-user",
    "CreateDate": "2021-06-06T17:59:12Z"
  }
}

Note: If you have an issue in using the aws command try the following way in doing the setup:

$ cat ~/.aws/config
[default]
region=us-west-2
aws_access_key_id=foo
aws_secret_access_key=bar

$ aws configure
AWS Access Key ID [****************foo]:
AWS Secret Access Key [****************bar]:
Default region name [us-west-2]:
Default output format [None]:

Note: using the new AWS CLI version 2 Docker image might not work with all examples.

Notes for Window users:

To create an env variable in Windows:

set ROLE_ARNN="value"

To create a variable which you use in your terminal

ROLE_ARNN="value"

To check its value

echo %ROLE_ARN%   on windows

So, to create Lambda For Windows (for tutorial 4,5,6)

set MY_NAME= Enter your name
aws lambda create-function --function-name %MY_NAME%-function-from-cli --runtime python3.9 --handler lambda_function.lambda_handler --role %ROLE_ARN% --zip-file fileb://my_lambda.zip

Tutorials & Labs

Introduction

To learn more, follow this tutorial 00-intro.md

AWS Console General Introduction

To learn more, follow this tutorial 01-aws-console-general-intro.md

Create lambda from a blurprint using aws console

To learn more, follow this tutorial 02-create-lambda-from-blueprint-with-aws-console.md

Create lambda from scratch using aws console

To learn more, follow this tutorial 03-create-lambda-from-scratch-with-aws-console.md

Create & use lambda using aws-cli

To learn more, follow this tutorial 04-create-lambda-with-aws-cli.md

Easy setup and deployment using shell scripts

To learn more, follow this tutorial 05-create-lambda-with-aws-cli-and-shell-scripts.md

Text to speech example, using boto3 (Python SDK)

To learn more, follow this tutorial 06-text-to-speech-lambda-boto3-and-polly.md

References

dsr-serverless-course's People

Contributors

safaa-alnabulsi avatar markus-hinsche avatar antahiap avatar

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.