Configure AWS Profile

To configure AWS profile, run the below command

aws configure

Configure AWS Credentials with default profile

This command has an optional argument profile, if you don’t pass this argument it will configure for profile name `default`, and this will be your defaut aws profile.

Configure AWS profile with name

aws configure --profile <profile-name>

It prompts for Access key, secret key, default region, and output format.

Configure Additional Profiles

In the same way as above we can configure multiple profiles by providing the appropriate profile names.

aws configure --profile myprofile2

aws configure --profile myprofile3

Configure AWS Credentials with custom profile

How To Manage Multiple AWS Profiles For Boto3

Amazon Web Services (AWS) is a leading cloud provider, it provides us with a variety of cloud services that are scalable globally, including compute, database, storage, analytics, developer tools, and enterprise applications. You can launch cloud resources, start building applications, and deploy them globally with ease. AWS will take care of most of the things. It works based on the pay-as-You-Go pricing model, which means you need not pay anything before utilizing the resources, you’ll pay on the go.

Similar Reads

Prerequisites

To try the stuff mentioned in this article, you should be ready with the following:...

Installations

If you haven’t set up your system for Boto3 yet, follow the below steps...

What is AWS Profile?

AWS profiles are just named configurations that you can use to organize your credentials across multiple AWS accounts, accounts can be from same account or from multiple accounts, each profile has it’s own Access Key, Secret key and other basic user preferences....

Why do we even need Multiple profiles?

When managing multiple projects, each with distinct AWS configurations or handling personal and work-related accounts, organizing and dynamically utilizing credentials becomes crucial. AWS offers a solution by allowing you to configure profiles for each user, ensuring seamless and organized access to different accounts based on specific project requirements. This approach streamlines the process of switching between user accounts, facilitating efficient and secure development across various scenarios....

AWS Profile Terms

ACCESS_KEY: The AWS Access Key is a unique identifier associated with an AWS account or IAM user.It serves as a credential to access AWS services programmatically through APIs or command-line tools.Access keys are used in conjunction with the AWS Access Key ID for authentication.You can think of it as an username for AWS cli....

Configure AWS Profile

To configure AWS profile, run the below command...

Accessing resources with specific profile

Note: We’re just using an sample IAM boto3 api call for demonstrating the scenario...

Set default profile in boto3

Unlike specifying the profile in the session, we can set default profile for the boto3 like below:...

Conclusion

In this article we leanrnt how to create multiple profiles in aws cli, and access resources using specific profile with differnt methods.Multiple profiles allow us to work on different projects, each with its unique AWS configuration, ensuring separation and security....

Manage Multiple AWS Profiles for Boto3 – FAQ’s

How many profiles can i configure?...