Python Tutorial: Intro to AWS and Boto3

3 Comments



Want to learn more? Take the full course at https://learn.datacamp.com/courses/introduction-to-aws-boto-in-python at your own pace. More than a video, you’ll learn hands-on coding & quickly apply skills to your daily work.


Welcome to Introduction to AWS and Boto in Python!

Amazon Web Services is the backbone of the internet. Boto3 lets us harness the power of AWS to use as an extension of our laptops. We can build automated reports, perform sentiment analysis, send alerts and more.

Let’s get started!

Our house needs water, electricity, trash service, and cable TV. Our project needs storage, compute resources, and alerts to be successful.

We buy utilities for the home. We buy AWS services for our project. AWS services are granular, so they work together or on their own.

To interact with AWS in Python, we use the Boto3 library. Let’s look at an example.

We import boto3.

We initialize the client with an AWS service name, region, key and secret.

The service name can be any of the 100+ available AWS services.

The region is the geo region where our resources are located.

Key and secret are like a username and password to an AWS account. We’ll make our own next.

Creating an account at aws.amazon.com gives us access to the AWS Console. Anything we do here to manage our web services, we can do in Boto3 in Python.

To log into the console, we use the username/password we signed up with. This is the root user.

To create the key/secret for Boto3, we are going to use IAM or Identity Access Management Service.

We create IAM sub-users to control access to AWS resources in our account. Credentials – or the key / secret combo are what authenticate IAM users.

In the console, type IAM in the Find Services Section.
At the IAM Screen, click “Users”
Click “Add User”
Enter a username and select “programmatic access”.

Select “Attach Existing Policies Directly” to add pre-made permission sets to our new user.

Give the user the AmazonS3FullAccess policy, AmazonSNSFullAccess, AmazonRekognitionFullAccess, TranslateFullAccess, and ComprehendFullAccess. We can skip the tags screen. Make sure we set everything correctly and create the user!

Grab our key and secret and store them somewhere safe. We created a user that has full permissions to the services we will use in this course.

What are these services? I already mentioned IAM. S3 or Simple Storage Service lets us store files in the cloud.

SNS or Simple Notification Service lets us send emails and texts to alert subscribers based on events and conditions in our data pipelines.

Comprehend performs sentiment analysis on blocks of text. And Rekognition to extracts text from images and look for cats in a picture! RDS, EC2, and Lambda are other common services, but we won’t cover them in this class. Lastly, let’s meet Sam. She is an analyst at the City of San Diego. She analyzes data and builds dashboards to improve city operations.

Sam works with a variety of datasets. But much of her work is centered around GetItDone. The City of San Diego launched Get It Done to allow residents to report problems like potholes and broken sidewalks. We will be helping Sam harness the cloud to improve the lives of San Diego residents using GetItDone and other datasets.

In this lesson, we learned that Amazon Web Services are like home utilities. Decoupled and granular, they work well together or on their own.

We learned about the key services we will be using in this class.

We learned how to create an IAM user and get a key / secret combination.

Lastly, we learned to initialize an S3 client and list buckets using our AWS Key and Secret.

Now, let’s help Sam start building some things with AWS!

#DataCamp #PythonTutorial #AWS #Boto #Python

source

3 Comments
    • blank
      Roberto Moreira Diniz
      May 08, 2022 21:51 pm Reply

      This videos is not working on DataCamping website. I already tried on Brave and Firefox.

    • blank
      Shawn Gollatz
      May 08, 2022 21:51 pm Reply

      Your house needs internet.
      NOT cable TV.

    • blank
      F Ahmad
      May 08, 2022 21:51 pm Reply

      so is boto3 an api?

Leave us a comment