@Generated(value="jsii-pacmak/1.30.0 (build adae23f)", date="2021-06-30T10:01:21.536Z") @Stability(value=Experimental) public interface IFunction extends software.amazon.jsii.JsiiSerializable, 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)
(experimental) Adds an event source to this function.
|
EventSourceMapping |
addEventSourceMapping(String id,
EventSourceMappingOptions options)
(experimental) Adds an event source that maps to this AWS Lambda function.
|
void |
addPermission(String id,
Permission permission)
(experimental) Adds a permission to the Lambda resource policy.
|
void |
addToRolePolicy(PolicyStatement statement)
(experimental) Adds a statement to the IAM role assumed by the instance.
|
void |
configureAsyncInvoke(EventInvokeConfigOptions options)
(experimental) Configures options for asynchronous invocation.
|
String |
getFunctionArn()
(experimental) The ARN fo the function.
|
String |
getFunctionName()
(experimental) The name of the function.
|
Boolean |
getIsBoundToVpc()
(experimental) Whether or not this Lambda function was bound to a VPC.
|
IVersion |
getLatestVersion()
(experimental) The `$LATEST` version of this function.
|
software.constructs.Node |
getPermissionsNode()
(experimental) The construct node where permissions are attached.
|
default IRole |
getRole()
(experimental) The IAM role associated with this function.
|
Grant |
grantInvoke(IGrantable identity)
(experimental) Grant the given identity permissions to invoke this Lambda.
|
Metric |
metric(String metricName)
(experimental) Return the given named metric for this Lambda Return the given named metric for this Function.
|
Metric |
metric(String metricName,
MetricOptions props)
(experimental) Return the given named metric for this Lambda Return the given named metric for this Function.
|
Metric |
metricDuration()
(experimental) Metric for the Duration of this Lambda How long execution of this Lambda takes.
|
Metric |
metricDuration(MetricOptions props)
(experimental) Metric for the Duration of this Lambda How long execution of this Lambda takes.
|
Metric |
metricErrors()
(experimental) How many invocations of this Lambda fail.
|
Metric |
metricErrors(MetricOptions props)
(experimental) How many invocations of this Lambda fail.
|
Metric |
metricInvocations()
(experimental) Metric for the number of invocations of this Lambda How often this Lambda is invoked.
|
Metric |
metricInvocations(MetricOptions props)
(experimental) Metric for the number of invocations of this Lambda How often this Lambda is invoked.
|
Metric |
metricThrottles()
(experimental) Metric for the number of throttled invocations of this Lambda How often this Lambda is throttled.
|
Metric |
metricThrottles(MetricOptions props)
(experimental) Metric for the number of throttled invocations of this Lambda How often this Lambda is throttled.
|
getConnectionsgetGrantPrincipal@Stability(value=Experimental) @NotNull String getFunctionArn()
@Stability(value=Experimental) @NotNull String getFunctionName()
@Stability(value=Experimental) @NotNull Boolean getIsBoundToVpc()
If this is is false, trying to access the connections object will fail.
@Stability(value=Experimental) @NotNull 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.
@Stability(value=Experimental) @NotNull software.constructs.Node getPermissionsNode()
@Stability(value=Experimental) @Nullable default IRole getRole()
@Stability(value=Experimental)
void addEventSource(@NotNull
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.@Stability(value=Experimental) @NotNull EventSourceMapping addEventSourceMapping(@NotNull String id, @NotNull EventSourceMappingOptions options)
id - construct ID. This parameter is required.options - mapping options. This parameter is required.@Stability(value=Experimental)
void addPermission(@NotNull
String id,
@NotNull
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.for details.@Stability(value=Experimental)
void addToRolePolicy(@NotNull
PolicyStatement statement)
statement - This parameter is required.@Stability(value=Experimental)
void configureAsyncInvoke(@NotNull
EventInvokeConfigOptions options)
options - This parameter is required.@Stability(value=Experimental) @NotNull Grant grantInvoke(@NotNull IGrantable identity)
identity - This parameter is required.@Stability(value=Experimental) @NotNull Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
metricName - This parameter is required.props - @Stability(value=Experimental) @NotNull Metric metric(@NotNull String metricName)
metricName - This parameter is required.@Stability(value=Experimental) @NotNull Metric metricDuration(@Nullable MetricOptions props)
Average over 5 minutes
Default: average over 5 minutes
props - @Stability(value=Experimental) @NotNull Metric metricDuration()
Average over 5 minutes
Default: average over 5 minutes
@Stability(value=Experimental) @NotNull Metric metricErrors(@Nullable MetricOptions props)
Sum over 5 minutes
props - @Stability(value=Experimental) @NotNull Metric metricErrors()
Sum over 5 minutes
@Stability(value=Experimental) @NotNull Metric metricInvocations(@Nullable MetricOptions props)
Sum over 5 minutes
Default: sum over 5 minutes
props - @Stability(value=Experimental) @NotNull Metric metricInvocations()
Sum over 5 minutes
Default: sum over 5 minutes
@Stability(value=Experimental) @NotNull Metric metricThrottles(@Nullable MetricOptions props)
Sum over 5 minutes
Default: sum over 5 minutes
props - @Stability(value=Experimental) @NotNull Metric metricThrottles()
Sum over 5 minutes
Default: sum over 5 minutes
Copyright © 2021. All rights reserved.