public static interface IVersion.Jsii$Default extends IVersion, IFunction.Jsii$Default
IVersion
.IVersion.Jsii$Default, IVersion.Jsii$Proxy
Modifier and Type | Method and Description |
---|---|
default Alias |
addAlias(java.lang.String aliasName,
AliasOptions options)
Deprecated.
Calling `addAlias` on a `Version` object will cause the Alias to be replaced on every function update. Call `function.addAlias()` or `new Alias()` instead.
|
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 java.lang.String |
getEdgeArn()
The ARN of the version for Lambda@Edge.
|
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 IFunction |
getLambda()
The underlying AWS Lambda function.
|
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 java.lang.String |
getVersion()
The most recently deployed version of this function.
|
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 IFunction.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 IFunction.Jsii$Default
getEnv
in interface IResource
getEnv
in interface IResource.Jsii$Default
default Stack getStack()
getStack
in interface IFunction.Jsii$Default
getStack
in interface IResource
getStack
in interface IResource.Jsii$Default
default Connections getConnections()
getConnections
in interface IConnectable
getConnections
in interface IConnectable.Jsii$Default
getConnections
in interface IFunction.Jsii$Default
default IPrincipal getGrantPrincipal()
getGrantPrincipal
in interface IFunction.Jsii$Default
getGrantPrincipal
in interface IGrantable
getGrantPrincipal
in interface IGrantable.Jsii$Default
default Architecture getArchitecture()
getArchitecture
in interface IFunction
getArchitecture
in interface IFunction.Jsii$Default
default java.lang.String getFunctionArn()
getFunctionArn
in interface IFunction
getFunctionArn
in interface IFunction.Jsii$Default
default java.lang.String getFunctionName()
getFunctionName
in interface IFunction
getFunctionName
in interface IFunction.Jsii$Default
default java.lang.Boolean getIsBoundToVpc()
If this is is false
, trying to access the connections
object will fail.
getIsBoundToVpc
in interface IFunction
getIsBoundToVpc
in interface IFunction.Jsii$Default
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
getLatestVersion
in interface IFunction.Jsii$Default
default ConstructNode getPermissionsNode()
getPermissionsNode
in interface IFunction
getPermissionsNode
in interface IFunction.Jsii$Default
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
getResourceArnsForGrantInvoke
in interface IFunction.Jsii$Default
default IRole getRole()
getRole
in interface IFunction
getRole
in interface IFunction.Jsii$Default
default java.lang.String getEdgeArn()
getEdgeArn
in interface IVersion
default IFunction getLambda()
default java.lang.String getVersion()
getVersion
in interface IVersion
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 IFunction.Jsii$Default
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
addEventSource
in interface IFunction.Jsii$Default
source
- This parameter is required.default EventSourceMapping addEventSourceMapping(java.lang.String id, EventSourceMappingOptions options)
addEventSourceMapping
in interface IFunction
addEventSourceMapping
in interface IFunction.Jsii$Default
id
- construct ID. This parameter is required.options
- mapping options. This parameter is required.default FunctionUrl addFunctionUrl(FunctionUrlOptions options)
addFunctionUrl
in interface IFunction
addFunctionUrl
in interface IFunction.Jsii$Default
options
- default void addPermission(java.lang.String id, Permission permission)
addPermission
in interface IFunction
addPermission
in interface IFunction.Jsii$Default
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
addToRolePolicy
in interface IFunction.Jsii$Default
statement
- This parameter is required.default void configureAsyncInvoke(EventInvokeConfigOptions options)
configureAsyncInvoke
in interface IFunction
configureAsyncInvoke
in interface IFunction.Jsii$Default
options
- This parameter is required.default Grant grantInvoke(IGrantable identity)
grantInvoke
in interface IFunction
grantInvoke
in interface IFunction.Jsii$Default
identity
- This parameter is required.default Grant grantInvokeUrl(IGrantable identity)
grantInvokeUrl
in interface IFunction
grantInvokeUrl
in interface IFunction.Jsii$Default
identity
- This parameter is required.default Metric metric(java.lang.String metricName, MetricOptions props)
metric
in interface IFunction
metric
in interface IFunction.Jsii$Default
metricName
- This parameter is required.props
- default Metric metricDuration(MetricOptions props)
Average over 5 minutes
Default: average over 5 minutes
metricDuration
in interface IFunction
metricDuration
in interface IFunction.Jsii$Default
props
- default Metric metricErrors(MetricOptions props)
Sum over 5 minutes
metricErrors
in interface IFunction
metricErrors
in interface IFunction.Jsii$Default
props
- default Metric metricInvocations(MetricOptions props)
Sum over 5 minutes
Default: sum over 5 minutes
metricInvocations
in interface IFunction
metricInvocations
in interface IFunction.Jsii$Default
props
- default Metric metricThrottles(MetricOptions props)
Sum over 5 minutes
Default: sum over 5 minutes
metricThrottles
in interface IFunction
metricThrottles
in interface IFunction.Jsii$Default
props
- @Deprecated default Alias addAlias(java.lang.String aliasName, AliasOptions options)