I am new to working with AWS and I have created a web scraping python script that works with a third party API to serve requests. The function pulls posts and comments from a forum based platform and I am trying to run the function on AWS lambda. I have a dictionary of multiple forum ..
Category : aws-lambda
In a jupyter notebook I am able to create two Pandas dataframes and export them to individual sheets of an Excel workbook with some additional formatting, including text-wrapping, frozen pane, bold headers and auto-filters. Code below: # MODULES import pandas as pd import numpy as np from datetime import date #CONSTRUCT DATAFRAME df = pd.DataFrame({‘Data’: ..
How to rename multiple output files in S3 bucket. As an example I am using os.path.basename(keyprefix),’w’ to write the file which is of pattern abc_00000.csv.gz abc_00001.csv.gz I want to rename the above files with naming convention: abc_{today date in YYYYMMDD format}00.csv.gz abc{today date in YYYYMMDD format}_01.csv.gz Below is the code for reference: import boto3 import ..
I can write a csv file to my S3 bucket without any errors, but it’s empty. I have checked this thread Why the csv file in S3 is empty after loading from Lambda, but I’m not using a with block. import json import requests from datetime import date from datetime import datetime import csv import ..
Is there a way to use gifsicle in AWS lambda? I know there is a package called pygifsicle, [https://github.com/LucaCappelletti94/pygifsicle], but it seems it requires the gifsicle version of AWS Linux 2? I dont see a binary built for RedHat version of gifsicle in https://www.lcdf.org/gifsicle/. So my questions are, Do I need to build one for ..
Goal Im making a video converting tool with AWS Lambda where videos can be uploaded using a webpage to a S3 bucket. When all videos (1 or more) are uploaded to the bucket a done.json file will be uploaded last. A Lambda function is called on every upload and only will do something when the ..
I have a desktop application that we are developing using Electron Framework. It invokes AWS Lambda functions directly using their alias ARNs. The Lambda functions are being developed in python 3.6. There is no API gateway handling requests as they are just managed by direct invocations to Lambda. The way such requests are processed by ..
I want to add pipeline details(status, id, who triggered it) to my SIEM solution. For that, can you suggest me how to get that information. Some rough Ideas Invoke a lambda from Pipeline and supply pipeline related information through SNS If the above is possible, can you tell me how. I couldn’t find a way ..
I am creating a lambda function that adds data from a .csv file in AWS S3 to DynamoDB using the following Python code: import boto3 s3 = boto3.client("s3") dynamodb = boto3.resource("dynamodb") def lambda_function(event, context): bucket = event[‘Records’][0][‘s3’][‘bucket’][‘name’] key = event[‘Records’][0][‘s3’][‘object’][‘key’] obj = s3.get_object(Bucket=bucket, Key=key) rows = obj[‘Body’].read().split(b’n’) table = dynamodb.Table(‘Sports_Scores’) with table.batch_writer() as batch: for ..
I have an AWS Lambda which uses some modules which write to the stdout. These appear in the Lambda logs – however I need to be able to read and parse the stdout after the module is executed. Is this possible with the AWS Logger library? import os import logging logger = logging.getLogger() logger.setLevel(logging.INFO) def ..
Recent Comments