@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:37.135Z") @Stability(value=Stable) public interface FunctionProps extends software.amazon.jsii.JsiiSerializable
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();
| Modifier and Type | Interface and Description |
|---|---|
static class |
FunctionProps.Builder
A builder for
FunctionProps |
static class |
FunctionProps.Jsii$Proxy
An implementation for
FunctionProps |
| Modifier and Type | Method and Description |
|---|---|
static FunctionProps.Builder |
builder() |
FunctionCode |
getCode()
The source code of the function.
|
default String |
getComment()
A comment to describe the function.
|
default String |
getFunctionName()
A name to identify the function.
|
@Stability(value=Stable) @NotNull FunctionCode getCode()
@Stability(value=Stable) @Nullable default String getComment()
Default: - same as `functionName`
@Stability(value=Stable) @Nullable default String getFunctionName()
Default: - generated from the `id`
@Stability(value=Stable) static FunctionProps.Builder builder()
FunctionProps.Builder of FunctionPropsCopyright © 2022. All rights reserved.