Giter Club home page Giter Club logo

dynamodb-python's Introduction

dynamodb-python

Going through getting started guides for dynamodb and python development. https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.Python.html

Table of Contents

Prerequisites

Install Java

Check if you already have java installed by running

java -version

If you see "command not found" run the below commands to install java

sudo apt update
sudo apt install default-jre

Verify Java is installed by running

java -version

You should see the below output if Java installed correctly

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)

Install Python

sudo apt update && upgrade
sudo apt install python3 python3-pip ipython3

Install unzip

sudo apt-get install unzip

Install boto3

boto3 doesn't have type annotations by default so we will use the boto3 stubs package to get them

pip3 install boto3
pip3 install boto3-stubs
pip3 install 'boto3-stubs[essential]'

If you still see a modulenotfound error on vscode from pylance, restart vscode

Install AWS CLI

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" --output awscliv2.zip
unzip awscliv2.zip
sudo ./aws/install
rm -rf awscliv2.zip
rm -rf aws

Now configure aws to use fake credentials for your local dynamodb, enter the following values for each prompt

aws configure --profile myprofile
AWS Access Key ID [None]: "fakeMyKeyId"
AWS Secret Access Key [None]: "fakeSecretAccessKey"
Default region name [None]: x
Default output format [None]:

Install dynamodb locally

Navigate to a directory you want to store a local version of dynamodb

mkdir dynamodb-local
cd dynamodb-local

Download and extract the java executable for dynamodb

curl https://s3.us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz --output dynamodb-local-tar.tar.gz
tar -xf dynamodb-local-tar.tar.gz

Start dynamodb, use -port to specify another port if the default port (8000) is already taken by another program

java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb

Open a new terminal session and run

aws dynamodb list-tables --endpoint-url http://localhost:8000 --profile myprofile

You should see the output below if everything setup correctly, try restarting your computer and trying the steps again if you don't see this output

press q on your keyboard to exit and get back to the shell after you ran the previous command

{
    "TableNames": []
}
(END)

Getting Started

Follow tutorial on Amazon docs

Head over to the Amazon docs to continue through the tutorial, you've set up the dynamodb locally and setting up a connection to web services will be covered at the end of that tutorial

dynamodb-python's People

Contributors

jonathanpv avatar

Watchers

James Cloos avatar  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.