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 21 in AWS by akhtar
• 28,160 points
36 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 21 by MD
• 65,200 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
4,238 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,150 points
932 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,770 points
1,288 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
• 57,680 points
1,294 views
0 votes
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
• 57,680 points
2,157 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 in AWS by MD
• 65,200 points
35 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 7 in AWS by MD
• 65,200 points
37 views