@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:46.597Z") 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 . |
IFunction.Jsii$Default, IFunction.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
Function(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Function(software.amazon.jsii.JsiiObjectRef objRef) |
|
Function(software.constructs.Construct scope,
java.lang.String id,
FunctionProps props) |
Modifier and Type | Method and Description |
---|---|
static IFunction |
fromFunctionAttributes(software.constructs.Construct scope,
java.lang.String id,
FunctionAttributes attrs)
Imports a function by its name and ARN.
|
java.lang.String |
getFunctionArn()
the ARN of the CloudFront function.
|
java.lang.String |
getFunctionName()
the name of the CloudFront function.
|
java.lang.String |
getFunctionStage()
the deployment stage of the CloudFront function.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv, getStack
getNode
protected Function(software.amazon.jsii.JsiiObjectRef objRef)
protected Function(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public Function(software.constructs.Construct scope, java.lang.String id, FunctionProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.public static IFunction fromFunctionAttributes(software.constructs.Construct scope, java.lang.String id, FunctionAttributes attrs)
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.public java.lang.String getFunctionArn()
getFunctionArn
in interface IFunction
public java.lang.String getFunctionName()
getFunctionName
in interface IFunction
public java.lang.String getFunctionStage()