Category "boto3"

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

I'm trying to type annotate around boto3, but module 'botocore.client' has no attribute 'EC2'

I'm writing my own wrapper around boto3 for quick firing functions. I'm trying to type annotate what boto3.session().client('ec2') returns. Debugger says it's &

How to get file path from UploadFile in FastAPI?

Basically, I'm trying to create an endpoint to Upload files to Amazon S3. async def upload_files(filepath: str, upload_file_list: List[UploadFile] = File(...)):

Boto3 scan not scanning whole table

I want to fetch a list of objects from a DynamoDB table with the following scan video_list = video_table.scan( FilterExpression="attribute_not_exists(ti

boto3 aws iot - how can I check if certificate has attached things to it?

in aws iot- with boto3 (python) I want to check if a certificate has attached things to it. how can I do that? Thanks.

Boto3 S3, sort bucket by last modified

I need to fetch a list of items from S3 using Boto3, but instead of returning default sort order (descending) I want it to return it via reverse order. I know

Pytest-cov with Moto in list_stacks() from Boto3

I'm trying to create a test with pytest and moto that check if the StackStatus from the dictionary returned from the function list_stacks() (https://boto3.amaz

Can't log MLflow artifacts to S3 with docker-based tracking server

I'm trying to set up a simple MLflow tracking server with docker that uses a mysql backend store and S3 bucket for artifact storage. I'm using a simple docker-

Attach / Detach Security Group from EC2 instance using boto3

How can I go about disassociating a particular security group from all EC2 instances and then associate it with a new EC2 instance, with boto3? I'm trying somet

ClientError:An error occurred(AccessDenied)when calling the AssumeRole operation:MultiFactorAuthentication failed with invalid MFA one time pass code

import boto import boto3 from boto.s3.connection import S3Connection from boto.sts import STSConnection # Prompt for MFA time-based one-time password (TOTP) mf