Book Image

AWS for System Administrators

By : Prashant Lakhera
Book Image

AWS for System Administrators

By: Prashant Lakhera

Overview of this book

Amazon Web Services (AWS) is one of the most popular and efficient cloud platforms for administering and deploying your applications to make them resilient and robust. AWS for System Administrators will help you to learn several advanced cloud administration concepts for deploying, managing, and operating highly available systems on AWS. Starting with the fundamentals of identity and access management (IAM) for securing your environment, this book will gradually take you through AWS networking and monitoring tools. As you make your way through the chapters, you’ll get to grips with VPC, EC2, load balancer, Auto Scaling, RDS database, and data management. The book will also show you how to initiate AWS automated backups and store and keep track of log files. Later, you’ll work with AWS APIs and understand how to use them along with CloudFormation, Python Boto3 Script, and Terraform to automate infrastructure. By the end of this AWS book, you’ll be ready to build your two-tier startup with all the necessary infrastructure, monitoring, and logging components in place.
Table of Contents (18 chapters)
1
Section 1: AWS Services and Tools
4
Section 2: Building the Infrastructure
7
Section 3: Adding Scalability and Elasticity to the Infrastructure
11
Section 4: The Monitoring, Metrics, and Backup Layers

Rotating IAM credentials using Boto3

Rotating an access key (including access key IDs and secret access keys) regularly is a security best practice. It reduces the blast radius of damage if the security key is compromised.

Note

AWS strongly recommends the use of IAM roles as it uses temporary security credentials. STS will automatically take care of rotating and expiring those credentials, so we don't need to worry about this. However, in cases where our application runs somewhere other than EC2, we need to add key rotation as part of the application life cycle.

Prerequisites

Before executing the Boto3 script, please create a new key for the user, in addition to the one that is in use. IAM only allows two access keys. Before generating a new key for the user, we need to list the existing keys; if the user already has two keys, our Boto3 script will fail if we try to generate a new key (third key). Listing a key is an important step as it will provide us with a safety...