Interface FunctionProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
FunctionProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:43.689Z")
@Stability(Stable)
public interface FunctionProps
extends software.amazon.jsii.JsiiSerializable
Properties for creating a CloudFront Function.
Example:
Bucket s3Bucket;
// Add a cloudfront Function to a Distribution
Function cfFunction = Function.Builder.create(this, "Function")
.code(FunctionCode.fromInline("function handler(event) { return event.request }"))
.build();
Distribution.Builder.create(this, "distro")
.defaultBehavior(BehaviorOptions.builder()
.origin(new S3Origin(s3Bucket))
.functionAssociations(List.of(FunctionAssociation.builder()
.function(cfFunction)
.eventType(FunctionEventType.VIEWER_REQUEST)
.build()))
.build())
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forFunctionPropsstatic final classAn implementation forFunctionProps -
Method Summary
Modifier and TypeMethodDescriptionstatic FunctionProps.Builderbuilder()getCode()The source code of the function.default StringA comment to describe the function.default StringA name to identify the function.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getCode
The source code of the function. -
getComment
A comment to describe the function.Default: - same as `functionName`
-
getFunctionName
A name to identify the function.Default: - generated from the `id`
-
builder
- Returns:
- a
FunctionProps.BuilderofFunctionProps
-