@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)", date="2023-01-31T18:36:54.578Z") public interface IFunction extends IResource, IConnectable, IGrantable
Modifier and Type | Interface and Description |
---|---|
static interface |
IFunction.Jsii$Default
Internal default implementation for
IFunction . |
static class |
IFunction.Jsii$Proxy
A proxy class which represents a concrete javascript instance of this type.
|
Modifier and Type | Method and Description |
---|---|
void |
addEventSource(IEventSource source)
Adds an event source to this function.
|
EventSourceMapping |
addEventSourceMapping(java.lang.String id,
EventSourceMappingOptions options)
Adds an event source that maps to this AWS Lambda function.
|
FunctionUrl |
addFunctionUrl()
Adds a url to this lambda function.
|
FunctionUrl |
addFunctionUrl(FunctionUrlOptions options)
Adds a url to this lambda function.
|
void |
addPermission(java.lang.String id,
Permission permission)
Adds a permission to the Lambda resource policy.
|
void |
addToRolePolicy(PolicyStatement statement)
Adds a statement to the IAM role assumed by the instance.
|
void |
configureAsyncInvoke(EventInvokeConfigOptions options)
Configures options for asynchronous invocation.
|
Architecture |
getArchitecture()
The system architectures compatible with this lambda function.
|
java.lang.String |
getFunctionArn()
The ARN of the function.
|
java.lang.String |
getFunctionName()
The name of the function.
|
java.lang.Boolean |
getIsBoundToVpc()
Whether or not this Lambda function was bound to a VPC.
|
IVersion |
getLatestVersion()
The `$LATEST` version of this function.
|
ConstructNode |
getPermissionsNode()
The construct node where permissions are attached.
|
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.
|
Grant |
grantInvoke(IGrantable identity)
Grant the given identity permissions to invoke this Lambda.
|
Grant |
grantInvokeUrl(IGrantable identity)
Grant the given identity permissions to invoke this Lambda Function URL.
|
Metric |
metric(java.lang.String metricName)
Return the given named metric for this Lambda Return the given named metric for this Function.
|
Metric |
metric(java.lang.String metricName,
MetricOptions props)
Return the given named metric for this Lambda Return the given named metric for this Function.
|
Metric |
metricDuration()
Metric for the Duration of this Lambda How long execution of this Lambda takes.
|
Metric |
metricDuration(MetricOptions props)
Metric for the Duration of this Lambda How long execution of this Lambda takes.
|
Metric |
metricErrors()
How many invocations of this Lambda fail.
|
Metric |
metricErrors(MetricOptions props)
How many invocations of this Lambda fail.
|
Metric |
metricInvocations()
Metric for the number of invocations of this Lambda How often this Lambda is invoked.
|
Metric |
metricInvocations(MetricOptions props)
Metric for the number of invocations of this Lambda How often this Lambda is invoked.
|
Metric |
metricThrottles()
Metric for the number of throttled invocations of this Lambda How often this Lambda is throttled.
|
Metric |
metricThrottles(MetricOptions props)
Metric for the number of throttled invocations of this Lambda How often this Lambda is throttled.
|
applyRemovalPolicy, getEnv, getStack
getNode
getConnections
getGrantPrincipal
Architecture getArchitecture()
java.lang.String getFunctionArn()
java.lang.String getFunctionName()
java.lang.Boolean getIsBoundToVpc()
If this is is false
, trying to access the connections
object will fail.
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.
ConstructNode getPermissionsNode()
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.
default IRole getRole()
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));
source
- This parameter is required.EventSourceMapping addEventSourceMapping(java.lang.String id, EventSourceMappingOptions options)
id
- construct ID. This parameter is required.options
- mapping options. This parameter is required.FunctionUrl addFunctionUrl(FunctionUrlOptions options)
options
- FunctionUrl addFunctionUrl()
void addPermission(java.lang.String id, Permission permission)
id
- The id for the permission construct. This parameter is required.permission
- The permission to grant to this Lambda function. This parameter is required.void addToRolePolicy(PolicyStatement statement)
statement
- This parameter is required.void configureAsyncInvoke(EventInvokeConfigOptions options)
options
- This parameter is required.Grant grantInvoke(IGrantable identity)
identity
- This parameter is required.Grant grantInvokeUrl(IGrantable identity)
identity
- This parameter is required.Metric metric(java.lang.String metricName, MetricOptions props)
metricName
- This parameter is required.props
- Metric metric(java.lang.String metricName)
metricName
- This parameter is required.Metric metricDuration(MetricOptions props)
Average over 5 minutes
Default: average over 5 minutes
props
- Metric metricDuration()
Average over 5 minutes
Default: average over 5 minutes
Metric metricErrors(MetricOptions props)
Sum over 5 minutes
props
- Metric metricErrors()
Sum over 5 minutes
Metric metricInvocations(MetricOptions props)
Sum over 5 minutes
Default: sum over 5 minutes
props
- Metric metricInvocations()
Sum over 5 minutes
Default: sum over 5 minutes
Metric metricThrottles(MetricOptions props)
Sum over 5 minutes
Default: sum over 5 minutes
props
- Metric metricThrottles()
Sum over 5 minutes
Default: sum over 5 minutes