Interface FunctionProps
- All Superinterfaces:
EventInvokeConfigOptions,FunctionOptions,software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
EdgeFunctionProps,SingletonFunctionProps,TriggerFunctionProps
- All Known Implementing Classes:
EdgeFunctionProps.Jsii$Proxy,FunctionProps.Jsii$Proxy,SingletonFunctionProps.Jsii$Proxy,TriggerFunctionProps.Jsii$Proxy
// Create or reference an existing L1 CfnApplicationInferenceProfile
CfnApplicationInferenceProfile cfnProfile = CfnApplicationInferenceProfile.Builder.create(this, "CfnProfile")
.inferenceProfileName("my-cfn-profile")
.modelSource(InferenceProfileModelSourceProperty.builder()
.copyFrom(BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0.getInvokableArn())
.build())
.description("Profile created via L1 construct")
.build();
// Import the L1 construct as an L2 ApplicationInferenceProfile
IInferenceProfile importedFromCfn = ApplicationInferenceProfile.fromCfnApplicationInferenceProfile(cfnProfile);
// Grant permissions to use the imported profile
Function lambdaFunction = Function.Builder.create(this, "MyFunction")
.runtime(Runtime.PYTHON_3_11)
.handler("index.handler")
.code(Code.fromInline("def handler(event, context): return \"Hello\""))
.build();
importedFromCfn.grantProfileUsage(lambdaFunction);
-
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 your Lambda function.The name of the method within your code that Lambda calls to execute your function.The runtime environment for the Lambda function that you are uploading.Methods inherited from interface software.amazon.awscdk.services.lambda.EventInvokeConfigOptions
getMaxEventAge, getOnFailure, getOnSuccess, getRetryAttemptsMethods inherited from interface software.amazon.awscdk.services.lambda.FunctionOptions
getAdotInstrumentation, getAllowAllIpv6Outbound, getAllowAllOutbound, getAllowPublicSubnet, getApplicationLogLevel, getApplicationLogLevelV2, getArchitecture, getCodeSigningConfig, getCurrentVersionOptions, getDeadLetterQueue, getDeadLetterQueueEnabled, getDeadLetterTopic, getDescription, getEnvironment, getEnvironmentEncryption, getEphemeralStorageSize, getEvents, getFilesystem, getFunctionName, getInitialPolicy, getInsightsVersion, getIpv6AllowedForDualStack, getLayers, getLogFormat, getLoggingFormat, getLogGroup, getLogRemovalPolicy, getLogRetention, getLogRetentionRetryOptions, getLogRetentionRole, getMemorySize, getParamsAndSecrets, getProfiling, getProfilingGroup, getRecursiveLoop, getReservedConcurrentExecutions, getRole, getRuntimeManagementMode, getSecurityGroups, getSnapStart, getSystemLogLevel, getSystemLogLevelV2, getTimeout, getTracing, getVpc, getVpcSubnetsMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getCode
The source code of your Lambda function.You can point to a file in an Amazon Simple Storage Service (Amazon S3) bucket or specify your source code as inline text.
-
getHandler
The name of the method within your code that Lambda calls to execute your function.The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html.
Use
Handler.FROM_IMAGEwhen defining a function from a Docker image.NOTE: If you specify your source code as inline text by specifying the ZipFile property within the Code property, specify index.function_name as the handler.
-
getRuntime
The runtime environment for the Lambda function that you are uploading.For valid values, see the Runtime property in the AWS Lambda Developer Guide.
Use
Runtime.FROM_IMAGEwhen defining a function from a Docker image. -
builder
- Returns:
- a
FunctionProps.BuilderofFunctionProps
-