How to specify credentials when connecting to boto3 S3

0 votes

Hi Guys,

I am new to the AWS boto3 module. How can I specify the credentilas in boto3 while connection to S3 bucket?

Sep 22, 2020 in AWS by akhtar
• 38,230 points
616 views

1 answer to this question.

0 votes

Hi@akhtar,

You need to create a session in your boto3. There you can provide the ID and key in your file. You can see the below example.

import boto3
session = boto3.Session(
    aws_access_key_id=settings.AWS_SERVER_PUBLIC_KEY,
    aws_secret_access_key=settings.AWS_SERVER_SECRET_KEY,
)
answered Sep 22, 2020 by MD
• 95,440 points

Related Questions In AWS

0 votes
2 answers

How to skip headers when reading a CSV file in S3 and creating a table in AWS Athena?

Thanks for the answer. This should be clear ...READ MORE

answered Aug 14, 2019 in AWS by athenauserz
11,187 views
+1 vote
1 answer

Invalid hostname error when connecting to S3 using secret key

Hey, it works perfectly fine you just ...READ MORE

answered Oct 11, 2018 in AWS by Archana
• 4,170 points
3,929 views
0 votes
1 answer

Import my AWS credentials using python script

Using AWS Cli  Configure your IAM user then ...READ MORE

answered Nov 16, 2018 in AWS by Jino
• 5,810 points
2,558 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 58,090 points
5,388 views
–1 vote
1 answer

How to decrypt the encrypted S3 file using aws-encryption-cli --decrypt

Use command : aws s3 presign s3://mybucket/abc_count.png you get ...READ MORE

answered Oct 22, 2018 in AWS by Priyaj
• 58,090 points
4,828 views
0 votes
1 answer

How to open S3 object as a string with Boto3?

Hi@akhtar, If you want to return a string, you ...READ MORE

answered Sep 21, 2020 in AWS by MD
• 95,440 points
3,866 views
0 votes
1 answer

How to download S3 Objects With Python and Boto3?

Hi@akhtar, You can download one file from a ...READ MORE

answered Oct 8, 2020 in AWS by MD
• 95,440 points
2,411 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP