Category "boto3"

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

How to use asyncio to download files on s3 bucket

I'm using the following code to download all my files in a s3 bucket: def main(bucket_name, destination_dir): bucket = boto3.resource('s3').Bucket(bucket_n

Is there a way to restart an Replication Task in DMS without recreating the task itself?

I'm getting this error when trying to restart my DMS Replication TASK with start_replication_task Boto3 method: An error occurred (InvalidParameterCombinationEx

S3 Ninja endpoint throws could not connect error when using Boto3 S3 resource

I am attempting to use S3 Ninja with boto3 in Python, but despite the docker container running, I am unable to configure the S3 client to use S3 Ninja. When att

Calculate the size of all files in a bucket S3

I want to calculate the size of all files that are in a S3 bucket in python and this is the code I tried so far: import boto3 s3_client = boto3.client('s3') b

How to download everything in that folder using boto3

I want to download all the csv files that exist in s3 folder(2021-02-15). I tried the following, but it failed. How can I do it? import boto3 s3 = boto3.resour

Error "Read-only file system" in AWS Lambda when downloading a file from S3

I'm seeing the below error from my lambda function when I drop a file.csv into an S3 bucket. The file is not large and I even added a 60 second sleep prior to o

DiskSpaceUtilization metrics for EC2 instance in python boto script showing empty response

I want to get the datapoints for DiskSpaceUtilization metrics but the response for get_metrics_statitics is empty. The get_metrics_statitics function works per

How to use Boto3 pagination

BACKGROUND: The AWS operation to list IAM users returns a max of 50 by default. Reading the docs (links) below I ran following code and returned a complete set

Why is AWS telling me BucketAlreadyExists when it doesn't?

I'm in the process of automating the setup of some AWS services using AWS SDK for Python (boto3) and running into a very simple problem of creating an S3 bucket

How to use boto3 (or other Python) to list the contents of a _RequesterPays_ S3 bucket?

You can download a file via boto3 from a RequesterPays S3 bucket, as follows: s3_client.download_file('aws-naip', 'md/2013/1m/rgbir/38077/{}'.format(filename

Download a folder from S3 using Boto3

Using Boto3 Python SDK, I was able to download files using the method bucket.download_file() Is there a way to download an entire folder?