@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:40.473Z") @Stability(value=Stable) 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)
Adds an event source to this function.
|
EventSourceMapping |
addEventSourceMapping(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(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.
|
String |
getFunctionArn()
The ARN of the function.
|
String |
getFunctionName()
The name of the function.
|
Boolean |
getIsBoundToVpc()
Whether or not this Lambda function was bound to a VPC.
|
IVersion |
getLatestVersion()
The `$LATEST` version of this function.
|
software.constructs.Node |
getPermissionsNode()
The construct node where permissions are attached.
|
List<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(String metricName)
Return the given named metric for this Lambda Return the given named metric for this Function.
|
Metric |
metric(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, getStackgetConnectionsgetGrantPrincipal@Stability(value=Stable) @NotNull Architecture getArchitecture()
@Stability(value=Stable) @NotNull String getFunctionArn()
@Stability(value=Stable) @NotNull String getFunctionName()
@Stability(value=Stable) @NotNull Boolean getIsBoundToVpc()
If this is is false, trying to access the connections object will fail.
@Stability(value=Stable) @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=Stable) @NotNull software.constructs.Node getPermissionsNode()
@Stability(value=Stable) @NotNull List<String> getResourceArnsForGrantInvoke()
This property is for cdk modules to consume only. You should not need to use this property. Instead, use grantInvoke() directly.
@Stability(value=Stable) @Nullable default IRole getRole()
@Stability(value=Stable)
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=Stable) @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=Stable) @NotNull FunctionUrl addFunctionUrl(@Nullable FunctionUrlOptions options)
options - @Stability(value=Stable) @NotNull FunctionUrl addFunctionUrl()
@Stability(value=Stable)
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.@Stability(value=Stable)
void addToRolePolicy(@NotNull
PolicyStatement statement)
statement - This parameter is required.@Stability(value=Stable)
void configureAsyncInvoke(@NotNull
EventInvokeConfigOptions options)
options - This parameter is required.@Stability(value=Stable) @NotNull Grant grantInvoke(@NotNull IGrantable identity)
identity - This parameter is required.@Stability(value=Stable) @NotNull Grant grantInvokeUrl(@NotNull IGrantable identity)
identity - This parameter is required.@Stability(value=Stable) @NotNull Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
metricName - This parameter is required.props - @Stability(value=Stable) @NotNull Metric metric(@NotNull String metricName)
metricName - This parameter is required.@Stability(value=Stable) @NotNull Metric metricDuration(@Nullable MetricOptions props)
Average over 5 minutes
Default: average over 5 minutes
props - @Stability(value=Stable) @NotNull Metric metricDuration()
Average over 5 minutes
Default: average over 5 minutes
@Stability(value=Stable) @NotNull Metric metricErrors(@Nullable MetricOptions props)
Sum over 5 minutes
props - @Stability(value=Stable) @NotNull Metric metricErrors()
Sum over 5 minutes
@Stability(value=Stable) @NotNull Metric metricInvocations(@Nullable MetricOptions props)
Sum over 5 minutes
Default: sum over 5 minutes
props - @Stability(value=Stable) @NotNull Metric metricInvocations()
Sum over 5 minutes
Default: sum over 5 minutes
@Stability(value=Stable) @NotNull Metric metricThrottles(@Nullable MetricOptions props)
Sum over 5 minutes
Default: sum over 5 minutes
props - @Stability(value=Stable) @NotNull Metric metricThrottles()
Sum over 5 minutes
Default: sum over 5 minutes
Copyright © 2022. All rights reserved.