Home Cloud & Networking Python Essentials for AWS Cloud Developers

Python Essentials for AWS Cloud Developers

By Serkan Sakinmaz
ai-assist-svg-icon Book + AI Assistant
eBook + AI Assistant $39.99 $27.98
Print $49.99
Subscription $15.99 $10 p/m for three months
ai-assist-svg-icon NEW: AI Assistant (beta) Available with eBook, Print, and Subscription.
ai-assist-svg-icon NEW: AI Assistant (beta) Available with eBook, Print, and Subscription. $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime! ai-assist-svg-icon NEW: AI Assistant (beta) Available with eBook, Print, and Subscription.
What do you get with a Packt Subscription?
Gain access to our AI Assistant (beta) for an exclusive selection of 500 books, available during your subscription period. Enjoy a personalized, interactive, and narrative experience to engage with the book content on a deeper level.
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
Gain access to our AI Assistant (beta) for an exclusive selection of 500 books, available during your subscription period. Enjoy a personalized, interactive, and narrative experience to engage with the book content on a deeper level.
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Along with your eBook purchase, enjoy AI Assistant (beta) access in our online reader for a personalized, interactive reading experience.
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
ai-assist-svg-icon NEW: AI Assistant (beta) Available with eBook, Print, and Subscription. ai-assist-svg-icon NEW: AI Assistant (beta) Available with eBook, Print, and Subscription. BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime! ai-assist-svg-icon NEW: AI Assistant (beta) Available with eBook, Print, and Subscription.
eBook + AI Assistant $39.99 $27.98
Print $49.99
Subscription $15.99 $10 p/m for three months
What do you get with a Packt Subscription?
Gain access to our AI Assistant (beta) for an exclusive selection of 500 books, available during your subscription period. Enjoy a personalized, interactive, and narrative experience to engage with the book content on a deeper level.
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
Gain access to our AI Assistant (beta) for an exclusive selection of 500 books, available during your subscription period. Enjoy a personalized, interactive, and narrative experience to engage with the book content on a deeper level.
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Along with your eBook purchase, enjoy AI Assistant (beta) access in our online reader for a personalized, interactive reading experience.
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
  1. Free Chapter
    Chapter 1: Using Python on AWS
About this book
AWS provides a vast variety of services for implementing Python applications, which can pose a challenge for those without an AWS background. This book addresses one of the more predominant problems of choosing the right service and stepping into the implementation of exciting Python apps using AWS. The book begins by showing you how to install Python and create an AWS account, before helping you explore AWS Lambda, EC2, Elastic Beanstalk, and S3 for Python programming. You'll then gain hands-on experience in using these services to build the Python application. As you advance, you'll discover how to debug Python apps using PyCharm, and then start deploying the Python applications on Elastic Beanstalk. You’ll also learn how to monitor Python applications using the CloudWatch service, along with creating and publishing APIs on AWS to access the Python application. The concluding chapters will help you get to grips with storing unstructured and semi-structured data using NoSQL and DynamoDB, as well as advance your knowledge using the Glue serverless data integration service in AWS. By the end of this Python book, you’ll be able to take your application development skills up a notch with AWS services and advance in your career.
Publication date:
May 2023
Publisher
Packt
Pages
224
ISBN
9781804610060

 

Using Python on AWS

In this chapter, we will give a brief introduction to the cloud. We will then explain how to set up Python and how to run your first application within the command line as well as via an integrated development environment (IDE). We’re going to cover the following main topics:

  • What is the cloud?
  • Understanding the advantages of the cloud
  • Installing Python
  • Installing PyCharm
  • Creating a new project

Cloud computing is one of the most popular approaches to implementing your applications, and it has huge advantages. There are multiple cloud providers, such as Amazon Web Services (AWS), Google Cloud Platform (GCP), and Azure. AWS is one of the most widely used cloud providers, and many companies are moving there. Cloud usage is significantly growing, and developers are expected to have a good understanding of the cloud. By buying this book, you are on the right path and stepping into how to implement cool Python applications using AWS.

Most companies are moving to the cloud because of the significant advantages. It is important to know why and how these services are being used.

 

What is the cloud?

The cloud is a popular way of using your IT infrastructure and services over IT providers that manage machines, networks, and applications. Basically, you don’t need any on-premises infrastructure, and cloud providers have their data centers to serve the required services over the internet. For example, if you need a server, you don’t need to buy a machine and don’t need to set up its network and power. Cloud providers serve these resources for you, and you can use them over the internet.

 

Understanding the advantages of the cloud

The following aspects explain why companies are moving to the cloud to have a better infrastructure:

  • Good disaster recovery plan: Cloud providers have multiple data centers in different regions. If an issue happens in one region, the system can be recovered in another region.
  • Better scalability and stability: In AWS, you have different services to upscale and downscale your application. All you need to do is to configure scaling options based on usage.
  • Quicker time to production: AWS has more than 100 services, and these services come with huge capabilities. When you have any application for production, you don’t need to start from the beginning, such as provisioning the server or preparing the infrastructure.
  • Pay-as-you-go model to reduce the cost: You don’t need to sign a contract that promises payment; you can also use the service for just one day and then shut it down.
  • Monitoring and logging advantages: The biggest cloud providers have monitoring and logging services; you can integrate these services into your application.
  • Reduces DevOps effort: AWS comes with lots of advantages for DevOps. For example, you can provision servers quickly and deploy and monitor your service with simple configurations.
  • Multiple security services to keep data safe: There are different services to keep your services and data safe.

