This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Action=SendMessage&MessageBody=$input.json('$')## | |
&MessageAttribute.1.Name=hostName## | |
&MessageAttribute.1.Value.DataType=String## | |
&MessageAttribute.1.Value.StringValue=$util.urlEncode($context.domainName)## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const path = require('path'); | |
exports.handler = (event, context, callback) => { | |
// Extract the request from the CloudFront event that is sent to Lambda@Edge | |
var request = event.Records[0].cf.request; | |
// Extract the URI from the request | |
var olduri = request.uri; | |
var newuri = request.uri; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AWS = require("aws-sdk"); | |
const csv = require("csv-parser"); | |
const { Readable } = require("stream"); | |
const simpleParser = require("mailparser").simpleParser; | |
const s3 = new AWS.S3(); | |
const documentClient = new AWS.DynamoDB.DocumentClient(); | |
const TableName = process.env.TABLE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
exports.handler = (event, context, callback) => { | |
console.log(JSON.stringify(event.Records[0].cf)); | |
var request = event.Records[0].cf.request | |
var host = request.headers.host[0].value; | |
var uri = request.uri; |