Category Archives: aws-lambda

Redirect URL through AWS Lambda

I am trying to track emails that get opened. I am musing AWS API gateway and Lambda as the back end and am tacking through a 1x1 pixel attached to the email.

Currently my lambda function simply returns a location to the actual image in which I want to redirect to. I will be adding a counter increment to my database using this lambda function once the redirect is functioning (Email tracking):

def handler(event, context):
Location = 'https://s3-eu-west-1.amazonaws.com/stylezz.biz/email-sig/1.png'
return Location

In my API gateay I have set up the response to be 301 and mapped the output from the lambda function to my Location header. However the URL does not redirect as simply returns the location in JSON format.: enter image description here

enter image description here

Anyone know how I can actually get the API to redirect

How to send JSON records from HDFS to Amazon SNS service by spark

I am trying to understand the best possible way to send data from hdfs to amazon sns service.Going through below link

http://spark.apache.org/docs/latest/sql-programming-guide.html#json-datasets

this says Note that the file that is offered as a json file is not a typical JSON file. Each line must contain a separate, self-contained valid JSON object. As a consequence, a regular multi-line JSON file will most often fail.

In my case i have multiple separate json files in a folder and there can be multiple folders. is this possible in spark with current release ? Or any other best way that i can put data to AWS SNS from HDFS ?

How to send JSON records from HDFS to Amazon SNS service by spark

I am trying to understand the best possible way to send data from hdfs to amazon sns service.Going through below link

http://spark.apache.org/docs/latest/sql-programming-guide.html#json-datasets

this says Note that the file that is offered as a json file is not a typical JSON file. Each line must contain a separate, self-contained valid JSON object. As a consequence, a regular multi-line JSON file will most often fail.

In my case i have multiple separate json files in a folder and there can be multiple folders. is this possible in spark with current release ? Or any other best way that i can put data to AWS SNS from HDFS ?