public static interface IFunction.Jsii$Default extends IFunction, IResource.Jsii$Default, IConnectable.Jsii$Default, IGrantable.Jsii$Default
IFunction
.IFunction.Jsii$Default, IFunction.Jsii$Proxy
Modifier and Type | Method and Description |
---|---|
default void |
addEventSource(IEventSource source)
Adds an event source to this function.
|
default EventSourceMapping |
addEventSourceMapping(java.lang.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(java.lang.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 |
configureAsyncInvoke(EventInvokeConfigOptions options)
Configures options for asynchronous invocation.
|
default Architecture |
getArchitecture()
The system architectures compatible with this lambda function.
|
default Connections |
getConnections()
The network connections associated with this resource.
|
default ResourceEnvironment |
getEnv()
The environment this resource belongs to.
|
default java.lang.String |
getFunctionArn()
The ARN of the function.
|
default java.lang.String |
getFunctionName()
The name of the function.
|
default IPrincipal |
getGrantPrincipal()
The principal to grant permissions to.
|
default java.lang.Boolean |
getIsBoundToVpc()
Whether or not this Lambda function was bound to a VPC.
|
default IVersion |
getLatestVersion()
The `$LATEST` version of this function.
|
default ConstructNode |
getNode()
The construct tree node for this construct.
|
default ConstructNode |
getPermissionsNode()
The construct node where permissions are attached.
|
default java.util.List<java.lang.String> |
getResourceArnsForGrantInvoke()
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(java.lang.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.
|
addFunctionUrl, metric, metricDuration, metricErrors, metricInvocations, metricThrottles
default ConstructNode getNode()
getNode
in interface IConstruct
getNode
in interface IConstruct.Jsii$Default
getNode
in interface IResource.Jsii$Default
default ResourceEnvironment getEnv()
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.
getEnv
in interface IResource
getEnv
in interface IResource.Jsii$Default
default Stack getStack()
getStack
in interface IResource
getStack
in interface IResource.Jsii$Default
default Connections getConnections()
getConnections
in interface IConnectable
getConnections
in interface IConnectable.Jsii$Default
default IPrincipal getGrantPrincipal()
getGrantPrincipal
in interface IGrantable
getGrantPrincipal
in interface IGrantable.Jsii$Default
default Architecture getArchitecture()
getArchitecture
in interface IFunction
default java.lang.String getFunctionArn()
getFunctionArn
in interface IFunction
default java.lang.String getFunctionName()
getFunctionName
in interface IFunction
default java.lang.Boolean getIsBoundToVpc()
If this is is false
, trying to access the connections
object will fail.
getIsBoundToVpc
in interface IFunction
default IVersion getLatestVersion()
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.
getLatestVersion
in interface IFunction
default ConstructNode getPermissionsNode()
getPermissionsNode
in interface IFunction
default java.util.List<java.lang.String> getResourceArnsForGrantInvoke()
This property is for cdk modules to consume only. You should not need to use this property. Instead, use grantInvoke() directly.
getResourceArnsForGrantInvoke
in interface IFunction
default IRole getRole()
default void applyRemovalPolicy(RemovalPolicy policy)
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
).
applyRemovalPolicy
in interface IResource
applyRemovalPolicy
in interface IResource.Jsii$Default
policy
- This parameter is required.default void addEventSource(IEventSource source)
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));
addEventSource
in interface IFunction
source
- This parameter is required.default EventSourceMapping addEventSourceMapping(java.lang.String id, EventSourceMappingOptions options)
addEventSourceMapping
in interface IFunction
id
- construct ID. This parameter is required.options
- mapping options. This parameter is required.default FunctionUrl addFunctionUrl(FunctionUrlOptions options)
addFunctionUrl
in interface IFunction
options
- default void addPermission(java.lang.String id, Permission permission)
addPermission
in interface IFunction
id
- The id for the permission construct. This parameter is required.permission
- The permission to grant to this Lambda function. This parameter is required.default void addToRolePolicy(PolicyStatement statement)
addToRolePolicy
in interface IFunction
statement
- This parameter is required.default void configureAsyncInvoke(EventInvokeConfigOptions options)
configureAsyncInvoke
in interface IFunction
options
- This parameter is required.default Grant grantInvoke(IGrantable identity)
grantInvoke
in interface IFunction
identity
- This parameter is required.default Grant grantInvokeUrl(IGrantable identity)
grantInvokeUrl
in interface IFunction
identity
- This parameter is required.default Metric metric(java.lang.String metricName, MetricOptions props)
default Metric metricDuration(MetricOptions props)
Average over 5 minutes
Default: average over 5 minutes
metricDuration
in interface IFunction
props
- default Metric metricErrors(MetricOptions props)
Sum over 5 minutes
metricErrors
in interface IFunction
props
- default Metric metricInvocations(MetricOptions props)
Sum over 5 minutes
Default: sum over 5 minutes
metricInvocations
in interface IFunction
props
- default Metric metricThrottles(MetricOptions props)
Sum over 5 minutes
Default: sum over 5 minutes
metricThrottles
in interface IFunction
props
-