@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-11T17:58:48.803Z") @Stability(value=Stable) public class Function extends Resource implements IFunction
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 | Class and Description |
|---|---|
static class |
Function.Builder
A fluent builder for
Function. |
software.amazon.jsii.JsiiObject.InitializationModeIFunction.Jsii$Default, IFunction.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
Function(software.constructs.Construct scope,
String id,
FunctionProps props) |
protected |
Function(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Function(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
static IFunction |
fromFunctionAttributes(software.constructs.Construct scope,
String id,
FunctionAttributes attrs)
Imports a function by its name and ARN.
|
String |
getFunctionArn()
the ARN of the CloudFront function.
|
String |
getFunctionName()
the name of the CloudFront function.
|
String |
getFunctionStage()
the deployment stage of the CloudFront function.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourcegetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validatejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackgetNodeprotected Function(software.amazon.jsii.JsiiObjectRef objRef)
protected Function(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public Function(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
FunctionProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull public static IFunction fromFunctionAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull FunctionAttributes attrs)
scope - This parameter is required.id - This parameter is required.attrs - This parameter is required.@Stability(value=Stable) @NotNull public String getFunctionArn()
getFunctionArn in interface IFunction@Stability(value=Stable) @NotNull public String getFunctionName()
getFunctionName in interface IFunction@Stability(value=Stable) @NotNull public String getFunctionStage()
Copyright © 2022. All rights reserved.