How to AWS Assume Role and then revert to the previous role after

If you need to assume a role in AWS and then revert back to the previous role once complete, you can use the following snippet of code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 # Save original environment variables ORIGINAL_AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" ORIGINAL_AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" ORIGINAL_AWS_SESSION_TOKEN="$AWS_SESSION_TOKEN" # Assume the role and store the output in a variable assume_role_output=$(aws sts assume-role --role-arn arn:aws:iam::12345678912:role/YourCrossAccountAccessRole --role-session-name "AssumeRoleSession") # Extract temporary credentials from the assume role output using jq (JSON processor) export AWS_ACCESS_KEY_ID=$(echo "$assume_role_output" | jq -r '.

Essential Policies for Administering an AWS EKS Cluster

So, what policies does my role need to create an AWS EKS cluster and be the admin? AmazonEKSClusterPolicy: This policy grants permissions to create and manage EKS clusters. It includes actions like eks:CreateCluster, eks:DescribeCluster, eks:UpdateClusterConfig, eks:DeleteCluster, etc. AmazonEKSServicePolicy: This policy allows the necessary permissions for the EKS service to manage resources on your behalf. It includes actions like eks:DescribeUpdates, eks:ListClusters, eks:ListUpdates, etc. AmazonEKSServiceRolePolicy: This policy is attached to the IAM role assumed by the EKS service.

Show the Top 10 Largest Directories on Linux

If you need to see the top 10 largest directories on your Linux system, you can use the following command: 1 du -h --max-depth=1 / | sort -rh | head -n 11 Alternative If you are okay to install additional software, then you can use a tool like ncdu to do the same, but with a lot more options and more features. Installing ncdu ncdu is a software package that standards for “NCurses Disk Usage” and is a disk utility tool for Unix based systems.

Retrieve the Latest Versioned Tag from AWS ECR in Bash

Managing Docker images in Amazon Elastic Container Registry (ECR) is a common task for many developers and DevOps practitioners. Often, you need to retrieve the latest versioned tag from a repository to streamline deployment processes or ensure compatibility with the most recent features or fixes. In this post, we’ll explore a simple Bash command using the AWS CLI and jq to fetch the latest versioned tag from an ECR repository.

How to install MySQL on AmazonLinux2023

If you are using Amazon Linux 2023 base-image, and you have tried to run yum install -y mysql, you will soon realize that it doesn’t work. Instead install MySQL on Amazon Linux 2023 like this: 1 2 sudo dnf update -y sudo dnf install mariadb105-server For advanced use-cases where you are installing this in a Docker-in-Docker environment, do it without the sudo, as follows: 1 2 dnf update -y dnf install mariadb105-server Now if you run mysql, you will no longer get the mysql: command not found message.

Run any version of Terrform using Docker

So our friend Docker comes around for another usecase. Run Terraform (any version) from Docker In this example, we will try and configure Terraform 1.4.0 through Docker, so that we don’t need to install it on our host system. 1 alias terraform14='docker run --rm -it -w $PWD:$PWD -v $PWD:$PWD hashicorp/terraform:1.4.0' To use it, we simply run a Terraform command: 1 terraform14 -version Next let’s try another Terraform version as well 1 alias terraform15='docker run --rm -it -w $PWD:$PWD -v $PWD:$PWD hashicorp/terraform:1.

Select * to Show Database Table Sizes MariaDB

In database management, understanding the size of your tables is crucial for optimizing performance and ensuring efficient resource utilization. If you’re a technical enthusiast or a seasoned database administrator working with MariaDB, this blog post is tailored just for you. Today, we’ll unravel the mystery behind MariaDB database table sizes using a powerful SQL query. 1 2 3 4 5 6 7 8 SELECT table_schema AS DB_NAME, TABLE_NAME, (DATA_LENGTH+INDEX_LENGTH)/1024/1024/1024 AS TABLE_SIZE_in_MB FROM information_schema.

The Future Prospects of DevOps in an AI World

Abstract DevOps has become an integral part of modern software development, emphasizing communication and collaboration between software developers and IT operations professionals. However, with the rise of artificial intelligence (AI), the future role and necessity of devops has been brought into question. This paper explores the prospects for devops in an increasingly AI-driven world, including devops’ potential contributions to and collaboration with AI, as well as the possibility of eventual replacement by intelligent systems.

Supercharge Your Code with Amazon CodeWhisperer

Amazon CodeWhisperer is a cutting-edge service that leverages advanced AI and machine learning to provide real-time code generation, recommendations, and security analysis. As a developer, CodeWhisperer can supercharge your productivity and code quality. Key Capabilities Neural Code Generation CodeWhisperer utilizes powerful neural networks to generate code snippets and entire functions on demand. The advanced models are trained on millions of code samples and can produce idiomatic, human-readable code for a wide variety of programming languages.

A Deep Dive into Machine Learning Algorithms

Machine learning algorithms are the backbone of modern artificial intelligence. They enable computers to learn and make predictions or decisions without being explicitly programmed. In this comprehensive guide, we will delve into common machine learning algorithms, providing detailed explanations and code examples to help you understand their inner workings. Whether you’re a beginner or an experienced data scientist, this post will be a valuable resource to enhance your understanding of machine learning.

