arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

ros_and_aws_integration.md

hashtag
By Nazari Tuyo

hashtag
Step 1: Install the AWS python CLI

Follow the steps at the link below for linux:

l

hashtag
Step 2: Run the following commands on your VNC to install boto3

  1. pip install boto3

  2. pip freeze

  3. check that boto3 is actually there!

hashtag
Step 3: Integrating boto3 clients into your code

  1. Create a file in your package to store your AWS credentials

  2. Sign into AWS, and create an access key

  3. Create an Access Policy for your services

python -m pip install --user boto3

Create a class that will hold your credentials, for example:

and any other information you may need to store for the service you choose to use.

  • Based on the service you’d like to use, create the appropriate client. If you’re using dynamoDB, it may look like this:

    Please refer to the documentation for of the service you’d like to use and the request format

    https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/index.htmlarrow-up-right

  • There are several helpful methods included with each service, here are some of dynamoDB’s methods for example:

    Each method will have a unique request, so be sure to check before implementing it into your code.

  • This can be used within your node, but keep in mind how many requests you are making if you place your request in a loop.

  • https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.htmarrow-up-right
    dynamodb = boto3.resource('dynamodb')
    delete_item()
    delete_table()
    put_item()
    query()
    update_item()
    update_table()
    class Credentials:
        AWS_ACCESS_KEY_ID = ''
        SECRET_ACCESS_KEY = ''
        OWNER_ID = ''