Skip to content

Instantly share code, notes, and snippets.

@mykeels
Last active March 8, 2022 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mykeels/c432bbc4abb37c227f817c88ab4d7495 to your computer and use it in GitHub Desktop.
Save mykeels/c432bbc4abb37c227f817c88ab4d7495 to your computer and use it in GitHub Desktop.
JSDocs for AWS Cloudfront Message Event from https://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html
/**
* @typedef {object} AWSCloudfrontMessageEvent
* @property {AWSCloudfrontEventRecord[]} Records
*/
/**
* @typedef {object} AWSCloudfrontEventRecord
* @property {object} cf
* @property {{ distributionId: string, eventType: string, requestId: string, distributionDomainName: string }} cf.config
* @property {AWSCloudfrontRequest} cf.request
* @property {AWSCloudfrontResponse} cf.response
*/
/**
* @typedef {object} AWSCloudfrontRequest
* @property {string} clientId
* @property {string} method
* @property {string} uri
* @property {object} origin
* @property {object} origin.s3
* @property {string} origin.s3.domainName
* @property {string} origin.s3.path
* @property {string} origin.s3.region
* @property {string} origin.s3.authMethod
* @property {object} origin.s3.customHeaders
* @property {{ host: { key: string, value: string }[], "user-agent": { key: string, value: string }[] }} headers
*/
/**
* @typedef {AWSCloudfrontRequest & { status: string, statusDescription: string, body: any }} AWSCloudfrontResponse
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment