#90DaysOfDevOps Challenge - Day 42 - IAM Programmatic access and AWS CLI

Cloud Engineer and DevOps enthusiast, just talking about AWS, Docker, Linux, Kubernetes, Python, and automation.
Search for a command to run...

Cloud Engineer and DevOps enthusiast, just talking about AWS, Docker, Linux, Kubernetes, Python, and automation.
No comments yet. Be the first to comment.
The #90DaysOfDevOps Challenge is a dedicated initiative aimed at promoting continuous learning and skill development in the field of DevOps over a 90-day period.
Welcome to Day 41 of the #90DaysOfDevOps Challenge. In today's session, we will explore the concept of load balancing and focus on setting up an Application Load Balancer (ALB) with AWS EC2. Load balancing is a critical component in distributed syste...
Running your own home lab used to mean expensive hardware, complex networking, and hours of manual configuration. This project changes that. With a single Raspberry Pi, Docker Compose, and a few hundr

Welcome to an advanced hybrid directory demo where we'll guide you through setting up a hybrid environment, connecting to simulated on-premises infrastructure, creating a managed Microsoft AD within AWS, establishing a two-way forest trust, and integ...

Hello DevOps Community! Today marks the completion of the #90DaysOfDevOps Challenge, and it's a moment to reflect on the journey we've undertaken together. Throughout this period, I've engaged with various technologies, refining my skills in the DevO...

In a modern cloud infrastructure setup, creating a robust and scalable 2-tier architecture is essential. Such an architecture helps meet the demands of your applications while ensuring repeatability, reliability, and security. In this article, we'll ...

Welcome to Part 4 of my series on building a comprehensive CI/CD pipeline in AWS. In this article, I will explore AWS CodePipeline, a powerful service for building and deploying applications in a continuous integration and continuous delivery (CI/CD)...

Welcome to Day 42 of the #90DaysOfDevOps challenge. Today, we will explore IAM programmatic access and the AWS Command Line Interface (CLI). These tools are essential for managing and interacting with your AWS resources efficiently. Let's dive in and learn how to leverage these powerful features.
IAM (Identity and Access Management) is a powerful service in AWS that allows you to control access to your resources. IAM programmatic access enables you to manage access to AWS services securely using access keys. By leveraging access keys, you can automate tasks, integrate with other applications, and maintain fine-grained control over resource access.
The AWS Command Line Interface (CLI) is a versatile and comprehensive tool that empowers you to manage your AWS services directly from the command line. With AWS CLI, you can control multiple services, automate tasks, and seamlessly integrate AWS operations into your scripts and workflows. The latest version, AWS CLI v2, introduces numerous enhancements, including improved installers and additional configuration options, such as AWS IAM Identity Center (the successor to AWS SSO).
Streamlined Management: With AWS CLI, you can perform a wide range of administrative tasks, such as creating and managing resources, configuring security settings, and monitoring service status, without leaving your command-line interface.
Automation and Scripting: AWS CLI allows you to automate repetitive tasks, create scripts for complex workflows, and build customized solutions. This enables you to optimize your workflow and improve efficiency.
Seamless Integration: Integrate AWS CLI commands into your existing scripts, workflows, and DevOps toolchains to orchestrate AWS services alongside your infrastructure and applications. This facilitates seamless collaboration and reduces manual effort.
Flexibility and Portability: AWS CLI is platform-independent and runs on various operating systems, making it highly flexible and portable. Whether you're working on Linux, macOS, or Windows, you can harness the power of AWS CLI to manage your AWS resources consistently.
These commands are just a starting point, and there are many more AWS CLI commands available for various AWS services. You can explore the AWS CLI documentation for a comprehensive list of commands and their usage.
aws configure - Set up your AWS CLI configuration by providing your access key, secret key, default region, and output format.
aws s3 ls - This command lists all the S3 buckets in your AWS account.
aws s3 mb s3://bucket-name - This command creates a new S3 bucket with the specified name.
aws s3 rb s3://bucket-name - This command deletes the specified S3 bucket.
aws s3 cp file.txt s3://bucket-name - This command uploads a file to an S3 bucket.
aws s3 cp s3://bucket-name/file.txt . - This command downloads a file from an S3 bucket to your local file system.
aws s3 sync local-folder s3://bucket-name - This command syncs the contents of a local folder with an S3 bucket.
aws s3 ls s3://bucket-name - This command lists the objects in an S3 bucket.
aws s3 rm s3://bucket-name/file.txt - This command deletes an object from an S3 bucket.
aws s3 presign s3://bucket-name/file.txt - This command generates a pre-signed URL for an S3 object, which can be used to grant temporary access to the object.
aws s3api list-buckets - This command retrieves a list of all S3 buckets in your AWS account, using the S3 API.
aws ec2 describe-instances - Retrieve information about your EC2 instances.
aws lambda list-functions - List all the Lambda functions in your AWS account.
aws rds describe-db-instances - Get details about your RDS database instances.
aws cloudformation describe-stacks - Retrieve information about your CloudFormation stacks.
aws iam list-users - List all IAM users in your AWS account.
aws sqs list-queues - Get a list of your Amazon Simple Queue Service (SQS) queues.
aws ecs list-services - List all the services in your Amazon Elastic Container Service (ECS) cluster.
aws eks describe-cluster - Get details about your Amazon Elastic Kubernetes Service (EKS) cluster.
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from AWS ConsoleLog in to the AWS Management Console.
Open the IAM service.
Navigate to the "Users" section.
Select the user for whom you want to create access keys.
Open the "Security credentials" tab.

Under the "Access keys" section, click on "Create access key". Use case "Command Line Interface (CLI)"

Take note of the generated AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. These will be needed later for configuration.

To get started with AWS CLI, follow these steps:
Install AWS CLI on your local machine. Refer to the official AWS CLI documentation for installation instructions tailored to your operating system.
Once installed, open a terminal or command prompt.
Run the following command to configure AWS CLI:
aws configure
When prompted, enter the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY obtained in Task 1.
Specify your preferred region (e.g., us-west-2) and default output format (e.g., YAML).

AWS CLI is now configured with your account credentials. We can verify it's working as expected by checking the available instances in AWS.
aws ec2 describe-instances

By completing these tasks, you have set up IAM programmatic access and the AWS CLI, enabling you to manage your AWS resources efficiently from the command line.
Congratulations on completing Day 42 of the #90DaysOfDevOps Challenge. Today, we dived into the world of IAM Programmatic Access and AWS CLI, exploring how to securely manage access to AWS services and simplify management from the command line. Tomorrow, we will explore S3 Programmatic Access with AWS CLI. Stay tuned!