Category "boto3"

How to download files from S3 to a custom folder or a network path using boto3

Below is the function to download the files from a S3 Bucket. But the problem is I can't find how to direct those files into a network path instead of downloadi

Create Global Secondary Index (GSI) for DynamoDB using Boto3 in Python

I'm creating a DynamoDB table using the Python boto3 package: import boto3 ddb = boto3.resource('dynamodb') table = ddb.create_table( TableName = "MyTable",

AWS Cognito - Possible to resend Signup Email with temporary password?

After searching the official AWS CLI cognito-idp documentation, it seems there is no way to 'reset' a user back into a FORCE_CHANGE_PASSWORD state once that use

Listing objects in S3 with suffix using boto3

def get_latest_file_movement(**kwargs): get_last_modified = lambda obj: int(obj['LastModified'].strftime('%s')) s3 = boto3.client('s3') objs = s3.li

Programmatically establish boto3 sessions with AWS SSO

I'm trying to establish a boto3 session with boto3.session.Session(profile_name='foo') but getting an UnauthorizedSSOTokenError error: botocore.exceptions.Unau

How to extract data from grib files in AWS without downloading?

I'm looking to access a grib file to extract parameters (such as temperature, etc) from within the cloud without ever having to store the file locally. I've hea

boto3 generate_presigned_url with SSE encryption

I am looking for examples to generate presigned url using boto3 and sse encryption. Here is my code so far s3_client = boto3.client('s3',

How to write pytest for boto3 lambda invoke when it is defined inside a function

I am trying to write pytest to test the following method by mocking the boto3 client. I tried with sample test case. I am not sure if that is right way to do it

How do I mock boto3's StreamingBody object for processing with BytesIO in Python?

I'm unittesting a function that transforms an element from an S3 object into a pandas DataFrame and need to mock the returned StreamingBody object from boto3 f

How to filter AWS roles by tags in boto3?

I'm trying to get list of roles with special tags Python version 3.9 Boto3 version 1.16.25 There is my code iam = boto3.client('iam', region_name='us-east-1') r

how to insert a nested dict to dynamodb with boto3?

we construct some data which is in nested format, it contains 3 keys. the time, id and others where id contains another nested dict. We have no idea how to crea

Get count of objects in a specific S3 folder using Boto3

Trying to get count of objects in S3 folder Current code bucket='some-bucket' File='someLocation/File/' objs = boto3.client('s3').list_objects_v2(Bucket=buck

Is there a way to move all files with specific file extensions from one folder to another in S3 using Boto3 python?

I'm trying to move all files of specific file extensions from one folder to another using the S3 API. The code I'm using to move files is: s3_resource = boto3.r

Enable/Disable or delete aws lambda trigger on s3:Objectcreated.* using python

I have a lambda function that triggers when any new objectCreated(s3:Objectcreated.*) in a Bucket A-prod, This lambda process the file saves the result in B-pro

Read h5 file using AWS boto3

I am trying to read h5 file from AWS S3 using boto3. client = boto3.client('s3',key ='key') result = client.get_object(Bucket='bucket', Key='file') with h5py.F

Required parameter name not set - Django + Amazon S3

I'm trying to setup Amazon S3 for my Django app and I keep getting told 'Required parameter name not set '. This error seems to happen when an image needs to be

how to import boto3 athena client exceptions

I am working with athena from within my python code, using boto3, as follows: def query_athena(query, output_path): client = boto3.client('athena') clie

Query aws to list all resources using boto3 python sdk

Is there a way to get all the resources in the aws account through python code using boto3. I went through the documentation, didn't find any list function whic

DynamoDb delete with sort key

I have fields below in dynamo dB table event_on -- string type user_id -- number type event name -- string type Since this table may have multiple records for

FileNotFoundError when reading .h5 file from S3 in python using Pandas

For some reason, when I attempt to read a hdf file from S3 using the pandas.read_hdf() method, I get a FileNotFoundError when I put an s3 url. The file definite