The cloud comes with lots of advantages. There are also some important considerations when using cloud services:

  • Security: Securing your services is important, and AWS provides different services to protect your data, such as firewall configurations. You have to evaluate security requirements while using AWS services.
  • Cost management: You can easily create and scale your services, which is a very big advantage. The point to note is that while you create these services, it comes with a cost, which can cause surprises if you don’t consider the costs for specific services. Check the cost of services while creating them and create some alarms if the service exceeds your budget.

There are more than 100 AWS services, and it is important to choose the right service to implement your application based on your requirements. In this book, you will learn to create an AWS account and the required AWS services that allow you to run Python applications. To run and deploy the Python application in AWS, you will learn how to configure the AWS services and deploy them afterward.

Python is also one of the most widely used programming languages. It is easy to learn and has broader usage. Within AWS, most application-related services support Python because of its broad usage, and these services are stable when it comes to the use of Python. AWS always adapts Python use cases with their services, which is a big advantage.

This book is meant for cloud developers, software developers, and IT specialists who want to develop Python applications on AWS as well as learn the concepts of appropriate AWS services for implementing Python applications. You should have Python knowledge, and this book will focus on creating Python applications in AWS. The focus will be on creating and giving details for AWS services instead of digging into Python syntax details. Hence, you will add more expertise to your skillset.

While reading this book, it is important to follow the exercises. This is not just a book of theory and definitions. You will see code examples to illustrate what you have learned. I would recommend implementing the same examples by yourself to help you learn better and apply the same methodologies to your cloud projects. This idea slows down your progress, but you will learn better and easily remember the concepts while using AWS in your professional work life.

At the end of this book, you will implement a graduation project with Python on AWS to connect different AWS services in one application. This project helps you to use different services in the same application and understand the connection between them; you will consolidate your learning with another hands-on exercise.

Once you have created an AWS account, you will be charged according to what usage you have in a month. You always have to be careful what you use and create in AWS. Another point to note is that some AWS services are free for limited usage. Please check the costs before deciding to use any AWS service. Please be aware that you need to pay for AWS costs while doing the exercises. You can check the pricing at this link: https://aws.amazon.com/pricing/.

Let’s dig into Python programming on AWS.

 

Installing Python

To install Python, carry out the following steps:

  1. Visit the Python download page, https://www.python.org/downloads/, and select the right operating system.
  2. Download the installation package and run it afterward:

Figure 1.1 – Install Python

After the installation, you will have a Python 3.X folder. The Python folder has the following contents:

Figure 1.2 – Installation folder content

We will follow the steps for macOS; it is very similar to the other operating systems. Let’s implement the 'Hello World' application:

  1. Double-click on the IDLE application and run the sample 'Hello World' application:

Figure 1.3 – Python command line

If you see this output, congrats! You successfully installed the Python compiler. As a next step, we will install the IDE to simplify the application development.

 

Installing PyCharm

PyCharm is one of the most powerful IDEs used to develop Python applications. For the examples, we will use PyCharm; you can also use another IDE if you prefer. You have to carry out the following steps:

  1. Visit the download page, https://www.jetbrains.com/pycharm/download, and select the right operating system:

Figure 1.4 – PyCharm download page

I recommend downloading the Community Edition. Otherwise, it will be a trial version for 30 days.

  1. Download the installation package and run it afterward. Once you click Download, it directly downloads the installation package to the computer:

Figure 1.5 – Downloaded folder

When you check the installation folder, you will be able to see the installation program. Install PyCharm onto your machine.

 

Creating a new project

After the installation of PyCharm, we will create a new project in order to implement our first Python code snippet:

  1. Open PyCharm and you will see the Projects section:

Figure 1.6 – PyCharm IDE

  1. Add a project name:

Figure 1.7 – Creating a new project

  1. The project is ready to be implemented. Right-click and then click Run ‘main’:

Figure 1.8 – Sample project

  1. The command runs the application:

Figure 1.9 – Running the application

Congrats! You have created your first project within PyCharm.

 

Summary

In this chapter, we explored the cloud basics and advantages. After that, we installed Python and one of the most popular and useful IDEs, PyCharm. PyCharm will be our main tool in order to implement the applications for AWS.

In the next chapter, we will sign up for AWS to have an account on the cloud.

About the Author
  • Serkan Sakinmaz

    Serkan SAKINMAZ is a data architect and engineer who lives in Germany. He is currently giving consultancy on the data and cloud area to the key companies in Europe. He has also been giving big data training to the students as well as professionals who want to learn about cloud technologies. He has more than 15 years' experience in programming and more than 8 years' experience in the cloud area. He likes to share what he knows and experiences in the sector, gives seminars, write blogs and defines the future of architecture for key companies. In this book, Serkan will share his experiences. When he is not working, he mostly spends his time with his family, go running, playing table tennis and football.

    Browse publications by this author
Python Essentials for AWS Cloud Developers
Unlock this book and the full library FREE for 7 days
Start now