Set default profile in boto3
Unlike specifying the profile in the session, we can set default profile for the boto3 like below:
import boto3
boto3.setup_default_session(profile_name='myprofile')
client = boto3.client("iam")
response = client.get_user(
UserName='myname'
)
Here in this case, once you’ve configured default profile for boto3, so until the end of the code, you need not mention profile again specifically, it will pick the confiogured profile by default.
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.