Questions tagged [boto3]

Boto 3 - The Amazon Web Services (AWS) SDK for Python

About

Boto is the Amazon Web Services (AWS) software development kit (SDK) for Python, which allows Python developers to write software that makes use of services like Amazon S3 and Amazon EC2. Boto provides an easy to use, object-oriented API as well as low-level direct service access.

Links

7627 questions
2
votes
1 answer

How to point to the ARN of a dynamodb table instead of using the name when using boto3

I'm trying to access a dynamodb table in another account without having to make any code changes if possible. I've setup the IAM users, roles and policies to make this possible and have succeeded with other services such as sqs and s3. The problem I…
Damian Jacobs
  • 488
  • 6
  • 21
2
votes
2 answers

IAM Permissions Errors When Using boto3 for AWS Comprehend

I'm playing around with the command line to run some sentiment analysis through aws and am running into some IAM issues. When running the "detect_dominant_language" function, I'm hitting NotAuthorizedExceptions despite having the policy in place to…
2
votes
0 answers

How to add the service name using env vairables in serverless.yml

I am trying to set the serverless service name from the env file. I have written it as service: ${env:SERVICE_NAME} It worked perfectly in previous versions of serverless framework. However since I upgraded it to the latest version, it has started…
2
votes
1 answer

How to use aws boto3 put_object to stream download/upload

I use put_object to copy from s3 bucket to another cross-region, cross-partition. The problem is the file sizes have become more unpredictable and since get_object stores to memory, I end up giving it more resource than it needs most of the…
edmamerto
  • 7,605
  • 11
  • 42
  • 66
2
votes
1 answer

SQLStatement is longer than 65536 error when inserting data

I am doing a bulk operation for insertion and suddenly started getting this following error . what I am doing wrong ? query consist of 50 rows of data . How I can fix this ? botocore.errorfactory.BadRequestException: An error occurred…
TNN
  • 391
  • 1
  • 5
  • 12
2
votes
2 answers

Boto3 not generating correct signed-url

I've a use case where I use lambda function to generate signed URL to upload to an S3 bucket, I also set the metadata values when generating signed URL, my boto3 version is boto3==1.18.35. Previously when I generate the signed-url to upload to the…
WatchMyApps Lab
  • 113
  • 1
  • 7
2
votes
2 answers

Example for using Locust with Boto3

I am trying to use Locust together with Boto3 for load testing of S3, in particular for PutObject. I found a tutorial and another github project, but both have been written for the older locustio package and seem incompatible with the current…
2
votes
0 answers

Mount different EFS volumes on AWS Batch at submit_job

I need to mount different EFS volumes on the containers I’m running with AWS Batch (with Fargate), depending on the user of my system. With boto3 this looks doable with setting the volumes and mountPoints arguments of the register_job_definition…
2
votes
0 answers

What is the difference between getting no prefix key and getting a prefix key with empty string value in get_bucket_lifecycle API response?

I'm running a python program that uses boto3 get_bucket_lifecycle_configuration API to get lifecycles set on a given bucket. I'm getting the following response - {"Rules":[ { "Filter":{ "Prefix":"" …
SAIJAL
  • 162
  • 9
2
votes
1 answer

AWS boto3 Error: 'LocationService' object has no attribute 'search_place_index_for_suggestions'

I'm running into a no attribute error with the latest version of boto3. As far as I'm concerned, I'm referencing the latest documentation (here -- note '/api/latest' in the URL), so I'm at a loss as to what I'm doing wrong. The code is really no…
Dan
  • 4,197
  • 6
  • 34
  • 52
2
votes
1 answer

Is transact_write_items the right choice to write data into dynamodb?

I have a use case to write thousands of items into a dynamodb table(a lookup table) from a dataframe in AWS Glue. I also want the entire write transaction to fail/rollback in case of AWS Glue job fails. This is to ensure we have a cleaner re-start…
Prabhu
  • 43
  • 1
  • 7
2
votes
1 answer

Getting top 3 languages used in text using AWS comprehend

I am trying to auto-detect languages used from texts using AWS Comprehend service. Using boto.detect_dominant_language we only get the top dominating language in the text. Is there a way to get the top 2-3 dominant languages in text for AWS…
2
votes
1 answer

How to mock a ZipFile object in S3?

I'd like to test uploading an archive to S3 bucket. This archive is unzipped so I'd like to test the extracted JSON files as well. Here is what I want to test: def get_files_from_s3(bucket_name, s3_prefix): files = [] s3_resource =…
ezzeddin
  • 499
  • 2
  • 5
  • 25
2
votes
1 answer

What is the boto3 equivalent of aws s3 ls?

I am trying to replicate the command aws s3 ls s3://bucket/prefix/ using boto3. Currently, I am able to grab all the objects within the path using s3 = boto3.client('s3') bucket = "my-bucket" prefix = "my-prefix" paginator =…
Alan
  • 96
  • 2
  • 9
2
votes
0 answers

Boto3 - get data from a generator and write to AWS S3 object?

I have the following function to read data from a generator source(), which yield chunks of data (the length of the chunk is not fixed). And the data need to be written to a S3 object. import boto3 async def write_s3(s3_key): session =…
ca9163d9
  • 27,283
  • 64
  • 210
  • 413