Interface IFunction.Jsii$Default
- All Superinterfaces:
IConnectable
,IConnectable.Jsii$Default
,IConstruct
,software.constructs.IConstruct
,IConstruct.Jsii$Default
,software.constructs.IConstruct.Jsii$Default
,IDependable
,IDependable.Jsii$Default
,IFunction
,IGrantable
,IGrantable.Jsii$Default
,IResource
,IResource.Jsii$Default
,software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
IAlias.Jsii$Default
,IVersion.Jsii$Default
- All Known Implementing Classes:
IAlias.Jsii$Proxy
,IFunction.Jsii$Proxy
,IVersion.Jsii$Proxy
- Enclosing interface:
- IFunction
IFunction
.-
Nested Class Summary
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.IConnectable
IConnectable.Jsii$Default, IConnectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default, IConstruct.Jsii$Proxy
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default, software.constructs.IConstruct.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IDependable
IDependable.Jsii$Default, IDependable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.lambda.IFunction
IFunction.Jsii$Default, IFunction.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.iam.IGrantable
IGrantable.Jsii$Default, IGrantable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default, IResource.Jsii$Proxy
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
addEventSource
(IEventSource source) Adds an event source to this function.default EventSourceMapping
addEventSourceMapping
(String id, EventSourceMappingOptions options) Adds an event source that maps to this AWS Lambda function.default FunctionUrl
addFunctionUrl
(FunctionUrlOptions options) Adds a url to this lambda function.default void
addPermission
(String id, Permission permission) Adds a permission to the Lambda resource policy.default void
addToRolePolicy
(PolicyStatement statement) Adds a statement to the IAM role assumed by the instance.default void
applyRemovalPolicy
(RemovalPolicy policy) Apply the given removal policy to this resource.default void
Configures options for asynchronous invocation.default Architecture
The system architectures compatible with this lambda function.default Connections
The network connections associated with this resource.default ResourceEnvironment
getEnv()
The environment this resource belongs to.default String
The ARN of the function.default String
The name of the function.default IPrincipal
The principal to grant permissions to.default Boolean
Whether or not this Lambda function was bound to a VPC.default IVersion
The$LATEST
version of this function.default ConstructNode
getNode()
The construct tree node for this construct.default ConstructNode
The construct node where permissions are attached.The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke().default IRole
getRole()
The IAM role associated with this function.default Stack
getStack()
The stack in which this resource is defined.default Grant
grantInvoke
(IGrantable identity) Grant the given identity permissions to invoke this Lambda.default Grant
grantInvokeUrl
(IGrantable identity) Grant the given identity permissions to invoke this Lambda Function URL.default Metric
metric
(String metricName, MetricOptions props) Return the given named metric for this Lambda Return the given named metric for this Function.default Metric
metricDuration
(MetricOptions props) Metric for the Duration of this Lambda How long execution of this Lambda takes.default Metric
metricErrors
(MetricOptions props) How many invocations of this Lambda fail.default Metric
metricInvocations
(MetricOptions props) Metric for the number of invocations of this Lambda How often this Lambda is invoked.default Metric
metricThrottles
(MetricOptions props) Metric for the number of throttled invocations of this Lambda How often this Lambda is throttled.Methods inherited from interface software.amazon.awscdk.services.lambda.IFunction
addFunctionUrl, metric, metricDuration, metricErrors, metricInvocations, metricThrottles
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getNode
The construct tree node for this construct.- Specified by:
getNode
in interfaceIConstruct
- Specified by:
getNode
in interfaceIConstruct.Jsii$Default
- Specified by:
getNode
in interfaceIResource.Jsii$Default
-
getEnv
The environment this resource belongs to.For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
- Specified by:
getEnv
in interfaceIResource
- Specified by:
getEnv
in interfaceIResource.Jsii$Default
-
getStack
The stack in which this resource is defined.- Specified by:
getStack
in interfaceIResource
- Specified by:
getStack
in interfaceIResource.Jsii$Default
-
getConnections
The network connections associated with this resource.- Specified by:
getConnections
in interfaceIConnectable
- Specified by:
getConnections
in interfaceIConnectable.Jsii$Default
-
getGrantPrincipal
The principal to grant permissions to.- Specified by:
getGrantPrincipal
in interfaceIGrantable
- Specified by:
getGrantPrincipal
in interfaceIGrantable.Jsii$Default
-
getArchitecture
The system architectures compatible with this lambda function.- Specified by:
getArchitecture
in interfaceIFunction
-
getFunctionArn
The ARN of the function.- Specified by:
getFunctionArn
in interfaceIFunction
-
getFunctionName
The name of the function.- Specified by:
getFunctionName
in interfaceIFunction
-
getIsBoundToVpc
Whether or not this Lambda function was bound to a VPC.If this is is
false
, trying to access theconnections
object will fail.- Specified by:
getIsBoundToVpc
in interfaceIFunction
-
getLatestVersion
The$LATEST
version of this function.Note that this is reference to a non-specific AWS Lambda version, which means the function this version refers to can return different results in different invocations.
To obtain a reference to an explicit version which references the current function configuration, use
lambdaFunction.currentVersion
instead.- Specified by:
getLatestVersion
in interfaceIFunction
-
getPermissionsNode
The construct node where permissions are attached.- Specified by:
getPermissionsNode
in interfaceIFunction
-
getResourceArnsForGrantInvoke
The ARN(s) to put into the resource field of the generated IAM policy for grantInvoke().This property is for cdk modules to consume only. You should not need to use this property. Instead, use grantInvoke() directly.
- Specified by:
getResourceArnsForGrantInvoke
in interfaceIFunction
-
getRole
The IAM role associated with this function. -
applyRemovalPolicy
Apply the given removal policy to this resource.The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
).- Specified by:
applyRemovalPolicy
in interfaceIResource
- Specified by:
applyRemovalPolicy
in interfaceIResource.Jsii$Default
- Parameters:
policy
- This parameter is required.
-
addEventSource
Adds an event source to this function.Event sources are implemented in the @aws-cdk/aws-lambda-event-sources module.
The following example adds an SQS Queue as an event source:
import { SqsEventSource } from '@aws-cdk/aws-lambda-event-sources'; myFunction.addEventSource(new SqsEventSource(myQueue));
- Specified by:
addEventSource
in interfaceIFunction
- Parameters:
source
- This parameter is required.
-
addEventSourceMapping
@Stability(Stable) @NotNull default EventSourceMapping addEventSourceMapping(@NotNull String id, @NotNull EventSourceMappingOptions options) Adds an event source that maps to this AWS Lambda function.- Specified by:
addEventSourceMapping
in interfaceIFunction
- Parameters:
id
- construct ID. This parameter is required.options
- mapping options. This parameter is required.
-
addFunctionUrl
@Stability(Stable) @NotNull default FunctionUrl addFunctionUrl(@Nullable FunctionUrlOptions options) Adds a url to this lambda function.- Specified by:
addFunctionUrl
in interfaceIFunction
- Parameters:
options
-
-
addPermission
Adds a permission to the Lambda resource policy.- Specified by:
addPermission
in interfaceIFunction
- Parameters:
id
- The id for the permission construct. This parameter is required.permission
- The permission to grant to this Lambda function. This parameter is required.- See Also:
-
addToRolePolicy
Adds a statement to the IAM role assumed by the instance.- Specified by:
addToRolePolicy
in interfaceIFunction
- Parameters:
statement
- This parameter is required.
-
configureAsyncInvoke
Configures options for asynchronous invocation.- Specified by:
configureAsyncInvoke
in interfaceIFunction
- Parameters:
options
- This parameter is required.
-
grantInvoke
Grant the given identity permissions to invoke this Lambda.- Specified by:
grantInvoke
in interfaceIFunction
- Parameters:
identity
- This parameter is required.
-
grantInvokeUrl
Grant the given identity permissions to invoke this Lambda Function URL.- Specified by:
grantInvokeUrl
in interfaceIFunction
- Parameters:
identity
- This parameter is required.
-
metric
@Stability(Stable) @NotNull default Metric metric(@NotNull String metricName, @Nullable MetricOptions props) Return the given named metric for this Lambda Return the given named metric for this Function. -
metricDuration
Metric for the Duration of this Lambda How long execution of this Lambda takes.Average over 5 minutes
Default: average over 5 minutes
- Specified by:
metricDuration
in interfaceIFunction
- Parameters:
props
-
-
metricErrors
How many invocations of this Lambda fail.Sum over 5 minutes
- Specified by:
metricErrors
in interfaceIFunction
- Parameters:
props
-
-
metricInvocations
Metric for the number of invocations of this Lambda How often this Lambda is invoked.Sum over 5 minutes
Default: sum over 5 minutes
- Specified by:
metricInvocations
in interfaceIFunction
- Parameters:
props
-
-
metricThrottles
Metric for the number of throttled invocations of this Lambda How often this Lambda is throttled.Sum over 5 minutes
Default: sum over 5 minutes
- Specified by:
metricThrottles
in interfaceIFunction
- Parameters:
props
-
-