GithubHelp home page GithubHelp logo

dynamodb-behind-corporate-proxy's Introduction

Overview

This repository shows how to connect and use dynamodb from behind the corporate proxy with custom certificate. This uses the same examples as shown in the getting stared aws tutorial for Nodejs and dynamodb.

This process is tested for Linux and Osx , not guaranteed to work in windows.

Quick start

Clone the repository and npm install

git clone https://github.com/rupamroy/dynamodb-behind-corporate-proxy.git
cd dynamodb-behind-corporate-proxy
npm install

configuration when when using dynamodb in AWS

Change the AWS Endpoint in the file config.js

if behind a corporate network with proxy in the config.js file

  • provide the proxy url
  • provide the proxy authentication (user:password), try this only if simple proxy gives you proxy authentication failed error
  • certs - You need to provide the certificate files for your proxy
    • Obtain your certificate files for the proxy from your system engineering team. Normally these files are .pem files , usually there is a root , issuer and proxy certificate but may vary as per your network configuration.
    • under the ca key in the config.js file provide the paths to the certificate files.
  • update your dynamodb region and the endpoint url

configuration when using local dynamodb

You can run a local version of the dynamodb in a docker container for that

run the docker container

docker-compose up -d

and then replace the contents of the config,js with the following

module.exports = {
    region: 'us-east-1',
    endpoint: 'http://localhost:8000'
}

run the application

npm install
node src/MoviesCreateTable.js # Creates a table Movie in dynamodb
node src/MoviesLoadData.js # inserts 10 movies of the moviedata.json file
node src/item/MoviesItemOps0* # various operations- look at individual file.

clean up

To stop and kill the container

docker-compose down 

Tips

To find the count of items in a table

aws dynamodb scan --table-name Movies

To use the dynamodb aws-cli when custom certs are involved then you need to create a ca-bundle and configure the AWS_CA_BUNDLE env variable.

Taking the example of the three certs as mentioned earlier we can create the ca-bundle file by concatenating them into one file

cat proxy.pem issuer.pem root.pem > company.ca-bundle

Then

export AWS_CA_BUNDLE=/Users/user_name/Documents/certs/company.ca-bundle

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.