amazon-web-services

Does anyone know how I can read PDFs off of a S3 bucket using `pdfplumber`?

Does anyone know how I can read PDFs off of a S3 bucket using `pdfplumber`? Question: I’m trying to read PDF files that are stored in a S3 bucket, using a Python package called pdfplumber. I tried the following approaches, but none of them has worked. Does anyone know how I can read PDFs off …

Total answers: 1

Copy and Rename files in S3 bucket Lambda

Copy and Rename files in S3 bucket Lambda Question: I am writing a lambda function to test the tables in Athena and I have gotten that part to work. I am trying to rename the ResultConfiguration outputlocation file name that the function creates which cannot be renamed unless it’s copied and deleted. I am getting …

Total answers: 1

structlog: display log level in Cloudwatch

structlog: display log level in Cloudwatch Question: I have set up my logger like this: import logging import structlog class Logging: @staticmethod def my_logger() -> logging.Logger: structlog.configure( processors=[ structlog.processors.add_log_level, structlog.processors.TimeStamper(fmt="iso", key="ts"), structlog.processors.JSONRenderer(), ], wrapper_class=structlog.make_filtering_bound_logger(logging.INFO), ) logger = structlog.getLogger() return logger Events in Cloudwatch now look like this: 2023-04-05T10:44:52.920+01:00 {"event": "My logging message", "level": "info", "ts": …

Total answers: 1

Cannot find AWS_KEY_ID to connect to Boto3

Cannot find AWS_KEY_ID to connect to Boto3 Question: I am just getting started using Boto3 to connect to AWS, and I cannot get it to work. This is my code: #client client = boto3.client(‘s3’) list_bucket=client.list_buckets() print(list_bucket) This is the error message I receive: botocore.exceptions.NoCredentialsError: Unable to locate credentials I tried to set up CLI access …

Total answers: 1

AWS Secrets Manager auto rotation lambda function that rotates only one key value

AWS Secrets Manager auto rotation lambda function that rotates only one key value Question: I have this lambda function that I got from here: https://github.com/endre-synnes/python_aws_course/blob/main/lambda_intro/04_secrets_and_databases_and_stuff/17_rotate_secrets.py import boto3 def lambda_handler(event, context): arn = event[‘SecretId’] token = event[‘ClientRequestToken’] step = event[‘Step’] # Setup the client service_client = boto3.client(‘secretsmanager’) # Make sure the version is staged correctly metadata …

Total answers: 2

Download files from a public S3 bucket

Download files from a public S3 bucket Question: I’m trying to download some files from a public s3 bucket as part of the Google Analytics course. However, I am not getting the links returned in my request. I’m not sure if I need to use boto3 or a different API package since it’s a public …

Total answers: 3

Boto3 Dynamodb list_append Invalid type for parameter ExpressionAttributeNames type: <class 'set'>, valid types: <class 'dict'>

Boto3 Dynamodb list_append Invalid type for parameter ExpressionAttributeNames type: <class 'set'>, valid types: <class 'dict'> Question: Error message is throwing me. I have update_item updating an existing list. When I put everything in the UpdateExpression, it works fine. When I use the equivalent with ExpressionAttributeNames, I get the error in the title. They look equivalent …

Total answers: 1

Deploy a custom pipeline using Sagemaker SDK

Deploy a custom pipeline using Sagemaker SDK Question: I have been having a hard time to deploy my locally trained SKlearn model (pipeline with custom code + logistic model) to Sagemaker Endpoint. My Pipeline is as follows: All this custom code (RecodeCategorias) does is normalize and recode some categories columns into a "other" value, for …

Total answers: 2

Send StringSet to DynamoDB from JSON file using Boto3

Send StringSet to DynamoDB from JSON file using Boto3 Question: Problem description How can I create an item to send to DynamoDB from a JSON file, and have the type in DynamoDB end up as a StringSet as defined in AWS documentation using Python? I am using the Boto3 put_item API. Approaches attempted I’ve found …

Total answers: 2