Skip to content

Commit

Permalink
refactor(cloudfront): add review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
KnisterPeter committed Jun 12, 2019
1 parent 02d7bfb commit ed5cb66
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,23 +348,44 @@ export interface Behavior {
/**
* Declares associated lambda@edge functions for this distribution behaviour.
*
* @default undefined
* @default No lambda function associated
*/
readonly lambdaFunctionAssociations?: LambdaFunctionAssociation[];

}

export interface LambdaFunctionAssociation {

readonly eventType?: LambdaEdgeEventType;
/**
* The lambda event type defines at which event the lambda
* is called during the request lifecycle
*/
readonly eventType: LambdaEdgeEventType;

readonly lambdaFunction?: lambda.IVersion;
/**
* A version of the lambda to associate
*/
readonly lambdaFunction: lambda.IVersion;
}

export enum LambdaEdgeEventType {
/**
* The origin-request specifies the request to the
* origin location (e.g. S3)
*/
OriginRequest = "origin-request",
/**
* The origin-response specifies the response from the
* origin location (e.g. S3)
*/
OriginResponse = "origin-response",
/**
* The viewer-request specifies the incoming request
*/
ViewerRequest = "viewer-request",
/**
* The viewer-response specifies the outgoing reponse
*/
ViewerResponse = "viewer-response",
}

Expand Down

0 comments on commit ed5cb66

Please sign in to comment.