Category "boto3"

Boto 3 filter_log_events returns null but describe_log_streams gives correct values

I am trying to retrieve cloud watch logs from log group /frontend/lambda/FEservice. The logs are stored in multiple stream with pattern YYYY/MM/DD/[$LATEST]* Ex

MLflow: Unable to store artifacts to S3

I'm running my mlflow tracking server in a docker container on a remote server and trying to log mlflow runs from local computer with the eventual goal that any

I don't know how to query certain data from my DynamoDB table using Boto3

This is my first time using boto3 to query items from my DynamoDB and I can't figure out how to grab a certain value. My table has a primary key of "Company" an

AWS boto3 Cognito Invalid Access Token Error

I have a Python lambda function processing an API request from a user to change their password. The API for change_password is as follows response = client.chan

Trying to exclude specific files from AWS S3 Lifecycle Configuration

We need to implement an expiration of X days of all customer data due to contractual obligations. Not too big of a deal, that's about as easy as it gets. But a

Error when doing a PUTITEM type: <class 'str'>, valid types: <class 'dict'>

When doing a putitem to dynamo it is giving me the following error, the json I am reading from s3. this is the code dictItems = json.load(object_summary.get(

What's the Difference between "Groups" and "SecurityGroups" in .describe_instances() Boto3 AWS?

So I was using .describe_instances() to pull information about my companies EC2 instances. I noticed that for each instance under "NetworkInterfaces", it includ

Python Lambda function using boto3 uploads 0 bytes image file to s3

My use case is that I'm trying to take a screenshot of a view in Tableau, and save that screenshot in a bucket in s3. This is done through a Lambda function wri

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