@Generated(value="jsii-pacmak/1.30.0 (build adae23f)", date="2021-06-30T10:01:21.517Z") @Stability(value=Experimental) public abstract class FunctionBase extends Resource implements IFunction, IClientVpnConnectionHandler
software.amazon.jsii.JsiiObject.InitializationModeIFunction.Jsii$DefaultIClientVpnConnectionHandler.Jsii$Default| Modifier | Constructor and Description |
|---|---|
protected |
FunctionBase(software.constructs.Construct scope,
String id) |
protected |
FunctionBase(software.constructs.Construct scope,
String id,
ResourceProps props) |
protected |
FunctionBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
FunctionBase(software.amazon.jsii.JsiiObjectRef objRef) |
| 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.
|
protected abstract Boolean |
getCanCreatePermissions()
(experimental) Whether the addPermission() call adds any permissions.
|
Connections |
getConnections()
(experimental) Access the Connections object.
|
abstract String |
getFunctionArn()
(experimental) The ARN fo the function.
|
abstract String |
getFunctionName()
(experimental) The name of the function.
|
abstract IPrincipal |
getGrantPrincipal()
(experimental) The principal this Lambda Function is running as.
|
Boolean |
getIsBoundToVpc()
(experimental) Whether or not this Lambda function was bound to a VPC.
|
IVersion |
getLatestVersion()
(experimental) The `$LATEST` version of this function.
|
abstract software.constructs.Node |
getPermissionsNode()
(experimental) The construct node where permissions are attached.
|
abstract IRole |
getRole()
(experimental) The IAM role associated with this function.
|
Grant |
grantInvoke(IGrantable grantee)
(experimental) Grant the given identity permissions to invoke this Lambda.
|
Metric |
metric(String metricName)
(experimental) Return the given named metric for this Function.
|
Metric |
metric(String metricName,
MetricOptions props)
(experimental) Return the given named metric for this Function.
|
Metric |
metricDuration()
(experimental) How long execution of this Lambda takes.
|
Metric |
metricDuration(MetricOptions props)
(experimental) 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) How often this Lambda is invoked.
|
Metric |
metricInvocations(MetricOptions props)
(experimental) How often this Lambda is invoked.
|
Metric |
metricThrottles()
(experimental) How often this Lambda is throttled.
|
Metric |
metricThrottles(MetricOptions props)
(experimental) How often this Lambda is throttled.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected FunctionBase(software.amazon.jsii.JsiiObjectRef objRef)
protected FunctionBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
protected FunctionBase(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
ResourceProps props)
scope - This parameter is required.id - This parameter is required.props - @Stability(value=Experimental)
protected FunctionBase(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - This parameter is required.id - This parameter is required.@Stability(value=Experimental)
public 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));
addEventSource in interface IFunctionsource - This parameter is required.@Stability(value=Experimental) @NotNull public EventSourceMapping addEventSourceMapping(@NotNull String id, @NotNull EventSourceMappingOptions options)
addEventSourceMapping in interface IFunctionid - This parameter is required.options - This parameter is required.@Stability(value=Experimental)
public void addPermission(@NotNull
String id,
@NotNull
Permission permission)
addPermission in interface IFunctionid - 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)
public void addToRolePolicy(@NotNull
PolicyStatement statement)
addToRolePolicy in interface IFunctionstatement - This parameter is required.@Stability(value=Experimental)
public void configureAsyncInvoke(@NotNull
EventInvokeConfigOptions options)
configureAsyncInvoke in interface IFunctionoptions - This parameter is required.@Stability(value=Experimental) @NotNull public Grant grantInvoke(@NotNull IGrantable grantee)
grantInvoke in interface IFunctiongrantee - This parameter is required.@Stability(value=Experimental) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
@Stability(value=Experimental) @NotNull public Metric metric(@NotNull String metricName)
@Stability(value=Experimental) @NotNull public Metric metricDuration(@Nullable MetricOptions props)
Average over 5 minutes
metricDuration in interface IFunctionprops - @Stability(value=Experimental) @NotNull public Metric metricDuration()
Average over 5 minutes
metricDuration in interface IFunction@Stability(value=Experimental) @NotNull public Metric metricErrors(@Nullable MetricOptions props)
Sum over 5 minutes
metricErrors in interface IFunctionprops - @Stability(value=Experimental) @NotNull public Metric metricErrors()
Sum over 5 minutes
metricErrors in interface IFunction@Stability(value=Experimental) @NotNull public Metric metricInvocations(@Nullable MetricOptions props)
Sum over 5 minutes
metricInvocations in interface IFunctionprops - @Stability(value=Experimental) @NotNull public Metric metricInvocations()
Sum over 5 minutes
metricInvocations in interface IFunction@Stability(value=Experimental) @NotNull public Metric metricThrottles(@Nullable MetricOptions props)
Sum over 5 minutes
metricThrottles in interface IFunctionprops - @Stability(value=Experimental) @NotNull public Metric metricThrottles()
Sum over 5 minutes
metricThrottles in interface IFunction@Stability(value=Experimental) @NotNull protected abstract Boolean getCanCreatePermissions()
True for new Lambdas, false for version $LATEST and imported Lambdas from different accounts.
@Stability(value=Experimental) @NotNull public Connections getConnections()
Will fail if not a VPC-enabled Lambda Function
getConnections in interface IConnectable@Stability(value=Experimental) @NotNull public abstract String getFunctionArn()
getFunctionArn in interface IClientVpnConnectionHandlergetFunctionArn in interface IFunction@Stability(value=Experimental) @NotNull public abstract String getFunctionName()
getFunctionName in interface IClientVpnConnectionHandlergetFunctionName in interface IFunction@Stability(value=Experimental) @NotNull public abstract IPrincipal getGrantPrincipal()
getGrantPrincipal in interface IGrantable@Stability(value=Experimental) @NotNull public Boolean getIsBoundToVpc()
If this is is false, trying to access the connections object will fail.
getIsBoundToVpc in interface IFunction@Stability(value=Experimental) @NotNull public 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@Stability(value=Experimental) @NotNull public abstract software.constructs.Node getPermissionsNode()
getPermissionsNode in interface IFunctionCopyright © 2021. All rights reserved.