What is GitHub? A Comprehensive Guide from Basics to Advanced

GitHub is a platform that has revolutionized the world of software development, enabling individuals and teams to collaborate efficiently on projects of all sizes. In this comprehensive guide, we’ll explore GitHub from the very basics to the most advanced features. Whether you’re a novice or an experienced developer, you’ll find valuable insights and tips to enhance your understanding of GitHub. Part 1: Git Basics Before diving into GitHub, it’s essential to grasp the fundamental concepts of Git, the version control system that underlies GitHub.

Connect IPv4 and IPv6 Networks Seamlessly with Amazon VPC Lattice

As the internet continues to grow, the transition from IPv4 to IPv6 has become more critical. Organizations need to manage both IP stacks efficiently and ensure seamless connectivity. Amazon Web Services (AWS) offers a groundbreaking solution: Amazon VPC Lattice. In this advanced guide, we’ll delve deeper into Amazon VPC Lattice, its technical details, and provide code examples for advanced users. A Lattice of Connectivity Amazon VPC Lattice simplifies the coexistence of IPv4 and IPv6 stacks within your Virtual Private Cloud (VPC).

Building Event-Driven Architectures with Amazon EventBridge

In the realm of real-time data streaming applications, managing the routing and processing of events efficiently is a complex challenge. Amazon Web Services (AWS) has a powerful solution: Amazon EventBridge. In the realm of real-time data streaming applications, managing the routing and processing of events efficiently is a complex challenge. Amazon Web Services (AWS) has a powerful solution: Amazon EventBridge. In this advanced guide, we’ll delve deeper into EventBridge, its key concepts, and provide code examples for advanced users.

Splitting Terraform Modules into Separate Git Repositories

In the world of Infrastructure as Code (IaC), Terraform has emerged as a powerful tool for managing infrastructure resources. As your Terraform codebase grows, managing monolithic code can become challenging. In this advanced-level blog post, we will explore the process of moving Terraform modules into separate Git repositories and referencing these modules across multiple repositories. This approach can help you achieve better code organization, reusability, and collaboration in your infrastructure provisioning projects.

Accelerating Machine Learning with SageMaker Jumpstart

Machine learning (ML) projects can be complex, time-consuming, and resource-intensive. Amazon SageMaker Jumpstart aims to change that by providing pre-built solutions, pre-trained models, and end-to-end ML capabilities. In this advanced guide, we’ll dive deep into SageMaker Jumpstart and provide code examples to illustrate its power. Unleashing ML Potential Amazon SageMaker Jumpstart is designed to accelerate your ML journey. It offers a wide range of pre-built solutions and pre-trained models for various ML use cases, including natural language processing, computer vision, and more.

Understanding the AWS Well-Architected Framework

The AWS Well-Architected Framework is more than just a set of best practices; it’s a blueprint for success in the cloud. It offers a comprehensive guide to building high-quality, efficient, and cost-effective architectures on Amazon Web Services (AWS). In this blog post, we’ll delve into the key principles and pillars of the AWS Well-Architected Framework and explore how you can leverage it to ensure your cloud infrastructure is robust and resilient.

Mastering Advanced Networking in EKS and Kubernetes

Kubernetes has revolutionized container orchestration, and Amazon’s Elastic Kubernetes Service (EKS) is one of the most popular managed Kubernetes solutions available today. While getting started with EKS and Kubernetes is relatively straightforward, mastering advanced networking topics is essential for managing complex workloads and achieving optimal performance. In this comprehensive guide, we will explore advanced networking concepts in EKS and Kubernetes, accompanied by code examples and practical insights. 1. VPC Design and EKS Setup When working with EKS, it’s crucial to have a well-architected VPC.

How to Ignore SSL Certificates Globally in Git

In the world of software development, Git is an indispensable tool for version control. However, when working with repositories that use SSL certificates, you might encounter situations where you need to ignore SSL certificate verification globally. Whether it’s for testing or debugging purposes, this guide will show you how to ignore SSL certificates globally in Git and even disable SSL certificate checks altogether. We’ll cover everything from the basics to advanced configurations to help you manage SSL certificates effectively in your Git workflow.

Semantic Versioning with npm

Semantic Versioning, often referred to as SemVer, is a crucial convention within the Node.js ecosystem. It provides a clear and structured way of versioning software, ensuring that developers can easily understand the impact of version changes. In this blog post, we’ll explore the principles of Semantic Versioning and how npm (Node Package Manager) leverages it to manage packages effectively. Understanding Semantic Versioning Semantic Versioning is based on a three-digit version number, often expressed as x.

Understanding Peer Dependencies in Node Modules

When working with Node.js and managing packages for your projects, you’re likely familiar with the dependencies and devDependencies sections in a package.json file. These sections define the packages your project depends on for both production and development purposes. However, there’s another crucial field often overlooked but equally important: peerDependencies. In this blog post, we will delve into the concept of peerDependencies and how they differ from regular dependencies and devDependencies.