Class: AWS.Lambda
- Inherits:
-
AWS.Service
- Object
- AWS.Service
- AWS.Lambda
- Identifier:
- lambda
- API Version:
- 2015-03-31
- Defined in:
- (unknown)
Overview
Constructs a service interface object. Each API operation is exposed as a function on service.
Service Description
Overview
Lambda is a compute service that lets you run code without provisioning or managing servers. Lambda runs your code on a high-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging. With Lambda, you can run code for virtually any type of application or backend service. For more information about the Lambda service, see What is Lambda in the Lambda Developer Guide.
The Lambda API Reference provides information about each of the API methods, including details about the parameters in each API request and response.
You can use Software Development Kits (SDKs), Integrated Development Environment (IDE) Toolkits, and command line tools to access the API. For installation instructions, see Tools for Amazon Web Services.
For a list of Region-specific endpoints that Lambda supports, see Lambda endpoints and quotas in the Amazon Web Services General Reference..
When making the API calls, you will need to authenticate your request by providing a signature. Lambda supports signature version 4. For more information, see Signature Version 4 signing process in the Amazon Web Services General Reference..
CA certificates
Because Amazon Web Services SDKs use the CA certificates from your computer, changes to the certificates on the Amazon Web Services servers can cause connection failures when you attempt to use an SDK. You can prevent these failures by keeping your computer's CA certificates and operating system up-to-date. If you encounter this issue in a corporate environment and do not manage your own computer, you might need to ask an administrator to assist with the update process. The following list shows minimum operating system and Java versions:
-
Microsoft Windows versions that have updates from January 2005 or later installed contain at least one of the required CAs in their trust list.
-
Mac OS X 10.4 with Java for Mac OS X 10.4 Release 5 (February 2007), Mac OS X 10.5 (October 2007), and later versions contain at least one of the required CAs in their trust list.
-
Red Hat Enterprise Linux 5 (March 2007), 6, and 7 and CentOS 5, 6, and 7 all contain at least one of the required CAs in their default trusted CA list.
-
Java 1.4.2_12 (May 2006), 5 Update 2 (March 2005), and all later versions, including Java 6 (December 2006), 7, and 8, contain at least one of the required CAs in their default trusted CA list.
When accessing the Lambda management console or Lambda API endpoints, whether through browsers or programmatically, you will need to ensure your client machines support any of the following CAs:
-
Amazon Root CA 1
-
Starfield Services Root Certificate Authority - G2
-
Starfield Class 2 Certification Authority
Root certificates from the first two authorities are available from Amazon trust services, but keeping your computer up-to-date is the more straightforward solution. To learn more about ACM-provided certificates, see Amazon Web Services Certificate Manager FAQs.
Sending a Request Using Lambda
var lambda = new AWS.Lambda();
lambda.addLayerVersionPermission(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Locking the API Version
In order to ensure that the Lambda object uses this specific API, you can
construct the object by passing the apiVersion
option to the constructor:
var lambda = new AWS.Lambda({apiVersion: '2015-03-31'});
You can also set the API version globally in AWS.config.apiVersions
using
the lambda service identifier:
AWS.config.apiVersions = {
lambda: '2015-03-31',
// other service API versions
};
var lambda = new AWS.Lambda();
Version:
-
2015-03-31
Waiter Resource States
This service supports a list of resource states that can be polled using the waitFor() method. The resource states are:
functionExists, functionActive, functionUpdated, functionActiveV2, functionUpdatedV2, publishedVersionActive
Constructor Summary collapse
-
new AWS.Lambda(options = {}) ⇒ Object
constructor
Constructs a service object.
Property Summary collapse
-
endpoint ⇒ AWS.Endpoint
readwrite
An Endpoint object representing the endpoint URL for service requests.
Properties inherited from AWS.Service
Method Summary collapse
-
addLayerVersionPermission(params = {}, callback) ⇒ AWS.Request
Adds permissions to the resource-based policy of a version of an Lambda layer.
-
addPermission(params = {}, callback) ⇒ AWS.Request
Grants an Amazon Web Servicesservice, Amazon Web Services account, or Amazon Web Services organization permission to use a function.
-
createAlias(params = {}, callback) ⇒ AWS.Request
Creates an alias for a Lambda function version.
-
createCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
Creates a code signing configuration.
-
createEventSourceMapping(params = {}, callback) ⇒ AWS.Request
Creates a mapping between an event source and an Lambda function.
-
createFunction(params = {}, callback) ⇒ AWS.Request
Creates a Lambda function.
-
createFunctionUrlConfig(params = {}, callback) ⇒ AWS.Request
Creates a Lambda function URL with the specified configuration parameters.
-
deleteAlias(params = {}, callback) ⇒ AWS.Request
Deletes a Lambda function alias.
.
-
deleteCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
Deletes the code signing configuration.
-
deleteEventSourceMapping(params = {}, callback) ⇒ AWS.Request
Deletes an event source mapping.
-
deleteFunction(params = {}, callback) ⇒ AWS.Request
Deletes a Lambda function.
-
deleteFunctionCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
Removes the code signing configuration from the function.
.
-
deleteFunctionConcurrency(params = {}, callback) ⇒ AWS.Request
Removes a concurrent execution limit from a function.
.
-
deleteFunctionEventInvokeConfig(params = {}, callback) ⇒ AWS.Request
Deletes the configuration for asynchronous invocation for a function, version, or alias.
To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.
. -
deleteFunctionUrlConfig(params = {}, callback) ⇒ AWS.Request
Deletes a Lambda function URL.
-
deleteLayerVersion(params = {}, callback) ⇒ AWS.Request
Deletes a version of an Lambda layer.
-
deleteProvisionedConcurrencyConfig(params = {}, callback) ⇒ AWS.Request
Deletes the provisioned concurrency configuration for a function.
.
-
getAccountSettings(params = {}, callback) ⇒ AWS.Request
Retrieves details about your account's limits and usage in an Amazon Web Services Region.
.
-
getAlias(params = {}, callback) ⇒ AWS.Request
Returns details about a Lambda function alias.
.
-
getCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
Returns information about the specified code signing configuration.
.
-
getEventSourceMapping(params = {}, callback) ⇒ AWS.Request
Returns details about an event source mapping.
-
getFunction(params = {}, callback) ⇒ AWS.Request
Returns information about the function or function version, with a link to download the deployment package that's valid for 10 minutes.
-
getFunctionCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
Returns the code signing configuration for the specified function.
.
-
getFunctionConcurrency(params = {}, callback) ⇒ AWS.Request
Returns details about the reserved concurrency configuration for a function.
-
getFunctionConfiguration(params = {}, callback) ⇒ AWS.Request
Returns the version-specific settings of a Lambda function or version.
-
getFunctionEventInvokeConfig(params = {}, callback) ⇒ AWS.Request
Retrieves the configuration for asynchronous invocation for a function, version, or alias.
To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.
. -
getFunctionRecursionConfig(params = {}, callback) ⇒ AWS.Request
Returns your function's recursive loop detection configuration.
-
getFunctionUrlConfig(params = {}, callback) ⇒ AWS.Request
Returns details about a Lambda function URL.
.
-
getLayerVersion(params = {}, callback) ⇒ AWS.Request
Returns information about a version of an Lambda layer, with a link to download the layer archive that's valid for 10 minutes.
.
-
getLayerVersionByArn(params = {}, callback) ⇒ AWS.Request
Returns information about a version of an Lambda layer, with a link to download the layer archive that's valid for 10 minutes.
.
-
getLayerVersionPolicy(params = {}, callback) ⇒ AWS.Request
Returns the permission policy for a version of an Lambda layer.
-
getPolicy(params = {}, callback) ⇒ AWS.Request
Returns the resource-based IAM policy for a function, version, or alias.
.
-
getProvisionedConcurrencyConfig(params = {}, callback) ⇒ AWS.Request
Retrieves the provisioned concurrency configuration for a function's alias or version.
.
-
getRuntimeManagementConfig(params = {}, callback) ⇒ AWS.Request
Retrieves the runtime management configuration for a function's version.
-
invoke(params = {}, callback) ⇒ AWS.Request
Invokes a Lambda function.
-
invokeAsync(params = {}, callback) ⇒ AWS.Request
For asynchronous function invocation, use Invoke.
Invokes a function asynchronously.
Note: If you do use the InvokeAsync action, note that it doesn't support the use of X-Ray active tracing.- invokeWithResponseStream(params = {}, callback) ⇒ AWS.Request
Configure your Lambda functions to stream response payloads back to clients.
- listAliases(params = {}, callback) ⇒ AWS.Request
Returns a list of aliases for a Lambda function.
.
- listCodeSigningConfigs(params = {}, callback) ⇒ AWS.Request
Returns a list of code signing configurations.
- listEventSourceMappings(params = {}, callback) ⇒ AWS.Request
Lists event source mappings.
- listFunctionEventInvokeConfigs(params = {}, callback) ⇒ AWS.Request
Retrieves a list of configurations for asynchronous invocation for a function.
To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.
.- listFunctions(params = {}, callback) ⇒ AWS.Request
Returns a list of Lambda functions, with the version-specific configuration of each.
- listFunctionsByCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
List the functions that use the specified code signing configuration.
- listFunctionUrlConfigs(params = {}, callback) ⇒ AWS.Request
Returns a list of Lambda function URLs for the specified function.
.
- listLayers(params = {}, callback) ⇒ AWS.Request
Lists Lambda layers and shows information about the latest version of each.
- listLayerVersions(params = {}, callback) ⇒ AWS.Request
Lists the versions of an Lambda layer.
- listProvisionedConcurrencyConfigs(params = {}, callback) ⇒ AWS.Request
Retrieves a list of provisioned concurrency configurations for a function.
.
- listTags(params = {}, callback) ⇒ AWS.Request
Returns a function's tags.
- listVersionsByFunction(params = {}, callback) ⇒ AWS.Request
Returns a list of versions, with the version-specific configuration of each.
- publishLayerVersion(params = {}, callback) ⇒ AWS.Request
Creates an Lambda layer from a ZIP archive.
- publishVersion(params = {}, callback) ⇒ AWS.Request
Creates a version from the current code and configuration of a function.
- putFunctionCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
Update the code signing configuration for the function.
- putFunctionConcurrency(params = {}, callback) ⇒ AWS.Request
Sets the maximum number of simultaneous executions for a function, and reserves capacity for that concurrency level.
Concurrency settings apply to the function as a whole, including all published versions and the unpublished version.
- putFunctionEventInvokeConfig(params = {}, callback) ⇒ AWS.Request
Configures options for asynchronous invocation on a function, version, or alias.
- putFunctionRecursionConfig(params = {}, callback) ⇒ AWS.Request
Sets your function's recursive loop detection configuration.
When you configure a Lambda function to output to the same service or resource that invokes the function, it's possible to create an infinite recursive loop.
- putProvisionedConcurrencyConfig(params = {}, callback) ⇒ AWS.Request
Adds a provisioned concurrency configuration to a function's alias or version.
.
- putRuntimeManagementConfig(params = {}, callback) ⇒ AWS.Request
Sets the runtime management configuration for a function's version.
- removeLayerVersionPermission(params = {}, callback) ⇒ AWS.Request
Removes a statement from the permissions policy for a version of an Lambda layer.
- removePermission(params = {}, callback) ⇒ AWS.Request
Revokes function-use permission from an Amazon Web Servicesservice or another Amazon Web Services account.
- tagResource(params = {}, callback) ⇒ AWS.Request
Adds tags to a function.
.
- untagResource(params = {}, callback) ⇒ AWS.Request
Removes tags from a function.
.
- updateAlias(params = {}, callback) ⇒ AWS.Request
Updates the configuration of a Lambda function alias.
.
- updateCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
Update the code signing configuration.
- updateEventSourceMapping(params = {}, callback) ⇒ AWS.Request
Updates an event source mapping.
- updateFunctionCode(params = {}, callback) ⇒ AWS.Request
Updates a Lambda function's code.
- updateFunctionConfiguration(params = {}, callback) ⇒ AWS.Request
Modify the version-specific settings of a Lambda function.
When you update a function, Lambda provisions an instance of the function and its supporting resources.
- updateFunctionEventInvokeConfig(params = {}, callback) ⇒ AWS.Request
Updates the configuration for asynchronous invocation for a function, version, or alias.
To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.
.- updateFunctionUrlConfig(params = {}, callback) ⇒ AWS.Request
Updates the configuration for a Lambda function URL.
.
- waitFor(state, params = {}, callback) ⇒ AWS.Request
Waits for a given Lambda resource.
Methods inherited from AWS.Service
makeRequest, makeUnauthenticatedRequest, defineService
Constructor Details
new AWS.Lambda(options = {}) ⇒ Object
Constructs a service object. This object has one method for each API operation.
Examples:
Constructing a Lambda object
var lambda = new AWS.Lambda({apiVersion: '2015-03-31'});
Options Hash (options):
-
params
(map)
—
An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.
-
endpoint
(String|AWS.Endpoint)
—
The endpoint URI to send requests to. The default endpoint is built from the configured
region
. The endpoint should be a string like'https://{service}.{region}.amazonaws.com'
or an Endpoint object. -
accessKeyId
(String)
—
your AWS access key ID.
-
secretAccessKey
(String)
—
your AWS secret access key.
-
sessionToken
(AWS.Credentials)
—
the optional AWS session token to sign requests with.
-
credentials
(AWS.Credentials)
—
the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.
-
credentialProvider
(AWS.CredentialProviderChain)
—
the provider chain used to resolve credentials if no static
credentials
property is set. -
region
(String)
—
the region to send service requests to. See AWS.Lambda.region for more information.
-
maxRetries
(Integer)
—
the maximum amount of retries to attempt with a request. See AWS.Lambda.maxRetries for more information.
-
maxRedirects
(Integer)
—
the maximum amount of redirects to follow with a request. See AWS.Lambda.maxRedirects for more information.
-
sslEnabled
(Boolean)
—
whether to enable SSL for requests.
-
paramValidation
(Boolean|map)
—
whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:
- min [Boolean] — Validates that a value meets the min
constraint. This is enabled by default when paramValidation is set
to
true
. - max [Boolean] — Validates that a value meets the max constraint.
- pattern [Boolean] — Validates that a string value matches a regular expression.
- enum [Boolean] — Validates that a string value matches one of the allowable enum values.
- min [Boolean] — Validates that a value meets the min
constraint. This is enabled by default when paramValidation is set
to
-
computeChecksums
(Boolean)
—
whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)
-
convertResponseTypes
(Boolean)
—
whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to
true
. -
correctClockSkew
(Boolean)
—
whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to
false
. -
s3ForcePathStyle
(Boolean)
—
whether to force path style URLs for S3 objects.
-
s3BucketEndpoint
(Boolean)
—
whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an
endpoint
to be provided explicitly to the service constructor. -
s3DisableBodySigning
(Boolean)
—
whether S3 body signing should be disabled when using signature version
v4
. Body signing can only be disabled when using https. Defaults totrue
. -
s3UsEast1RegionalEndpoint
('legacy'|'regional')
—
when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to
legacy
-
s3UseArnRegion
(Boolean)
—
whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to
true
-
retryDelayOptions
(map)
—
A set of options to configure the retry delay on retryable errors. Currently supported options are:
- base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
- customBackoff [function] — A custom function that accepts a
retry count and error and returns the amount of time to delay in
milliseconds. If the result is a non-zero negative value, no further
retry attempts will be made. The
base
option will be ignored if this option is supplied. The function is only called for retryable errors.
-
httpOptions
(map)
—
A set of options to pass to the low-level HTTP request. Currently supported options are:
- proxy [String] — the URL to proxy requests through
- agent [http.Agent, https.Agent] — the Agent object to perform
HTTP requests with. Used for connection pooling. Defaults to the global
agent (
http.globalAgent
) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment. - connectTimeout [Integer] — Sets the socket to timeout after
failing to establish a connection with the server after
connectTimeout
milliseconds. This timeout has no effect once a socket connection has been established. - timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
- xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
- xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
-
apiVersion
(String, Date)
—
a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by
apiVersions
). Specify 'latest' to use the latest possible version. -
apiVersions
(map<String, String|Date>)
—
a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.
-
logger
(#write, #log)
—
an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests
-
systemClockOffset
(Number)
—
an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global
AWS.config
object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds. -
signatureVersion
(String)
—
the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.
-
signatureCache
(Boolean)
—
whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to
true
. -
dynamoDbCrc32
(Boolean)
—
whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default:
true
. -
useAccelerateEndpoint
(Boolean)
—
Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default:
false
. -
clientSideMonitoring
(Boolean)
—
whether to collect and publish this client's performance metrics of all its API requests.
-
endpointDiscoveryEnabled
(Boolean|undefined)
—
whether to call operations with endpoints given by service dynamically. Setting this
-
endpointCacheSize
(Number)
—
the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000
-
hostPrefixEnabled
(Boolean)
—
whether to marshal request parameters to the prefix of hostname. Defaults to
true
. -
stsRegionalEndpoints
('legacy'|'regional')
—
whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.
-
useFipsEndpoint
(Boolean)
—
Enables FIPS compatible endpoints. Defaults to
false
. -
useDualstackEndpoint
(Boolean)
—
Enables IPv6 dualstack endpoint. Defaults to
false
.
Property Details
Method Details
addLayerVersionPermission(params = {}, callback) ⇒ AWS.Request
Adds permissions to the resource-based policy of a version of an Lambda layer. Use this action to grant layer usage permission to other accounts. You can grant permission to a single account, all accounts in an organization, or all Amazon Web Services accounts.
To revoke permission, call RemoveLayerVersionPermission with the statement ID that you specified when you added it.
Service Reference:
Examples:
Calling the addLayerVersionPermission operation
var params = { Action: 'STRING_VALUE', /* required */ LayerName: 'STRING_VALUE', /* required */ Principal: 'STRING_VALUE', /* required */ StatementId: 'STRING_VALUE', /* required */ VersionNumber: 'NUMBER_VALUE', /* required */ OrganizationId: 'STRING_VALUE', RevisionId: 'STRING_VALUE' }; lambda.addLayerVersionPermission(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
LayerName
— (String
)The name or Amazon Resource Name (ARN) of the layer.
VersionNumber
— (Integer
)The version number.
StatementId
— (String
)An identifier that distinguishes the policy from others on the same layer version.
Action
— (String
)The API action that grants access to the layer. For example,
lambda:GetLayerVersion
.Principal
— (String
)An account ID, or
*
to grant layer usage permission to all accounts in an organization, or all Amazon Web Services accounts (iforganizationId
is not specified). For the last case, make sure that you really do want all Amazon Web Services accounts to have usage permission to this layer.OrganizationId
— (String
)With the principal set to
*
, grant permission to all accounts in the specified organization.RevisionId
— (String
)Only update the policy if the revision ID matches the ID specified. Use this option to avoid modifying a policy that has changed since you last read it.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Statement
— (String
)The permission statement.
RevisionId
— (String
)A unique identifier for the current revision of the policy.
-
(AWS.Response)
—
Returns:
addPermission(params = {}, callback) ⇒ AWS.Request
Grants an Amazon Web Servicesservice, Amazon Web Services account, or Amazon Web Services organization permission to use a function. You can apply the policy at the function level, or specify a qualifier to restrict access to a single version or alias. If you use a qualifier, the invoker must use the full Amazon Resource Name (ARN) of that version or alias to invoke the function. Note: Lambda does not support adding policies to version $LATEST.
To grant permission to another account, specify the account ID as the
Principal
. To grant permission to an organization defined in Organizations, specify the organization ID as thePrincipalOrgID
. For Amazon Web Servicesservices, the principal is a domain-style identifier that the service defines, such ass3.amazonaws.com
orsns.amazonaws.com
. For Amazon Web Servicesservices, you can also specify the ARN of the associated resource as theSourceArn
. If you grant permission to a service principal without specifying the source, other accounts could potentially configure resources in their account to invoke your Lambda function.This operation adds a statement to a resource-based permissions policy for the function. For more information about function policies, see Using resource-based policies for Lambda.
Service Reference:
Examples:
Calling the addPermission operation
var params = { Action: 'STRING_VALUE', /* required */ FunctionName: 'STRING_VALUE', /* required */ Principal: 'STRING_VALUE', /* required */ StatementId: 'STRING_VALUE', /* required */ EventSourceToken: 'STRING_VALUE', FunctionUrlAuthType: NONE | AWS_IAM, PrincipalOrgID: 'STRING_VALUE', Qualifier: 'STRING_VALUE', RevisionId: 'STRING_VALUE', SourceAccount: 'STRING_VALUE', SourceArn: 'STRING_VALUE' }; lambda.addPermission(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function
(name-only),my-function:v1
(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
StatementId
— (String
)A statement identifier that differentiates the statement from others in the same policy.
Action
— (String
)The action that the principal can use on the function. For example,
lambda:InvokeFunction
orlambda:GetFunction
.Principal
— (String
)The Amazon Web Servicesservice or Amazon Web Services account that invokes the function. If you specify a service, use
SourceArn
orSourceAccount
to limit who can invoke the function through that service.SourceArn
— (String
)For Amazon Web Servicesservices, the ARN of the Amazon Web Services resource that invokes the function. For example, an Amazon S3 bucket or Amazon SNS topic.
Note that Lambda configures the comparison using the
StringLike
operator.SourceAccount
— (String
)For Amazon Web Servicesservice, the ID of the Amazon Web Services account that owns the resource. Use this together with
SourceArn
to ensure that the specified account owns the resource. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account.EventSourceToken
— (String
)For Alexa Smart Home functions, a token that the invoker must supply.
Qualifier
— (String
)Specify a version or alias to add permissions to a published version of the function.
RevisionId
— (String
)Update the policy only if the revision ID matches the ID that's specified. Use this option to avoid modifying a policy that has changed since you last read it.
PrincipalOrgID
— (String
)The identifier for your organization in Organizations. Use this to grant permissions to all the Amazon Web Services accounts under this organization.
FunctionUrlAuthType
— (String
)The type of authentication that your function URL uses. Set to
Possible values include:AWS_IAM
if you want to restrict access to authenticated users only. Set toNONE
if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs."NONE"
"AWS_IAM"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Statement
— (String
)The permission statement that's added to the function policy.
-
(AWS.Response)
—
Returns:
createAlias(params = {}, callback) ⇒ AWS.Request
Creates an alias for a Lambda function version. Use aliases to provide clients with a function identifier that you can update to invoke a different version.
You can also map an alias to split invocation requests between two versions. Use the
RoutingConfig
parameter to specify a second version and the percentage of invocation requests that it receives.Service Reference:
Examples:
Calling the createAlias operation
var params = { FunctionName: 'STRING_VALUE', /* required */ FunctionVersion: 'STRING_VALUE', /* required */ Name: 'STRING_VALUE', /* required */ Description: 'STRING_VALUE', RoutingConfig: { AdditionalVersionWeights: { '<AdditionalVersion>': 'NUMBER_VALUE', /* '<AdditionalVersion>': ... */ } } }; lambda.createAlias(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Partial ARN -
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Name
— (String
)The name of the alias.
FunctionVersion
— (String
)The function version that the alias invokes.
Description
— (String
)A description of the alias.
RoutingConfig
— (map
)The routing configuration of the alias.
AdditionalVersionWeights
— (map<Float>
)The second version, and the percentage of traffic that's routed to it.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:AliasArn
— (String
)The Amazon Resource Name (ARN) of the alias.
Name
— (String
)The name of the alias.
FunctionVersion
— (String
)The function version that the alias invokes.
Description
— (String
)A description of the alias.
RoutingConfig
— (map
)The routing configuration of the alias.
AdditionalVersionWeights
— (map<Float>
)The second version, and the percentage of traffic that's routed to it.
RevisionId
— (String
)A unique identifier that changes when you update the alias.
-
(AWS.Response)
—
Returns:
createCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
Creates a code signing configuration. A code signing configuration defines a list of allowed signing profiles and defines the code-signing validation policy (action to be taken if deployment validation checks fail).
Service Reference:
Examples:
Calling the createCodeSigningConfig operation
var params = { AllowedPublishers: { /* required */ SigningProfileVersionArns: [ /* required */ 'STRING_VALUE', /* more items */ ] }, CodeSigningPolicies: { UntrustedArtifactOnDeployment: Warn | Enforce }, Description: 'STRING_VALUE' }; lambda.createCodeSigningConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
Description
— (String
)Descriptive name for this code signing configuration.
AllowedPublishers
— (map
)Signing profiles for this code signing configuration.
SigningProfileVersionArns
— required — (Array<String>
)The Amazon Resource Name (ARN) for each of the signing profiles. A signing profile defines a trusted user who can sign a code package.
CodeSigningPolicies
— (map
)The code signing policies define the actions to take if the validation checks fail.
UntrustedArtifactOnDeployment
— (String
)Code signing configuration policy for deployment validation failure. If you set the policy to
Enforce
, Lambda blocks the deployment request if signature validation checks fail. If you set the policy toWarn
, Lambda allows the deployment and creates a CloudWatch log.Default value:
Possible values include:Warn
"Warn"
"Enforce"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CodeSigningConfig
— (map
)The code signing configuration.
CodeSigningConfigId
— required — (String
)Unique identifer for the Code signing configuration.
CodeSigningConfigArn
— required — (String
)The Amazon Resource Name (ARN) of the Code signing configuration.
Description
— (String
)Code signing configuration description.
AllowedPublishers
— required — (map
)List of allowed publishers.
SigningProfileVersionArns
— required — (Array<String>
)The Amazon Resource Name (ARN) for each of the signing profiles. A signing profile defines a trusted user who can sign a code package.
CodeSigningPolicies
— required — (map
)The code signing policy controls the validation failure action for signature mismatch or expiry.
UntrustedArtifactOnDeployment
— (String
)Code signing configuration policy for deployment validation failure. If you set the policy to
Enforce
, Lambda blocks the deployment request if signature validation checks fail. If you set the policy toWarn
, Lambda allows the deployment and creates a CloudWatch log.Default value:
Possible values include:Warn
"Warn"
"Enforce"
LastModified
— required — (String
)The date and time that the Code signing configuration was last modified, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
-
(AWS.Response)
—
Returns:
createEventSourceMapping(params = {}, callback) ⇒ AWS.Request
Creates a mapping between an event source and an Lambda function. Lambda reads items from the event source and invokes the function.
For details about how to configure different event sources, see the following topics.
The following error handling options are available only for stream sources (DynamoDB and Kinesis):
-
BisectBatchOnFunctionError
– If the function returns an error, split the batch in two and retry. -
DestinationConfig
– Send discarded records to an Amazon SQS queue or Amazon SNS topic. -
MaximumRecordAgeInSeconds
– Discard records older than the specified age. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires -
MaximumRetryAttempts
– Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires. -
ParallelizationFactor
– Process multiple batches from each shard concurrently.
For information about which configuration parameters apply to each event source, see the following topics.
Service Reference:
Examples:
Calling the createEventSourceMapping operation
var params = { FunctionName: 'STRING_VALUE', /* required */ AmazonManagedKafkaEventSourceConfig: { ConsumerGroupId: 'STRING_VALUE' }, BatchSize: 'NUMBER_VALUE', BisectBatchOnFunctionError: true || false, DestinationConfig: { OnFailure: { Destination: 'STRING_VALUE' }, OnSuccess: { Destination: 'STRING_VALUE' } }, DocumentDBEventSourceConfig: { CollectionName: 'STRING_VALUE', DatabaseName: 'STRING_VALUE', FullDocument: UpdateLookup | Default }, Enabled: true || false, EventSourceArn: 'STRING_VALUE', FilterCriteria: { Filters: [ { Pattern: 'STRING_VALUE' }, /* more items */ ] }, FunctionResponseTypes: [ ReportBatchItemFailures, /* more items */ ], KMSKeyArn: 'STRING_VALUE', MaximumBatchingWindowInSeconds: 'NUMBER_VALUE', MaximumRecordAgeInSeconds: 'NUMBER_VALUE', MaximumRetryAttempts: 'NUMBER_VALUE', ParallelizationFactor: 'NUMBER_VALUE', Queues: [ 'STRING_VALUE', /* more items */ ], ScalingConfig: { MaximumConcurrency: 'NUMBER_VALUE' }, SelfManagedEventSource: { Endpoints: { '<EndPointType>': [ 'STRING_VALUE', /* more items */ ], /* '<EndPointType>': ... */ } }, SelfManagedKafkaEventSourceConfig: { ConsumerGroupId: 'STRING_VALUE' }, SourceAccessConfigurations: [ { Type: BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH | VIRTUAL_HOST | CLIENT_CERTIFICATE_TLS_AUTH | SERVER_ROOT_CA_CERTIFICATE, URI: 'STRING_VALUE' }, /* more items */ ], StartingPosition: TRIM_HORIZON | LATEST | AT_TIMESTAMP, StartingPositionTimestamp: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, Topics: [ 'STRING_VALUE', /* more items */ ], TumblingWindowInSeconds: 'NUMBER_VALUE' }; lambda.createEventSourceMapping(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
EventSourceArn
— (String
)The Amazon Resource Name (ARN) of the event source.
-
Amazon Kinesis – The ARN of the data stream or a stream consumer.
-
Amazon DynamoDB Streams – The ARN of the stream.
-
Amazon Simple Queue Service – The ARN of the queue.
-
Amazon Managed Streaming for Apache Kafka – The ARN of the cluster or the ARN of the VPC connection (for cross-account event source mappings).
-
Amazon MQ – The ARN of the broker.
-
Amazon DocumentDB – The ARN of the DocumentDB change stream.
-
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
MyFunction
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Version or Alias ARN –
arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD
. -
Partial ARN –
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.
-
Enabled
— (Boolean
)When true, the event source mapping is active. When false, Lambda pauses polling and invocation.
Default: True
BatchSize
— (Integer
)The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).
-
Amazon Kinesis – Default 100. Max 10,000.
-
Amazon DynamoDB Streams – Default 100. Max 10,000.
-
Amazon Simple Queue Service – Default 10. For standard queues the max is 10,000. For FIFO queues the max is 10.
-
Amazon Managed Streaming for Apache Kafka – Default 100. Max 10,000.
-
Self-managed Apache Kafka – Default 100. Max 10,000.
-
Amazon MQ (ActiveMQ and RabbitMQ) – Default 100. Max 10,000.
-
DocumentDB – Default 100. Max 10,000.
-
FilterCriteria
— (map
)An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see Lambda event filtering.
Filters
— (Array<map>
)A list of filters.
Pattern
— (String
)A filter pattern. For more information on the syntax of a filter pattern, see Filter rule syntax.
MaximumBatchingWindowInSeconds
— (Integer
)The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure
MaximumBatchingWindowInSeconds
to any value from 0 seconds to 300 seconds in increments of seconds.For Kinesis, DynamoDB, and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching window is 500 ms. Note that because you can only change
MaximumBatchingWindowInSeconds
in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it. To restore the default batching window, you must create a new event source mapping.Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, when you set
BatchSize
to a value greater than 10, you must setMaximumBatchingWindowInSeconds
to at least 1.ParallelizationFactor
— (Integer
)(Kinesis and DynamoDB Streams only) The number of batches to process from each shard concurrently.
StartingPosition
— (String
)The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Stream event sources.
Possible values include:AT_TIMESTAMP
is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed Apache Kafka."TRIM_HORIZON"
"LATEST"
"AT_TIMESTAMP"
StartingPositionTimestamp
— (Date
)With
StartingPosition
set toAT_TIMESTAMP
, the time from which to start reading.StartingPositionTimestamp
cannot be in the future.DestinationConfig
— (map
)(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Kafka only) A configuration object that specifies the destination of an event after Lambda processes it.
OnSuccess
— (map
)The destination configuration for successful invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
OnFailure
— (map
)The destination configuration for failed invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
To retain records of asynchronous invocations, you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.
To retain records of failed invocations from Kinesis and DynamoDB event sources, you can configure an Amazon SNS topic or Amazon SQS queue as the destination.
To retain records of failed invocations from self-managed Kafka or Amazon MSK, you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.
MaximumRecordAgeInSeconds
— (Integer
)(Kinesis and DynamoDB Streams only) Discard records older than the specified age. The default value is infinite (-1).
BisectBatchOnFunctionError
— (Boolean
)(Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry.
MaximumRetryAttempts
— (Integer
)(Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires.
TumblingWindowInSeconds
— (Integer
)(Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window.
Topics
— (Array<String>
)The name of the Kafka topic.
Queues
— (Array<String>
)(MQ) The name of the Amazon MQ broker destination queue to consume.
SourceAccessConfigurations
— (Array<map>
)An array of authentication protocols or VPC components required to secure your event source.
Type
— (String
)The type of authentication protocol, VPC components, or virtual host for your event source. For example:
"Type":"SASL_SCRAM_512_AUTH"
.-
BASIC_AUTH
– (Amazon MQ) The Secrets Manager secret that stores your broker credentials. -
BASIC_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers. -
VPC_SUBNET
– (Self-managed Apache Kafka) The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your self-managed Apache Kafka cluster. -
VPC_SECURITY_GROUP
– (Self-managed Apache Kafka) The VPC security group used to manage access to your self-managed Apache Kafka brokers. -
SASL_SCRAM_256_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your self-managed Apache Kafka brokers. -
SASL_SCRAM_512_AUTH
– (Amazon MSK, Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your self-managed Apache Kafka brokers. -
VIRTUAL_HOST
–- (RabbitMQ) The name of the virtual host in your RabbitMQ broker. Lambda uses this RabbitMQ host as the event source. This property cannot be specified in an UpdateEventSourceMapping API call. -
CLIENT_CERTIFICATE_TLS_AUTH
– (Amazon MSK, self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and private key password (optional) used for mutual TLS authentication of your MSK/Apache Kafka brokers. -
SERVER_ROOT_CA_CERTIFICATE
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the root CA certificate (X.509 PEM) used for TLS encryption of your Apache Kafka brokers.
"BASIC_AUTH"
"VPC_SUBNET"
"VPC_SECURITY_GROUP"
"SASL_SCRAM_512_AUTH"
"SASL_SCRAM_256_AUTH"
"VIRTUAL_HOST"
"CLIENT_CERTIFICATE_TLS_AUTH"
"SERVER_ROOT_CA_CERTIFICATE"
-
URI
— (String
)The value for your chosen configuration in
Type
. For example:"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"
.
SelfManagedEventSource
— (map
)The self-managed Apache Kafka cluster to receive records from.
Endpoints
— (map<Array<String>>
)The list of bootstrap servers for your Kafka brokers in the following format:
"KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]
.
FunctionResponseTypes
— (Array<String>
)(Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event source mapping.
AmazonManagedKafkaEventSourceConfig
— (map
)Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
ConsumerGroupId
— (String
)The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see Customizable consumer group ID.
SelfManagedKafkaEventSourceConfig
— (map
)Specific configuration settings for a self-managed Apache Kafka event source.
ConsumerGroupId
— (String
)The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see Customizable consumer group ID.
ScalingConfig
— (map
)(Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring maximum concurrency for Amazon SQS event sources.
MaximumConcurrency
— (Integer
)Limits the number of concurrent instances that the Amazon SQS event source can invoke.
DocumentDBEventSourceConfig
— (map
)Specific configuration settings for a DocumentDB event source.
DatabaseName
— (String
)The name of the database to consume within the DocumentDB cluster.
CollectionName
— (String
)The name of the collection to consume within the database. If you do not specify a collection, Lambda consumes all collections.
FullDocument
— (String
)Determines what DocumentDB sends to your event stream during document update operations. If set to UpdateLookup, DocumentDB sends a delta describing the changes, along with a copy of the entire document. Otherwise, DocumentDB sends only a partial document that contains the changes.
Possible values include:"UpdateLookup"
"Default"
KMSKeyArn
— (String
)The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your function's filter criteria. By default, Lambda does not encrypt your filter criteria object. Specify this property to encrypt data using your own customer managed key.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UUID
— (String
)The identifier of the event source mapping.
StartingPosition
— (String
)The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Stream event sources.
Possible values include:AT_TIMESTAMP
is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed Apache Kafka."TRIM_HORIZON"
"LATEST"
"AT_TIMESTAMP"
StartingPositionTimestamp
— (Date
)With
StartingPosition
set toAT_TIMESTAMP
, the time from which to start reading.StartingPositionTimestamp
cannot be in the future.BatchSize
— (Integer
)The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).
Default value: Varies by service. For Amazon SQS, the default is 10. For all other services, the default is 100.
Related setting: When you set
BatchSize
to a value greater than 10, you must setMaximumBatchingWindowInSeconds
to at least 1.MaximumBatchingWindowInSeconds
— (Integer
)The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure
MaximumBatchingWindowInSeconds
to any value from 0 seconds to 300 seconds in increments of seconds.For streams and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching window is 500 ms. Note that because you can only change
MaximumBatchingWindowInSeconds
in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it. To restore the default batching window, you must create a new event source mapping.Related setting: For streams and Amazon SQS event sources, when you set
BatchSize
to a value greater than 10, you must setMaximumBatchingWindowInSeconds
to at least 1.ParallelizationFactor
— (Integer
)(Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.
EventSourceArn
— (String
)The Amazon Resource Name (ARN) of the event source.
FilterCriteria
— (map
)An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see Lambda event filtering.
If filter criteria is encrypted, this field shows up as
null
in the response of ListEventSourceMapping API calls. You can view this field in plaintext in the response of GetEventSourceMapping and DeleteEventSourceMapping calls if you havekms:Decrypt
permissions for the correct KMS key.Filters
— (Array<map>
)A list of filters.
Pattern
— (String
)A filter pattern. For more information on the syntax of a filter pattern, see Filter rule syntax.
FunctionArn
— (String
)The ARN of the Lambda function.
LastModified
— (Date
)The date that the event source mapping was last updated or that its state changed.
LastProcessingResult
— (String
)The result of the last Lambda invocation of your function.
State
— (String
)The state of the event source mapping. It can be one of the following:
Creating
,Enabling
,Enabled
,Disabling
,Disabled
,Updating
, orDeleting
.StateTransitionReason
— (String
)Indicates whether a user or Lambda made the last change to the event source mapping.
DestinationConfig
— (map
)(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka event sources only) A configuration object that specifies the destination of an event after Lambda processes it.
OnSuccess
— (map
)The destination configuration for successful invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
OnFailure
— (map
)The destination configuration for failed invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
To retain records of asynchronous invocations, you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.
To retain records of failed invocations from Kinesis and DynamoDB event sources, you can configure an Amazon SNS topic or Amazon SQS queue as the destination.
To retain records of failed invocations from self-managed Kafka or Amazon MSK, you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.
Topics
— (Array<String>
)The name of the Kafka topic.
Queues
— (Array<String>
)(Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
SourceAccessConfigurations
— (Array<map>
)An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
Type
— (String
)The type of authentication protocol, VPC components, or virtual host for your event source. For example:
"Type":"SASL_SCRAM_512_AUTH"
.-
BASIC_AUTH
– (Amazon MQ) The Secrets Manager secret that stores your broker credentials. -
BASIC_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers. -
VPC_SUBNET
– (Self-managed Apache Kafka) The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your self-managed Apache Kafka cluster. -
VPC_SECURITY_GROUP
– (Self-managed Apache Kafka) The VPC security group used to manage access to your self-managed Apache Kafka brokers. -
SASL_SCRAM_256_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your self-managed Apache Kafka brokers. -
SASL_SCRAM_512_AUTH
– (Amazon MSK, Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your self-managed Apache Kafka brokers. -
VIRTUAL_HOST
–- (RabbitMQ) The name of the virtual host in your RabbitMQ broker. Lambda uses this RabbitMQ host as the event source. This property cannot be specified in an UpdateEventSourceMapping API call. -
CLIENT_CERTIFICATE_TLS_AUTH
– (Amazon MSK, self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and private key password (optional) used for mutual TLS authentication of your MSK/Apache Kafka brokers. -
SERVER_ROOT_CA_CERTIFICATE
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the root CA certificate (X.509 PEM) used for TLS encryption of your Apache Kafka brokers.
"BASIC_AUTH"
"VPC_SUBNET"
"VPC_SECURITY_GROUP"
"SASL_SCRAM_512_AUTH"
"SASL_SCRAM_256_AUTH"
"VIRTUAL_HOST"
"CLIENT_CERTIFICATE_TLS_AUTH"
"SERVER_ROOT_CA_CERTIFICATE"
-
URI
— (String
)The value for your chosen configuration in
Type
. For example:"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"
.
SelfManagedEventSource
— (map
)The self-managed Apache Kafka cluster for your event source.
Endpoints
— (map<Array<String>>
)The list of bootstrap servers for your Kafka brokers in the following format:
"KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]
.
MaximumRecordAgeInSeconds
— (Integer
)(Kinesis and DynamoDB Streams only) Discard records older than the specified age. The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records.
Note: The minimum valid value for maximum record age is 60s. Although values less than 60 and greater than -1 fall within the parameter's absolute range, they are not allowedBisectBatchOnFunctionError
— (Boolean
)(Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
MaximumRetryAttempts
— (Integer
)(Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. The default value is -1, which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.
TumblingWindowInSeconds
— (Integer
)(Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window.
FunctionResponseTypes
— (Array<String>
)(Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event source mapping.
AmazonManagedKafkaEventSourceConfig
— (map
)Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
ConsumerGroupId
— (String
)The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see Customizable consumer group ID.
SelfManagedKafkaEventSourceConfig
— (map
)Specific configuration settings for a self-managed Apache Kafka event source.
ConsumerGroupId
— (String
)The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see Customizable consumer group ID.
ScalingConfig
— (map
)(Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring maximum concurrency for Amazon SQS event sources.
MaximumConcurrency
— (Integer
)Limits the number of concurrent instances that the Amazon SQS event source can invoke.
DocumentDBEventSourceConfig
— (map
)Specific configuration settings for a DocumentDB event source.
DatabaseName
— (String
)The name of the database to consume within the DocumentDB cluster.
CollectionName
— (String
)The name of the collection to consume within the database. If you do not specify a collection, Lambda consumes all collections.
FullDocument
— (String
)Determines what DocumentDB sends to your event stream during document update operations. If set to UpdateLookup, DocumentDB sends a delta describing the changes, along with a copy of the entire document. Otherwise, DocumentDB sends only a partial document that contains the changes.
Possible values include:"UpdateLookup"
"Default"
KMSKeyArn
— (String
)The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your function's filter criteria.
FilterCriteriaError
— (map
)An object that contains details about an error related to filter criteria encryption.
ErrorCode
— (String
)The KMS exception that resulted from filter criteria encryption or decryption.
Message
— (String
)The error message.
-
(AWS.Response)
—
Returns:
createFunction(params = {}, callback) ⇒ AWS.Request
Creates a Lambda function. To create a function, you need a deployment package and an execution role. The deployment package is a .zip file archive or container image that contains your function code. The execution role grants the function permission to use Amazon Web Servicesservices, such as Amazon CloudWatch Logs for log streaming and X-Ray for request tracing.
If the deployment package is a container image, then you set the package type to
Image
. For a container image, the code property must include the URI of a container image in the Amazon ECR registry. You do not need to specify the handler and runtime properties.If the deployment package is a .zip file archive, then you set the package type to
Zip
. For a .zip file archive, the code property specifies the location of the .zip file. You must also specify the handler and runtime properties. The code in the deployment package must be compatible with the target instruction set architecture of the function (x86-64
orarm64
). If you do not specify the architecture, then the default value isx86-64
.When you create a function, Lambda provisions an instance of the function and its supporting resources. If your function connects to a VPC, this process can take a minute or so. During this time, you can't invoke or modify the function. The
State
,StateReason
, andStateReasonCode
fields in the response from GetFunctionConfiguration indicate when the function is ready to invoke. For more information, see Lambda function states.A function has an unpublished version, and can have published versions and aliases. The unpublished version changes when you update your function's code and configuration. A published version is a snapshot of your function code and configuration that can't be changed. An alias is a named resource that maps to a version, and can be changed to map to a different version. Use the
Publish
parameter to create version1
of your function from its initial configuration.The other parameters let you configure version-specific and function-level settings. You can modify version-specific settings later with UpdateFunctionConfiguration. Function-level settings apply to both the unpublished and published versions of the function, and include tags (TagResource) and per-function concurrency limits (PutFunctionConcurrency).
You can use code signing if your deployment package is a .zip file archive. To enable code signing for this function, specify the ARN of a code-signing configuration. When a user attempts to deploy a code package with UpdateFunctionCode, Lambda checks that the code package has a valid signature from a trusted publisher. The code-signing configuration includes set of signing profiles, which define the trusted publishers for this function.
If another Amazon Web Services account or an Amazon Web Servicesservice invokes your function, use AddPermission to grant permission by creating a resource-based Identity and Access Management (IAM) policy. You can grant permissions at the function level, on a version, or on an alias.
To invoke your function directly, use Invoke. To invoke your function in response to events in other Amazon Web Servicesservices, create an event source mapping (CreateEventSourceMapping), or configure a function trigger in the other service. For more information, see Invoking Lambda functions.
Service Reference:
Examples:
Calling the createFunction operation
var params = { Code: { /* required */ ImageUri: 'STRING_VALUE', S3Bucket: 'STRING_VALUE', S3Key: 'STRING_VALUE', S3ObjectVersion: 'STRING_VALUE', ZipFile: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */ }, FunctionName: 'STRING_VALUE', /* required */ Role: 'STRING_VALUE', /* required */ Architectures: [ x86_64 | arm64, /* more items */ ], CodeSigningConfigArn: 'STRING_VALUE', DeadLetterConfig: { TargetArn: 'STRING_VALUE' }, Description: 'STRING_VALUE', Environment: { Variables: { '<EnvironmentVariableName>': 'STRING_VALUE', /* '<EnvironmentVariableName>': ... */ } }, EphemeralStorage: { Size: 'NUMBER_VALUE' /* required */ }, FileSystemConfigs: [ { Arn: 'STRING_VALUE', /* required */ LocalMountPath: 'STRING_VALUE' /* required */ }, /* more items */ ], Handler: 'STRING_VALUE', ImageConfig: { Command: [ 'STRING_VALUE', /* more items */ ], EntryPoint: [ 'STRING_VALUE', /* more items */ ], WorkingDirectory: 'STRING_VALUE' }, KMSKeyArn: 'STRING_VALUE', Layers: [ 'STRING_VALUE', /* more items */ ], LoggingConfig: { ApplicationLogLevel: TRACE | DEBUG | INFO | WARN | ERROR | FATAL, LogFormat: JSON | Text, LogGroup: 'STRING_VALUE', SystemLogLevel: DEBUG | INFO | WARN }, MemorySize: 'NUMBER_VALUE', PackageType: Zip | Image, Publish: true || false, Runtime: nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | dotnet8 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2 | nodejs18.x | python3.10 | java17 | ruby3.2 | ruby3.3 | python3.11 | nodejs20.x | provided.al2023 | python3.12 | java21, SnapStart: { ApplyOn: PublishedVersions | None }, Tags: { '<TagKey>': 'STRING_VALUE', /* '<TagKey>': ... */ }, Timeout: 'NUMBER_VALUE', TracingConfig: { Mode: Active | PassThrough }, VpcConfig: { Ipv6AllowedForDualStack: true || false, SecurityGroupIds: [ 'STRING_VALUE', /* more items */ ], SubnetIds: [ 'STRING_VALUE', /* more items */ ] } }; lambda.createFunction(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Role
— (String
)The Amazon Resource Name (ARN) of the function's execution role.
Handler
— (String
)The name of the method within your code that Lambda calls to run your function. Handler is required if the deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Lambda programming model.
Code
— (map
)The code for the function.
ZipFile
— (Buffer, Typed Array, Blob, String
)The base64-encoded contents of the deployment package. Amazon Web Services SDK and CLI clients handle the encoding for you.
S3Bucket
— (String
)An Amazon S3 bucket in the same Amazon Web Services Region as your function. The bucket can be in a different Amazon Web Services account.
S3Key
— (String
)The Amazon S3 key of the deployment package.
S3ObjectVersion
— (String
)For versioned objects, the version of the deployment package object to use.
ImageUri
— (String
)URI of a container image in the Amazon ECR registry.
Description
— (String
)A description of the function.
Timeout
— (Integer
)The amount of time (in seconds) that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds. For more information, see Lambda execution environment.
MemorySize
— (Integer
)The amount of memory available to the function at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB.
Publish
— (Boolean
)Set to true to publish the first version of the function during creation.
VpcConfig
— (map
)For network connectivity to Amazon Web Services resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can access resources and the internet only through that VPC. For more information, see Configuring a Lambda function to access resources in a VPC.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
PackageType
— (String
)The type of deployment package. Set to
Possible values include:Image
for container image and set toZip
for .zip file archive."Zip"
"Image"
DeadLetterConfig
— (map
)A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see Dead-letter queues.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Environment
— (map
)Environment variables that are accessible from function code during execution.
Variables
— (map<String>
)Environment variable key-value pairs. For more information, see Using Lambda environment variables.
KMSKeyArn
— (String
)The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's environment variables. When Lambda SnapStart is activated, Lambda also uses this key is to encrypt your function's snapshot. If you deploy your function using a container image, Lambda also uses this key to encrypt your function when it's deployed. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). If you don't provide a customer managed key, Lambda uses a default service key.
TracingConfig
— (map
)Set
Mode
toActive
to sample and trace a subset of incoming requests with X-Ray.Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
Tags
— (map<String>
)A list of tags to apply to the function.
Layers
— (Array<String>
)A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
ImageConfig
— (map
)Container image configuration values that override the values in the container image Dockerfile.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
CodeSigningConfigArn
— (String
)To enable code signing for this function, specify the ARN of a code-signing configuration. A code-signing configuration includes a set of signing profiles, which define the trusted publishers for this function.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is
x86_64
.EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)The function's SnapStart setting.
ApplyOn
— (String
)Set to
Possible values include:PublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version."PublishedVersions"
"None"
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:FunctionName
— (String
)The name of the function.
FunctionArn
— (String
)The function's Amazon Resource Name (ARN).
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Role
— (String
)The function's execution role.
Handler
— (String
)The function that Lambda calls to begin running your function.
CodeSize
— (Integer
)The size of the function's deployment package, in bytes.
Description
— (String
)The function's description.
Timeout
— (Integer
)The amount of time in seconds that Lambda allows a function to run before stopping it.
MemorySize
— (Integer
)The amount of memory available to the function at runtime.
LastModified
— (String
)The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
CodeSha256
— (String
)The SHA256 hash of the function's deployment package.
Version
— (String
)The version of the Lambda function.
VpcConfig
— (map
)The function's networking configuration.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
VpcId
— (String
)The ID of the VPC.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
DeadLetterConfig
— (map
)The function's dead letter queue.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Environment
— (map
)The function's environment variables. Omitted from CloudTrail logs.
Variables
— (map<String>
)Environment variable key-value pairs. Omitted from CloudTrail logs.
Error
— (map
)Error messages for environment variables that couldn't be applied.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
KMSKeyArn
— (String
)The KMS key that's used to encrypt the function's environment variables. When Lambda SnapStart is activated, this key is also used to encrypt the function's snapshot. This key is returned only if you've configured a customer managed key.
TracingConfig
— (map
)The function's X-Ray tracing configuration.
Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
MasterArn
— (String
)For Lambda@Edge functions, the ARN of the main function.
RevisionId
— (String
)The latest updated revision of the function or alias.
Layers
— (Array<map>
)The function's layers.
Arn
— (String
)The Amazon Resource Name (ARN) of the function layer.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
State
— (String
)The current state of the function. When the state is
Possible values include:Inactive
, you can reactivate the function by invoking it."Pending"
"Active"
"Inactive"
"Failed"
StateReason
— (String
)The reason for the function's current state.
StateReasonCode
— (String
)The reason code for the function's current state. When the code is
Possible values include:Creating
, you can't invoke or modify the function."Idle"
"Creating"
"Restoring"
"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
LastUpdateStatus
— (String
)The status of the last update that was performed on the function. This is first set to
Possible values include:Successful
after function creation completes."Successful"
"Failed"
"InProgress"
LastUpdateStatusReason
— (String
)The reason for the last update that was performed on the function.
LastUpdateStatusReasonCode
— (String
)The reason code for the last update that was performed on the function.
Possible values include:"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
PackageType
— (String
)The type of deployment package. Set to
Possible values include:Image
for container image and setZip
for .zip file archive."Zip"
"Image"
ImageConfigResponse
— (map
)The function's image configuration values.
ImageConfig
— (map
)Configuration values that override the container image Dockerfile.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
Error
— (map
)Error response to
GetFunctionConfiguration
.ErrorCode
— (String
)Error code.
Message
— (String
)Error message.
SigningProfileVersionArn
— (String
)The ARN of the signing profile version.
SigningJobArn
— (String
)The ARN of the signing job.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is
x86_64
.EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)Set
ApplyOn
toPublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version. For more information, see Improving startup performance with Lambda SnapStart.ApplyOn
— (String
)When set to
Possible values include:PublishedVersions
, Lambda creates a snapshot of the execution environment when you publish a function version."PublishedVersions"
"None"
OptimizationStatus
— (String
)When you provide a qualified Amazon Resource Name (ARN), this response element indicates whether SnapStart is activated for the specified function version.
Possible values include:"On"
"Off"
RuntimeVersionConfig
— (map
)The ARN of the runtime and any errors that occured.
RuntimeVersionArn
— (String
)The ARN of the runtime version you want the function to use.
Error
— (map
)Error response when Lambda is unable to retrieve the runtime version for a function.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
-
(AWS.Response)
—
Returns:
createFunctionUrlConfig(params = {}, callback) ⇒ AWS.Request
Creates a Lambda function URL with the specified configuration parameters. A function URL is a dedicated HTTP(S) endpoint that you can use to invoke your function.
Service Reference:
Examples:
Calling the createFunctionUrlConfig operation
var params = { AuthType: NONE | AWS_IAM, /* required */ FunctionName: 'STRING_VALUE', /* required */ Cors: { AllowCredentials: true || false, AllowHeaders: [ 'STRING_VALUE', /* more items */ ], AllowMethods: [ 'STRING_VALUE', /* more items */ ], AllowOrigins: [ 'STRING_VALUE', /* more items */ ], ExposeHeaders: [ 'STRING_VALUE', /* more items */ ], MaxAge: 'NUMBER_VALUE' }, InvokeMode: BUFFERED | RESPONSE_STREAM, Qualifier: 'STRING_VALUE' }; lambda.createFunctionUrlConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)The alias name.
AuthType
— (String
)The type of authentication that your function URL uses. Set to
Possible values include:AWS_IAM
if you want to restrict access to authenticated users only. Set toNONE
if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs."NONE"
"AWS_IAM"
Cors
— (map
)The cross-origin resource sharing (CORS) settings for your function URL.
AllowCredentials
— (Boolean
)Whether to allow cookies or other credentials in requests to your function URL. The default is
false
.AllowHeaders
— (Array<String>
)The HTTP headers that origins can include in requests to your function URL. For example:
Date
,Keep-Alive
,X-Custom-Header
.AllowMethods
— (Array<String>
)The HTTP methods that are allowed when calling your function URL. For example:
GET
,POST
,DELETE
, or the wildcard character (*
).AllowOrigins
— (Array<String>
)The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example:
https://www.example.com
,http://localhost:60905
.Alternatively, you can grant access to all origins using the wildcard character (
*
).ExposeHeaders
— (Array<String>
)The HTTP headers in your function response that you want to expose to origins that call your function URL. For example:
Date
,Keep-Alive
,X-Custom-Header
.MaxAge
— (Integer
)The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to
0
, which means that the browser doesn't cache results.
InvokeMode
— (String
)Use one of the following options:
-
BUFFERED
– This is the default option. Lambda invokes your function using theInvoke
API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB. -
RESPONSE_STREAM
– Your function streams payload results as they become available. Lambda invokes your function using theInvokeWithResponseStream
API operation. The maximum response payload size is 20 MB, however, you can request a quota increase.
"BUFFERED"
"RESPONSE_STREAM"
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:FunctionUrl
— (String
)The HTTP URL endpoint for your function.
FunctionArn
— (String
)The Amazon Resource Name (ARN) of your function.
AuthType
— (String
)The type of authentication that your function URL uses. Set to
Possible values include:AWS_IAM
if you want to restrict access to authenticated users only. Set toNONE
if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs."NONE"
"AWS_IAM"
Cors
— (map
)The cross-origin resource sharing (CORS) settings for your function URL.
AllowCredentials
— (Boolean
)Whether to allow cookies or other credentials in requests to your function URL. The default is
false
.AllowHeaders
— (Array<String>
)The HTTP headers that origins can include in requests to your function URL. For example:
Date
,Keep-Alive
,X-Custom-Header
.AllowMethods
— (Array<String>
)The HTTP methods that are allowed when calling your function URL. For example:
GET
,POST
,DELETE
, or the wildcard character (*
).AllowOrigins
— (Array<String>
)The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example:
https://www.example.com
,http://localhost:60905
.Alternatively, you can grant access to all origins using the wildcard character (
*
).ExposeHeaders
— (Array<String>
)The HTTP headers in your function response that you want to expose to origins that call your function URL. For example:
Date
,Keep-Alive
,X-Custom-Header
.MaxAge
— (Integer
)The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to
0
, which means that the browser doesn't cache results.
CreationTime
— (String
)When the function URL was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
InvokeMode
— (String
)Use one of the following options:
-
BUFFERED
– This is the default option. Lambda invokes your function using theInvoke
API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB. -
RESPONSE_STREAM
– Your function streams payload results as they become available. Lambda invokes your function using theInvokeWithResponseStream
API operation. The maximum response payload size is 20 MB, however, you can request a quota increase.
"BUFFERED"
"RESPONSE_STREAM"
-
-
(AWS.Response)
—
Returns:
deleteAlias(params = {}, callback) ⇒ AWS.Request
Deletes a Lambda function alias.
Service Reference:
Examples:
Calling the deleteAlias operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Name: 'STRING_VALUE' /* required */ }; lambda.deleteAlias(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Partial ARN -
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Name
— (String
)The name of the alias.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
Deletes the code signing configuration. You can delete the code signing configuration only if no function is using it.
Service Reference:
Examples:
Calling the deleteCodeSigningConfig operation
var params = { CodeSigningConfigArn: 'STRING_VALUE' /* required */ }; lambda.deleteCodeSigningConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CodeSigningConfigArn
— (String
)The The Amazon Resource Name (ARN) of the code signing configuration.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteEventSourceMapping(params = {}, callback) ⇒ AWS.Request
Deletes an event source mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.
When you delete an event source mapping, it enters a
Deleting
state and might not be completely deleted for several seconds.Service Reference:
Examples:
Calling the deleteEventSourceMapping operation
var params = { UUID: 'STRING_VALUE' /* required */ }; lambda.deleteEventSourceMapping(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
UUID
— (String
)The identifier of the event source mapping.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UUID
— (String
)The identifier of the event source mapping.
StartingPosition
— (String
)The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Stream event sources.
Possible values include:AT_TIMESTAMP
is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed Apache Kafka."TRIM_HORIZON"
"LATEST"
"AT_TIMESTAMP"
StartingPositionTimestamp
— (Date
)With
StartingPosition
set toAT_TIMESTAMP
, the time from which to start reading.StartingPositionTimestamp
cannot be in the future.BatchSize
— (Integer
)The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).
Default value: Varies by service. For Amazon SQS, the default is 10. For all other services, the default is 100.
Related setting: When you set
BatchSize
to a value greater than 10, you must setMaximumBatchingWindowInSeconds
to at least 1.MaximumBatchingWindowInSeconds
— (Integer
)The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure
MaximumBatchingWindowInSeconds
to any value from 0 seconds to 300 seconds in increments of seconds.For streams and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching window is 500 ms. Note that because you can only change
MaximumBatchingWindowInSeconds
in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it. To restore the default batching window, you must create a new event source mapping.Related setting: For streams and Amazon SQS event sources, when you set
BatchSize
to a value greater than 10, you must setMaximumBatchingWindowInSeconds
to at least 1.ParallelizationFactor
— (Integer
)(Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.
EventSourceArn
— (String
)The Amazon Resource Name (ARN) of the event source.
FilterCriteria
— (map
)An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see Lambda event filtering.
If filter criteria is encrypted, this field shows up as
null
in the response of ListEventSourceMapping API calls. You can view this field in plaintext in the response of GetEventSourceMapping and DeleteEventSourceMapping calls if you havekms:Decrypt
permissions for the correct KMS key.Filters
— (Array<map>
)A list of filters.
Pattern
— (String
)A filter pattern. For more information on the syntax of a filter pattern, see Filter rule syntax.
FunctionArn
— (String
)The ARN of the Lambda function.
LastModified
— (Date
)The date that the event source mapping was last updated or that its state changed.
LastProcessingResult
— (String
)The result of the last Lambda invocation of your function.
State
— (String
)The state of the event source mapping. It can be one of the following:
Creating
,Enabling
,Enabled
,Disabling
,Disabled
,Updating
, orDeleting
.StateTransitionReason
— (String
)Indicates whether a user or Lambda made the last change to the event source mapping.
DestinationConfig
— (map
)(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka event sources only) A configuration object that specifies the destination of an event after Lambda processes it.
OnSuccess
— (map
)The destination configuration for successful invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
OnFailure
— (map
)The destination configuration for failed invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
To retain records of asynchronous invocations, you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.
To retain records of failed invocations from Kinesis and DynamoDB event sources, you can configure an Amazon SNS topic or Amazon SQS queue as the destination.
To retain records of failed invocations from self-managed Kafka or Amazon MSK, you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.
Topics
— (Array<String>
)The name of the Kafka topic.
Queues
— (Array<String>
)(Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
SourceAccessConfigurations
— (Array<map>
)An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
Type
— (String
)The type of authentication protocol, VPC components, or virtual host for your event source. For example:
"Type":"SASL_SCRAM_512_AUTH"
.-
BASIC_AUTH
– (Amazon MQ) The Secrets Manager secret that stores your broker credentials. -
BASIC_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers. -
VPC_SUBNET
– (Self-managed Apache Kafka) The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your self-managed Apache Kafka cluster. -
VPC_SECURITY_GROUP
– (Self-managed Apache Kafka) The VPC security group used to manage access to your self-managed Apache Kafka brokers. -
SASL_SCRAM_256_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your self-managed Apache Kafka brokers. -
SASL_SCRAM_512_AUTH
– (Amazon MSK, Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your self-managed Apache Kafka brokers. -
VIRTUAL_HOST
–- (RabbitMQ) The name of the virtual host in your RabbitMQ broker. Lambda uses this RabbitMQ host as the event source. This property cannot be specified in an UpdateEventSourceMapping API call. -
CLIENT_CERTIFICATE_TLS_AUTH
– (Amazon MSK, self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and private key password (optional) used for mutual TLS authentication of your MSK/Apache Kafka brokers. -
SERVER_ROOT_CA_CERTIFICATE
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the root CA certificate (X.509 PEM) used for TLS encryption of your Apache Kafka brokers.
"BASIC_AUTH"
"VPC_SUBNET"
"VPC_SECURITY_GROUP"
"SASL_SCRAM_512_AUTH"
"SASL_SCRAM_256_AUTH"
"VIRTUAL_HOST"
"CLIENT_CERTIFICATE_TLS_AUTH"
"SERVER_ROOT_CA_CERTIFICATE"
-
URI
— (String
)The value for your chosen configuration in
Type
. For example:"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"
.
SelfManagedEventSource
— (map
)The self-managed Apache Kafka cluster for your event source.
Endpoints
— (map<Array<String>>
)The list of bootstrap servers for your Kafka brokers in the following format:
"KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]
.
MaximumRecordAgeInSeconds
— (Integer
)(Kinesis and DynamoDB Streams only) Discard records older than the specified age. The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records.
Note: The minimum valid value for maximum record age is 60s. Although values less than 60 and greater than -1 fall within the parameter's absolute range, they are not allowedBisectBatchOnFunctionError
— (Boolean
)(Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
MaximumRetryAttempts
— (Integer
)(Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. The default value is -1, which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.
TumblingWindowInSeconds
— (Integer
)(Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window.
FunctionResponseTypes
— (Array<String>
)(Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event source mapping.
AmazonManagedKafkaEventSourceConfig
— (map
)Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
ConsumerGroupId
— (String
)The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see Customizable consumer group ID.
SelfManagedKafkaEventSourceConfig
— (map
)Specific configuration settings for a self-managed Apache Kafka event source.
ConsumerGroupId
— (String
)The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see Customizable consumer group ID.
ScalingConfig
— (map
)(Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring maximum concurrency for Amazon SQS event sources.
MaximumConcurrency
— (Integer
)Limits the number of concurrent instances that the Amazon SQS event source can invoke.
DocumentDBEventSourceConfig
— (map
)Specific configuration settings for a DocumentDB event source.
DatabaseName
— (String
)The name of the database to consume within the DocumentDB cluster.
CollectionName
— (String
)The name of the collection to consume within the database. If you do not specify a collection, Lambda consumes all collections.
FullDocument
— (String
)Determines what DocumentDB sends to your event stream during document update operations. If set to UpdateLookup, DocumentDB sends a delta describing the changes, along with a copy of the entire document. Otherwise, DocumentDB sends only a partial document that contains the changes.
Possible values include:"UpdateLookup"
"Default"
KMSKeyArn
— (String
)The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your function's filter criteria.
FilterCriteriaError
— (map
)An object that contains details about an error related to filter criteria encryption.
ErrorCode
— (String
)The KMS exception that resulted from filter criteria encryption or decryption.
Message
— (String
)The error message.
-
(AWS.Response)
—
Returns:
deleteFunction(params = {}, callback) ⇒ AWS.Request
Deletes a Lambda function. To delete a specific function version, use the
Qualifier
parameter. Otherwise, all versions and aliases are deleted. This doesn't require the user to have explicit permissions for DeleteAlias.To delete Lambda event source mappings that invoke a function, use DeleteEventSourceMapping. For Amazon Web Servicesservices and resources that invoke your function directly, delete the trigger in the service where you originally configured it.
Service Reference:
Examples:
Calling the deleteFunction operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Qualifier: 'STRING_VALUE' }; lambda.deleteFunction(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function or version.
Name formats
-
Function name –
my-function
(name-only),my-function:1
(with version). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)Specify a version to delete. You can't delete a version that an alias references.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteFunctionCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
Removes the code signing configuration from the function.
Service Reference:
Examples:
Calling the deleteFunctionCodeSigningConfig operation
var params = { FunctionName: 'STRING_VALUE' /* required */ }; lambda.deleteFunctionCodeSigningConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Partial ARN -
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteFunctionConcurrency(params = {}, callback) ⇒ AWS.Request
Removes a concurrent execution limit from a function.
Service Reference:
Examples:
Calling the deleteFunctionConcurrency operation
var params = { FunctionName: 'STRING_VALUE' /* required */ }; lambda.deleteFunctionConcurrency(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteFunctionEventInvokeConfig(params = {}, callback) ⇒ AWS.Request
Deletes the configuration for asynchronous invocation for a function, version, or alias.
To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.
Service Reference:
Examples:
Calling the deleteFunctionEventInvokeConfig operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Qualifier: 'STRING_VALUE' }; lambda.deleteFunctionEventInvokeConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name -
my-function
(name-only),my-function:v1
(with alias). -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN -
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)A version number or alias name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteFunctionUrlConfig(params = {}, callback) ⇒ AWS.Request
Deletes a Lambda function URL. When you delete a function URL, you can't recover it. Creating a new function URL results in a different URL address.
Service Reference:
Examples:
Calling the deleteFunctionUrlConfig operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Qualifier: 'STRING_VALUE' }; lambda.deleteFunctionUrlConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)The alias name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteLayerVersion(params = {}, callback) ⇒ AWS.Request
Deletes a version of an Lambda layer. Deleted versions can no longer be viewed or added to functions. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it.
Service Reference:
Examples:
Calling the deleteLayerVersion operation
var params = { LayerName: 'STRING_VALUE', /* required */ VersionNumber: 'NUMBER_VALUE' /* required */ }; lambda.deleteLayerVersion(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
LayerName
— (String
)The name or Amazon Resource Name (ARN) of the layer.
VersionNumber
— (Integer
)The version number.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteProvisionedConcurrencyConfig(params = {}, callback) ⇒ AWS.Request
Deletes the provisioned concurrency configuration for a function.
Service Reference:
Examples:
Calling the deleteProvisionedConcurrencyConfig operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Qualifier: 'STRING_VALUE' /* required */ }; lambda.deleteProvisionedConcurrencyConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)The version number or alias name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
getAccountSettings(params = {}, callback) ⇒ AWS.Request
Retrieves details about your account's limits and usage in an Amazon Web Services Region.
Service Reference:
Examples:
Calling the getAccountSettings operation
var params = { }; lambda.getAccountSettings(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
- params (Object) (defaults to: {})
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:AccountLimit
— (map
)Limits that are related to concurrency and code storage.
TotalCodeSize
— (Integer
)The amount of storage space that you can use for all deployment packages and layer archives.
CodeSizeUnzipped
— (Integer
)The maximum size of a function's deployment package and layers when they're extracted.
CodeSizeZipped
— (Integer
)The maximum size of a deployment package when it's uploaded directly to Lambda. Use Amazon S3 for larger files.
ConcurrentExecutions
— (Integer
)The maximum number of simultaneous function executions.
UnreservedConcurrentExecutions
— (Integer
)The maximum number of simultaneous function executions, minus the capacity that's reserved for individual functions with PutFunctionConcurrency.
AccountUsage
— (map
)The number of functions and amount of storage in use.
TotalCodeSize
— (Integer
)The amount of storage space, in bytes, that's being used by deployment packages and layer archives.
FunctionCount
— (Integer
)The number of Lambda functions.
-
(AWS.Response)
—
Returns:
getAlias(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the getAlias operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Name: 'STRING_VALUE' /* required */ }; lambda.getAlias(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Partial ARN -
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Name
— (String
)The name of the alias.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:AliasArn
— (String
)The Amazon Resource Name (ARN) of the alias.
Name
— (String
)The name of the alias.
FunctionVersion
— (String
)The function version that the alias invokes.
Description
— (String
)A description of the alias.
RoutingConfig
— (map
)The routing configuration of the alias.
AdditionalVersionWeights
— (map<Float>
)The second version, and the percentage of traffic that's routed to it.
RevisionId
— (String
)A unique identifier that changes when you update the alias.
-
(AWS.Response)
—
Returns:
getCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
Returns information about the specified code signing configuration.
Service Reference:
Examples:
Calling the getCodeSigningConfig operation
var params = { CodeSigningConfigArn: 'STRING_VALUE' /* required */ }; lambda.getCodeSigningConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CodeSigningConfigArn
— (String
)The The Amazon Resource Name (ARN) of the code signing configuration.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CodeSigningConfig
— (map
)The code signing configuration
CodeSigningConfigId
— required — (String
)Unique identifer for the Code signing configuration.
CodeSigningConfigArn
— required — (String
)The Amazon Resource Name (ARN) of the Code signing configuration.
Description
— (String
)Code signing configuration description.
AllowedPublishers
— required — (map
)List of allowed publishers.
SigningProfileVersionArns
— required — (Array<String>
)The Amazon Resource Name (ARN) for each of the signing profiles. A signing profile defines a trusted user who can sign a code package.
CodeSigningPolicies
— required — (map
)The code signing policy controls the validation failure action for signature mismatch or expiry.
UntrustedArtifactOnDeployment
— (String
)Code signing configuration policy for deployment validation failure. If you set the policy to
Enforce
, Lambda blocks the deployment request if signature validation checks fail. If you set the policy toWarn
, Lambda allows the deployment and creates a CloudWatch log.Default value:
Possible values include:Warn
"Warn"
"Enforce"
LastModified
— required — (String
)The date and time that the Code signing configuration was last modified, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
-
(AWS.Response)
—
Returns:
getEventSourceMapping(params = {}, callback) ⇒ AWS.Request
Returns details about an event source mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.
Service Reference:
Examples:
Calling the getEventSourceMapping operation
var params = { UUID: 'STRING_VALUE' /* required */ }; lambda.getEventSourceMapping(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
UUID
— (String
)The identifier of the event source mapping.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UUID
— (String
)The identifier of the event source mapping.
StartingPosition
— (String
)The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Stream event sources.
Possible values include:AT_TIMESTAMP
is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed Apache Kafka."TRIM_HORIZON"
"LATEST"
"AT_TIMESTAMP"
StartingPositionTimestamp
— (Date
)With
StartingPosition
set toAT_TIMESTAMP
, the time from which to start reading.StartingPositionTimestamp
cannot be in the future.BatchSize
— (Integer
)The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).
Default value: Varies by service. For Amazon SQS, the default is 10. For all other services, the default is 100.
Related setting: When you set
BatchSize
to a value greater than 10, you must setMaximumBatchingWindowInSeconds
to at least 1.MaximumBatchingWindowInSeconds
— (Integer
)The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure
MaximumBatchingWindowInSeconds
to any value from 0 seconds to 300 seconds in increments of seconds.For streams and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching window is 500 ms. Note that because you can only change
MaximumBatchingWindowInSeconds
in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it. To restore the default batching window, you must create a new event source mapping.Related setting: For streams and Amazon SQS event sources, when you set
BatchSize
to a value greater than 10, you must setMaximumBatchingWindowInSeconds
to at least 1.ParallelizationFactor
— (Integer
)(Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.
EventSourceArn
— (String
)The Amazon Resource Name (ARN) of the event source.
FilterCriteria
— (map
)An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see Lambda event filtering.
If filter criteria is encrypted, this field shows up as
null
in the response of ListEventSourceMapping API calls. You can view this field in plaintext in the response of GetEventSourceMapping and DeleteEventSourceMapping calls if you havekms:Decrypt
permissions for the correct KMS key.Filters
— (Array<map>
)A list of filters.
Pattern
— (String
)A filter pattern. For more information on the syntax of a filter pattern, see Filter rule syntax.
FunctionArn
— (String
)The ARN of the Lambda function.
LastModified
— (Date
)The date that the event source mapping was last updated or that its state changed.
LastProcessingResult
— (String
)The result of the last Lambda invocation of your function.
State
— (String
)The state of the event source mapping. It can be one of the following:
Creating
,Enabling
,Enabled
,Disabling
,Disabled
,Updating
, orDeleting
.StateTransitionReason
— (String
)Indicates whether a user or Lambda made the last change to the event source mapping.
DestinationConfig
— (map
)(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka event sources only) A configuration object that specifies the destination of an event after Lambda processes it.
OnSuccess
— (map
)The destination configuration for successful invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
OnFailure
— (map
)The destination configuration for failed invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
To retain records of asynchronous invocations, you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.
To retain records of failed invocations from Kinesis and DynamoDB event sources, you can configure an Amazon SNS topic or Amazon SQS queue as the destination.
To retain records of failed invocations from self-managed Kafka or Amazon MSK, you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.
Topics
— (Array<String>
)The name of the Kafka topic.
Queues
— (Array<String>
)(Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
SourceAccessConfigurations
— (Array<map>
)An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
Type
— (String
)The type of authentication protocol, VPC components, or virtual host for your event source. For example:
"Type":"SASL_SCRAM_512_AUTH"
.-
BASIC_AUTH
– (Amazon MQ) The Secrets Manager secret that stores your broker credentials. -
BASIC_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers. -
VPC_SUBNET
– (Self-managed Apache Kafka) The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your self-managed Apache Kafka cluster. -
VPC_SECURITY_GROUP
– (Self-managed Apache Kafka) The VPC security group used to manage access to your self-managed Apache Kafka brokers. -
SASL_SCRAM_256_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your self-managed Apache Kafka brokers. -
SASL_SCRAM_512_AUTH
– (Amazon MSK, Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your self-managed Apache Kafka brokers. -
VIRTUAL_HOST
–- (RabbitMQ) The name of the virtual host in your RabbitMQ broker. Lambda uses this RabbitMQ host as the event source. This property cannot be specified in an UpdateEventSourceMapping API call. -
CLIENT_CERTIFICATE_TLS_AUTH
– (Amazon MSK, self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and private key password (optional) used for mutual TLS authentication of your MSK/Apache Kafka brokers. -
SERVER_ROOT_CA_CERTIFICATE
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the root CA certificate (X.509 PEM) used for TLS encryption of your Apache Kafka brokers.
"BASIC_AUTH"
"VPC_SUBNET"
"VPC_SECURITY_GROUP"
"SASL_SCRAM_512_AUTH"
"SASL_SCRAM_256_AUTH"
"VIRTUAL_HOST"
"CLIENT_CERTIFICATE_TLS_AUTH"
"SERVER_ROOT_CA_CERTIFICATE"
-
URI
— (String
)The value for your chosen configuration in
Type
. For example:"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"
.
SelfManagedEventSource
— (map
)The self-managed Apache Kafka cluster for your event source.
Endpoints
— (map<Array<String>>
)The list of bootstrap servers for your Kafka brokers in the following format:
"KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]
.
MaximumRecordAgeInSeconds
— (Integer
)(Kinesis and DynamoDB Streams only) Discard records older than the specified age. The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records.
Note: The minimum valid value for maximum record age is 60s. Although values less than 60 and greater than -1 fall within the parameter's absolute range, they are not allowedBisectBatchOnFunctionError
— (Boolean
)(Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
MaximumRetryAttempts
— (Integer
)(Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. The default value is -1, which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.
TumblingWindowInSeconds
— (Integer
)(Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window.
FunctionResponseTypes
— (Array<String>
)(Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event source mapping.
AmazonManagedKafkaEventSourceConfig
— (map
)Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
ConsumerGroupId
— (String
)The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see Customizable consumer group ID.
SelfManagedKafkaEventSourceConfig
— (map
)Specific configuration settings for a self-managed Apache Kafka event source.
ConsumerGroupId
— (String
)The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see Customizable consumer group ID.
ScalingConfig
— (map
)(Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring maximum concurrency for Amazon SQS event sources.
MaximumConcurrency
— (Integer
)Limits the number of concurrent instances that the Amazon SQS event source can invoke.
DocumentDBEventSourceConfig
— (map
)Specific configuration settings for a DocumentDB event source.
DatabaseName
— (String
)The name of the database to consume within the DocumentDB cluster.
CollectionName
— (String
)The name of the collection to consume within the database. If you do not specify a collection, Lambda consumes all collections.
FullDocument
— (String
)Determines what DocumentDB sends to your event stream during document update operations. If set to UpdateLookup, DocumentDB sends a delta describing the changes, along with a copy of the entire document. Otherwise, DocumentDB sends only a partial document that contains the changes.
Possible values include:"UpdateLookup"
"Default"
KMSKeyArn
— (String
)The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your function's filter criteria.
FilterCriteriaError
— (map
)An object that contains details about an error related to filter criteria encryption.
ErrorCode
— (String
)The KMS exception that resulted from filter criteria encryption or decryption.
Message
— (String
)The error message.
-
(AWS.Response)
—
Returns:
getFunction(params = {}, callback) ⇒ AWS.Request
Returns information about the function or function version, with a link to download the deployment package that's valid for 10 minutes. If you specify a function version, only details that are specific to that version are returned.
Service Reference:
Examples:
Calling the getFunction operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Qualifier: 'STRING_VALUE' }; lambda.getFunction(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function
(name-only),my-function:v1
(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)Specify a version or alias to get details about a published version of the function.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Configuration
— (map
)The configuration of the function or version.
FunctionName
— (String
)The name of the function.
FunctionArn
— (String
)The function's Amazon Resource Name (ARN).
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Role
— (String
)The function's execution role.
Handler
— (String
)The function that Lambda calls to begin running your function.
CodeSize
— (Integer
)The size of the function's deployment package, in bytes.
Description
— (String
)The function's description.
Timeout
— (Integer
)The amount of time in seconds that Lambda allows a function to run before stopping it.
MemorySize
— (Integer
)The amount of memory available to the function at runtime.
LastModified
— (String
)The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
CodeSha256
— (String
)The SHA256 hash of the function's deployment package.
Version
— (String
)The version of the Lambda function.
VpcConfig
— (map
)The function's networking configuration.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
VpcId
— (String
)The ID of the VPC.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
DeadLetterConfig
— (map
)The function's dead letter queue.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Environment
— (map
)The function's environment variables. Omitted from CloudTrail logs.
Variables
— (map<String>
)Environment variable key-value pairs. Omitted from CloudTrail logs.
Error
— (map
)Error messages for environment variables that couldn't be applied.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
KMSKeyArn
— (String
)The KMS key that's used to encrypt the function's environment variables. When Lambda SnapStart is activated, this key is also used to encrypt the function's snapshot. This key is returned only if you've configured a customer managed key.
TracingConfig
— (map
)The function's X-Ray tracing configuration.
Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
MasterArn
— (String
)For Lambda@Edge functions, the ARN of the main function.
RevisionId
— (String
)The latest updated revision of the function or alias.
Layers
— (Array<map>
)The function's layers.
Arn
— (String
)The Amazon Resource Name (ARN) of the function layer.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
State
— (String
)The current state of the function. When the state is
Possible values include:Inactive
, you can reactivate the function by invoking it."Pending"
"Active"
"Inactive"
"Failed"
StateReason
— (String
)The reason for the function's current state.
StateReasonCode
— (String
)The reason code for the function's current state. When the code is
Possible values include:Creating
, you can't invoke or modify the function."Idle"
"Creating"
"Restoring"
"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
LastUpdateStatus
— (String
)The status of the last update that was performed on the function. This is first set to
Possible values include:Successful
after function creation completes."Successful"
"Failed"
"InProgress"
LastUpdateStatusReason
— (String
)The reason for the last update that was performed on the function.
LastUpdateStatusReasonCode
— (String
)The reason code for the last update that was performed on the function.
Possible values include:"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
PackageType
— (String
)The type of deployment package. Set to
Possible values include:Image
for container image and setZip
for .zip file archive."Zip"
"Image"
ImageConfigResponse
— (map
)The function's image configuration values.
ImageConfig
— (map
)Configuration values that override the container image Dockerfile.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
Error
— (map
)Error response to
GetFunctionConfiguration
.ErrorCode
— (String
)Error code.
Message
— (String
)Error message.
SigningProfileVersionArn
— (String
)The ARN of the signing profile version.
SigningJobArn
— (String
)The ARN of the signing job.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is
x86_64
.EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)Set
ApplyOn
toPublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version. For more information, see Improving startup performance with Lambda SnapStart.ApplyOn
— (String
)When set to
Possible values include:PublishedVersions
, Lambda creates a snapshot of the execution environment when you publish a function version."PublishedVersions"
"None"
OptimizationStatus
— (String
)When you provide a qualified Amazon Resource Name (ARN), this response element indicates whether SnapStart is activated for the specified function version.
Possible values include:"On"
"Off"
RuntimeVersionConfig
— (map
)The ARN of the runtime and any errors that occured.
RuntimeVersionArn
— (String
)The ARN of the runtime version you want the function to use.
Error
— (map
)Error response when Lambda is unable to retrieve the runtime version for a function.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
Code
— (map
)The deployment package of the function or version.
RepositoryType
— (String
)The service that's hosting the file.
Location
— (String
)A presigned URL that you can use to download the deployment package.
ImageUri
— (String
)URI of a container image in the Amazon ECR registry.
ResolvedImageUri
— (String
)The resolved URI for the image.
Tags
— (map<String>
)The function's tags.
Concurrency
— (map
)The function's reserved concurrency.
ReservedConcurrentExecutions
— (Integer
)The number of concurrent executions that are reserved for this function. For more information, see Managing Lambda reserved concurrency.
-
(AWS.Response)
—
Returns:
Waiter Resource States:
getFunctionCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
Returns the code signing configuration for the specified function.
Service Reference:
Examples:
Calling the getFunctionCodeSigningConfig operation
var params = { FunctionName: 'STRING_VALUE' /* required */ }; lambda.getFunctionCodeSigningConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Partial ARN -
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CodeSigningConfigArn
— (String
)The The Amazon Resource Name (ARN) of the code signing configuration.
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Partial ARN -
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
-
(AWS.Response)
—
Returns:
getFunctionConcurrency(params = {}, callback) ⇒ AWS.Request
Returns details about the reserved concurrency configuration for a function. To set a concurrency limit for a function, use PutFunctionConcurrency.
Service Reference:
Examples:
Calling the getFunctionConcurrency operation
var params = { FunctionName: 'STRING_VALUE' /* required */ }; lambda.getFunctionConcurrency(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:ReservedConcurrentExecutions
— (Integer
)The number of simultaneous executions that are reserved for the function.
-
(AWS.Response)
—
Returns:
getFunctionConfiguration(params = {}, callback) ⇒ AWS.Request
Returns the version-specific settings of a Lambda function or version. The output includes only options that can vary between versions of a function. To modify these settings, use UpdateFunctionConfiguration.
To get all of a function's details, including function-level settings, use GetFunction.
Service Reference:
Examples:
Calling the getFunctionConfiguration operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Qualifier: 'STRING_VALUE' }; lambda.getFunctionConfiguration(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function
(name-only),my-function:v1
(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)Specify a version or alias to get details about a published version of the function.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:FunctionName
— (String
)The name of the function.
FunctionArn
— (String
)The function's Amazon Resource Name (ARN).
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Role
— (String
)The function's execution role.
Handler
— (String
)The function that Lambda calls to begin running your function.
CodeSize
— (Integer
)The size of the function's deployment package, in bytes.
Description
— (String
)The function's description.
Timeout
— (Integer
)The amount of time in seconds that Lambda allows a function to run before stopping it.
MemorySize
— (Integer
)The amount of memory available to the function at runtime.
LastModified
— (String
)The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
CodeSha256
— (String
)The SHA256 hash of the function's deployment package.
Version
— (String
)The version of the Lambda function.
VpcConfig
— (map
)The function's networking configuration.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
VpcId
— (String
)The ID of the VPC.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
DeadLetterConfig
— (map
)The function's dead letter queue.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Environment
— (map
)The function's environment variables. Omitted from CloudTrail logs.
Variables
— (map<String>
)Environment variable key-value pairs. Omitted from CloudTrail logs.
Error
— (map
)Error messages for environment variables that couldn't be applied.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
KMSKeyArn
— (String
)The KMS key that's used to encrypt the function's environment variables. When Lambda SnapStart is activated, this key is also used to encrypt the function's snapshot. This key is returned only if you've configured a customer managed key.
TracingConfig
— (map
)The function's X-Ray tracing configuration.
Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
MasterArn
— (String
)For Lambda@Edge functions, the ARN of the main function.
RevisionId
— (String
)The latest updated revision of the function or alias.
Layers
— (Array<map>
)The function's layers.
Arn
— (String
)The Amazon Resource Name (ARN) of the function layer.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
State
— (String
)The current state of the function. When the state is
Possible values include:Inactive
, you can reactivate the function by invoking it."Pending"
"Active"
"Inactive"
"Failed"
StateReason
— (String
)The reason for the function's current state.
StateReasonCode
— (String
)The reason code for the function's current state. When the code is
Possible values include:Creating
, you can't invoke or modify the function."Idle"
"Creating"
"Restoring"
"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
LastUpdateStatus
— (String
)The status of the last update that was performed on the function. This is first set to
Possible values include:Successful
after function creation completes."Successful"
"Failed"
"InProgress"
LastUpdateStatusReason
— (String
)The reason for the last update that was performed on the function.
LastUpdateStatusReasonCode
— (String
)The reason code for the last update that was performed on the function.
Possible values include:"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
PackageType
— (String
)The type of deployment package. Set to
Possible values include:Image
for container image and setZip
for .zip file archive."Zip"
"Image"
ImageConfigResponse
— (map
)The function's image configuration values.
ImageConfig
— (map
)Configuration values that override the container image Dockerfile.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
Error
— (map
)Error response to
GetFunctionConfiguration
.ErrorCode
— (String
)Error code.
Message
— (String
)Error message.
SigningProfileVersionArn
— (String
)The ARN of the signing profile version.
SigningJobArn
— (String
)The ARN of the signing job.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is
x86_64
.EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)Set
ApplyOn
toPublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version. For more information, see Improving startup performance with Lambda SnapStart.ApplyOn
— (String
)When set to
Possible values include:PublishedVersions
, Lambda creates a snapshot of the execution environment when you publish a function version."PublishedVersions"
"None"
OptimizationStatus
— (String
)When you provide a qualified Amazon Resource Name (ARN), this response element indicates whether SnapStart is activated for the specified function version.
Possible values include:"On"
"Off"
RuntimeVersionConfig
— (map
)The ARN of the runtime and any errors that occured.
RuntimeVersionArn
— (String
)The ARN of the runtime version you want the function to use.
Error
— (map
)Error response when Lambda is unable to retrieve the runtime version for a function.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
-
(AWS.Response)
—
Returns:
Waiter Resource States:
getFunctionEventInvokeConfig(params = {}, callback) ⇒ AWS.Request
Retrieves the configuration for asynchronous invocation for a function, version, or alias.
To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.
Service Reference:
Examples:
Calling the getFunctionEventInvokeConfig operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Qualifier: 'STRING_VALUE' }; lambda.getFunctionEventInvokeConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name -
my-function
(name-only),my-function:v1
(with alias). -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN -
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)A version number or alias name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:LastModified
— (Date
)The date and time that the configuration was last updated.
FunctionArn
— (String
)The Amazon Resource Name (ARN) of the function.
MaximumRetryAttempts
— (Integer
)The maximum number of times to retry when the function returns an error.
MaximumEventAgeInSeconds
— (Integer
)The maximum age of a request that Lambda sends to a function for processing.
DestinationConfig
— (map
)A destination for events after they have been sent to a function for processing.
Destinations
-
Function - The Amazon Resource Name (ARN) of a Lambda function.
-
Queue - The ARN of a standard SQS queue.
-
Topic - The ARN of a standard SNS topic.
-
Event Bus - The ARN of an Amazon EventBridge event bus.
OnSuccess
— (map
)The destination configuration for successful invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
OnFailure
— (map
)The destination configuration for failed invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
To retain records of asynchronous invocations, you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.
To retain records of failed invocations from Kinesis and DynamoDB event sources, you can configure an Amazon SNS topic or Amazon SQS queue as the destination.
To retain records of failed invocations from self-managed Kafka or Amazon MSK, you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.
-
-
(AWS.Response)
—
Returns:
getFunctionRecursionConfig(params = {}, callback) ⇒ AWS.Request
Returns your function's recursive loop detection configuration.
Service Reference:
Examples:
Calling the getFunctionRecursionConfig operation
var params = { FunctionName: 'STRING_VALUE' /* required */ }; lambda.getFunctionRecursionConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:RecursiveLoop
— (String
)If your function's recursive loop detection configuration is
Allow
, Lambda doesn't take any action when it detects your function being invoked as part of a recursive loop.If your function's recursive loop detection configuration is
Terminate
, Lambda stops your function being invoked and notifies you when it detects your function being invoked as part of a recursive loop.By default, Lambda sets your function's configuration to
Possible values include:Terminate
. You can update this configuration using the PutFunctionRecursionConfig action."Allow"
"Terminate"
-
(AWS.Response)
—
Returns:
getFunctionUrlConfig(params = {}, callback) ⇒ AWS.Request
Returns details about a Lambda function URL.
Service Reference:
Examples:
Calling the getFunctionUrlConfig operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Qualifier: 'STRING_VALUE' }; lambda.getFunctionUrlConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)The alias name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:FunctionUrl
— (String
)The HTTP URL endpoint for your function.
FunctionArn
— (String
)The Amazon Resource Name (ARN) of your function.
AuthType
— (String
)The type of authentication that your function URL uses. Set to
Possible values include:AWS_IAM
if you want to restrict access to authenticated users only. Set toNONE
if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs."NONE"
"AWS_IAM"
Cors
— (map
)The cross-origin resource sharing (CORS) settings for your function URL.
AllowCredentials
— (Boolean
)Whether to allow cookies or other credentials in requests to your function URL. The default is
false
.AllowHeaders
— (Array<String>
)The HTTP headers that origins can include in requests to your function URL. For example:
Date
,Keep-Alive
,X-Custom-Header
.AllowMethods
— (Array<String>
)The HTTP methods that are allowed when calling your function URL. For example:
GET
,POST
,DELETE
, or the wildcard character (*
).AllowOrigins
— (Array<String>
)The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example:
https://www.example.com
,http://localhost:60905
.Alternatively, you can grant access to all origins using the wildcard character (
*
).ExposeHeaders
— (Array<String>
)The HTTP headers in your function response that you want to expose to origins that call your function URL. For example:
Date
,Keep-Alive
,X-Custom-Header
.MaxAge
— (Integer
)The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to
0
, which means that the browser doesn't cache results.
CreationTime
— (String
)When the function URL was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
LastModifiedTime
— (String
)When the function URL configuration was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
InvokeMode
— (String
)Use one of the following options:
-
BUFFERED
– This is the default option. Lambda invokes your function using theInvoke
API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB. -
RESPONSE_STREAM
– Your function streams payload results as they become available. Lambda invokes your function using theInvokeWithResponseStream
API operation. The maximum response payload size is 20 MB, however, you can request a quota increase.
"BUFFERED"
"RESPONSE_STREAM"
-
-
(AWS.Response)
—
Returns:
getLayerVersion(params = {}, callback) ⇒ AWS.Request
Returns information about a version of an Lambda layer, with a link to download the layer archive that's valid for 10 minutes.
Service Reference:
Examples:
Calling the getLayerVersion operation
var params = { LayerName: 'STRING_VALUE', /* required */ VersionNumber: 'NUMBER_VALUE' /* required */ }; lambda.getLayerVersion(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
LayerName
— (String
)The name or Amazon Resource Name (ARN) of the layer.
VersionNumber
— (Integer
)The version number.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Content
— (map
)Details about the layer version.
Location
— (String
)A link to the layer archive in Amazon S3 that is valid for 10 minutes.
CodeSha256
— (String
)The SHA-256 hash of the layer archive.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
LayerArn
— (String
)The ARN of the layer.
LayerVersionArn
— (String
)The ARN of the layer version.
Description
— (String
)The description of the version.
CreatedDate
— (String
)The date that the layer version was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
Version
— (Integer
)The version number.
CompatibleRuntimes
— (Array<String>
)The layer's compatible runtimes.
The following list includes deprecated runtimes. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
LicenseInfo
— (String
)The layer's software license.
CompatibleArchitectures
— (Array<String>
)A list of compatible instruction set architectures.
-
(AWS.Response)
—
Returns:
getLayerVersionByArn(params = {}, callback) ⇒ AWS.Request
Returns information about a version of an Lambda layer, with a link to download the layer archive that's valid for 10 minutes.
Service Reference:
Examples:
Calling the getLayerVersionByArn operation
var params = { Arn: 'STRING_VALUE' /* required */ }; lambda.getLayerVersionByArn(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
Arn
— (String
)The ARN of the layer version.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Content
— (map
)Details about the layer version.
Location
— (String
)A link to the layer archive in Amazon S3 that is valid for 10 minutes.
CodeSha256
— (String
)The SHA-256 hash of the layer archive.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
LayerArn
— (String
)The ARN of the layer.
LayerVersionArn
— (String
)The ARN of the layer version.
Description
— (String
)The description of the version.
CreatedDate
— (String
)The date that the layer version was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
Version
— (Integer
)The version number.
CompatibleRuntimes
— (Array<String>
)The layer's compatible runtimes.
The following list includes deprecated runtimes. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
LicenseInfo
— (String
)The layer's software license.
CompatibleArchitectures
— (Array<String>
)A list of compatible instruction set architectures.
-
(AWS.Response)
—
Returns:
getLayerVersionPolicy(params = {}, callback) ⇒ AWS.Request
Returns the permission policy for a version of an Lambda layer. For more information, see AddLayerVersionPermission.
Service Reference:
Examples:
Calling the getLayerVersionPolicy operation
var params = { LayerName: 'STRING_VALUE', /* required */ VersionNumber: 'NUMBER_VALUE' /* required */ }; lambda.getLayerVersionPolicy(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
LayerName
— (String
)The name or Amazon Resource Name (ARN) of the layer.
VersionNumber
— (Integer
)The version number.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Policy
— (String
)The policy document.
RevisionId
— (String
)A unique identifier for the current revision of the policy.
-
(AWS.Response)
—
Returns:
getPolicy(params = {}, callback) ⇒ AWS.Request
Returns the resource-based IAM policy for a function, version, or alias.
Service Reference:
Examples:
Calling the getPolicy operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Qualifier: 'STRING_VALUE' }; lambda.getPolicy(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function
(name-only),my-function:v1
(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)Specify a version or alias to get the policy for that resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Policy
— (String
)The resource-based policy.
RevisionId
— (String
)A unique identifier for the current revision of the policy.
-
(AWS.Response)
—
Returns:
getProvisionedConcurrencyConfig(params = {}, callback) ⇒ AWS.Request
Retrieves the provisioned concurrency configuration for a function's alias or version.
Service Reference:
Examples:
Calling the getProvisionedConcurrencyConfig operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Qualifier: 'STRING_VALUE' /* required */ }; lambda.getProvisionedConcurrencyConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)The version number or alias name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:RequestedProvisionedConcurrentExecutions
— (Integer
)The amount of provisioned concurrency requested.
AvailableProvisionedConcurrentExecutions
— (Integer
)The amount of provisioned concurrency available.
AllocatedProvisionedConcurrentExecutions
— (Integer
)The amount of provisioned concurrency allocated. When a weighted alias is used during linear and canary deployments, this value fluctuates depending on the amount of concurrency that is provisioned for the function versions.
Status
— (String
)The status of the allocation process.
Possible values include:"IN_PROGRESS"
"READY"
"FAILED"
StatusReason
— (String
)For failed allocations, the reason that provisioned concurrency could not be allocated.
LastModified
— (String
)The date and time that a user last updated the configuration, in ISO 8601 format.
-
(AWS.Response)
—
Returns:
getRuntimeManagementConfig(params = {}, callback) ⇒ AWS.Request
Retrieves the runtime management configuration for a function's version. If the runtime update mode is Manual, this includes the ARN of the runtime version and the runtime update mode. If the runtime update mode is Auto or Function update, this includes the runtime update mode and
null
is returned for the ARN. For more information, see Runtime updates.Service Reference:
Examples:
Calling the getRuntimeManagementConfig operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Qualifier: 'STRING_VALUE' }; lambda.getRuntimeManagementConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)Specify a version of the function. This can be
$LATEST
or a published version number. If no value is specified, the configuration for the$LATEST
version is returned.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UpdateRuntimeOn
— (String
)The current runtime update mode of the function.
Possible values include:"Auto"
"Manual"
"FunctionUpdate"
RuntimeVersionArn
— (String
)The ARN of the runtime the function is configured to use. If the runtime update mode is Manual, the ARN is returned, otherwise
null
is returned.FunctionArn
— (String
)The Amazon Resource Name (ARN) of your function.
-
(AWS.Response)
—
Returns:
invoke(params = {}, callback) ⇒ AWS.Request
Invokes a Lambda function. You can invoke a function synchronously (and wait for the response), or asynchronously. By default, Lambda invokes your function synchronously (i.e. the
InvocationType
isRequestResponse
). To invoke a function asynchronously, setInvocationType
toEvent
. Lambda passes theClientContext
object to your function for synchronous invocations only.For synchronous invocation, details about the function response, including errors, are included in the response body and headers. For either invocation type, you can find more information in the execution log and trace.
When an error occurs, your function may be invoked multiple times. Retry behavior varies by error type, client, event source, and invocation type. For example, if you invoke a function asynchronously and it returns an error, Lambda executes the function up to two more times. For more information, see Error handling and automatic retries in Lambda.
For asynchronous invocation, Lambda adds events to a queue before sending them to your function. If your function does not have enough capacity to keep up with the queue, events may be lost. Occasionally, your function may receive the same event multiple times, even if no error occurs. To retain events that were not processed, configure your function with a dead-letter queue.
The status code in the API response doesn't reflect function errors. Error codes are reserved for errors that prevent your function from executing, such as permissions errors, quota errors, or issues with your function's code and configuration. For example, Lambda returns
TooManyRequestsException
if running the function would cause you to exceed a concurrency limit at either the account level (ConcurrentInvocationLimitExceeded
) or function level (ReservedFunctionConcurrentInvocationLimitExceeded
).For functions with a long timeout, your client might disconnect during synchronous invocation while it waits for a response. Configure your HTTP client, SDK, firewall, proxy, or operating system to allow for long connections with timeout or keep-alive settings.
This operation requires permission for the lambda:InvokeFunction action. For details on how to set up permissions for cross-account invocations, see Granting function access to other accounts.
Service Reference:
Examples:
Calling the invoke operation
var params = { FunctionName: 'STRING_VALUE', /* required */ ClientContext: 'STRING_VALUE', InvocationType: Event | RequestResponse | DryRun, LogType: None | Tail, Payload: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */, Qualifier: 'STRING_VALUE' }; lambda.invoke(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function
(name-only),my-function:v1
(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
InvocationType
— (String
)Choose from the following options.
-
RequestResponse
(default) – Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API response includes the function response and additional data. -
Event
– Invoke the function asynchronously. Send events that fail multiple times to the function's dead-letter queue (if one is configured). The API response only includes a status code. -
DryRun
– Validate parameter values and verify that the user or role has permission to invoke the function.
"Event"
"RequestResponse"
"DryRun"
-
LogType
— (String
)Set to
Possible values include:Tail
to include the execution log in the response. Applies to synchronously invoked functions only."None"
"Tail"
ClientContext
— (String
)Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object. Lambda passes the
ClientContext
object to your function for synchronous invocations only.Payload
— (Buffer, Typed Array, Blob, String
)The JSON that you want to provide to your Lambda function as input.
You can enter the JSON directly. For example,
--payload '{ "key": "value" }'
. You can also specify a file path. For example,--payload file://payload.json
.Qualifier
— (String
)Specify a version or alias to invoke a published version of the function.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:StatusCode
— (Integer
)The HTTP status code is in the 200 range for a successful request. For the
RequestResponse
invocation type, this status code is 200. For theEvent
invocation type, this status code is 202. For theDryRun
invocation type, the status code is 204.FunctionError
— (String
)If present, indicates that an error occurred during function execution. Details about the error are included in the response payload.
LogResult
— (String
)The last 4 KB of the execution log, which is base64-encoded.
Payload
— (Buffer(Node.js), Typed Array(Browser)
)The response from the function, or an error object.
ExecutedVersion
— (String
)The version of the function that executed. When you invoke a function with an alias, this indicates which version the alias resolved to.
-
(AWS.Response)
—
Returns:
invokeAsync(params = {}, callback) ⇒ AWS.Request
For asynchronous function invocation, use Invoke.
Invokes a function asynchronously.
Note: If you do use the InvokeAsync action, note that it doesn't support the use of X-Ray active tracing. Trace ID is not propagated to the function, even if X-Ray active tracing is turned on.Service Reference:
Examples:
Calling the invokeAsync operation
var params = { FunctionName: 'STRING_VALUE', /* required */ InvokeArgs: Buffer.from('...') || 'STRING_VALUE' || streamObject /* required */ }; lambda.invokeAsync(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
InvokeArgs
— (Buffer, Typed Array, Blob, String, ReadableStream
)The JSON that you want to provide to your Lambda function as input.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Status
— (Integer
)The status code.
-
(AWS.Response)
—
Returns:
invokeWithResponseStream(params = {}, callback) ⇒ AWS.Request
Configure your Lambda functions to stream response payloads back to clients. For more information, see Configuring a Lambda function to stream responses.
This operation requires permission for the lambda:InvokeFunction action. For details on how to set up permissions for cross-account invocations, see Granting function access to other accounts.
Service Reference:
Examples:
Node.js EventStream Example
// In Node.js, events are streamed and can be read as they arrive. lambda.invokeWithResponseStream({/** params **/}, function(err, data) { if (err) { // handle error return console.error(err); } var eventStream = data.EventStream; eventStream.on('data', function(event) { // Check the top-level field to determine which event this is. if (event.PayloadChunk) { // handle PayloadChunk event } else if (event.InvokeComplete) { // handle InvokeComplete event } }); eventStream.on('error', function(err) { /** Handle error events **/}); eventStream.on('end', function() { /** Finished reading all events **/}); });
Browser EventStream Example
// In browsers, events aren't processed until the response is fully buffered. // Events will be accessible as an array. lambda.invokeWithResponseStream({/** params **/}, function(err, data) { if (err) { // handle error return console.error(err); } var events = data.EventStream; for (var event of events) { // Check the top-level field to determine which event this is. if (event.PayloadChunk) { // handle PayloadChunk event } else if (event.InvokeComplete) { // handle InvokeComplete event } } });
Async Iterator EventStream Example (Experimental)
// In Node.js v10.x, Readable streams have experimental support for async iteration. // Instead of listening to the event stream's 'data' event, you can use a for...await loop. async function example() { try { const result = await lambda.invokeWithResponseStream({/** params **/}).promise(); const events = result.EventStream; for await (const event of events) { // Check the top-level field to determine which event this is. if (event.PayloadChunk) { // handle PayloadChunk event } else if (event.InvokeComplete) { // handle InvokeComplete event } } } catch (err) { // handle error } }
Calling the invokeWithResponseStream operation
var params = { FunctionName: 'STRING_VALUE', /* required */ ClientContext: 'STRING_VALUE', InvocationType: RequestResponse | DryRun, LogType: None | Tail, Payload: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */, Qualifier: 'STRING_VALUE' }; lambda.invokeWithResponseStream(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
InvocationType
— (String
)Use one of the following options:
-
RequestResponse
(default) – Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API operation response includes the function response and additional data. -
DryRun
– Validate parameter values and verify that the IAM user or role has permission to invoke the function.
"RequestResponse"
"DryRun"
-
LogType
— (String
)Set to
Possible values include:Tail
to include the execution log in the response. Applies to synchronously invoked functions only."None"
"Tail"
ClientContext
— (String
)Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object.
Qualifier
— (String
)The alias name.
Payload
— (Buffer, Typed Array, Blob, String
)The JSON that you want to provide to your Lambda function as input.
You can enter the JSON directly. For example,
--payload '{ "key": "value" }'
. You can also specify a file path. For example,--payload file://payload.json
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:StatusCode
— (Integer
)For a successful request, the HTTP status code is in the 200 range. For the
RequestResponse
invocation type, this status code is 200. For theDryRun
invocation type, this status code is 204.ExecutedVersion
— (String
)The version of the function that executed. When you invoke a function with an alias, this indicates which version the alias resolved to.
EventStream
— (ReadableStream<Events> | Array<Events>
)The stream of response payloads.
EventStream is an object-mode Readable stream in Node.js v0.10.x and higher. Attach a listener to thedata
event to receive events. EventStream is an array of events in browsers. The possible events that may be returned are listed below. Note that the top-level field in each event matches the event name.PayloadChunk
— (map
)A chunk of the streamed response payload.
Payload
— (Buffer
)Data returned by your Lambda function.
InvokeComplete
— (map
)An object that's returned when the stream has ended and all the payload chunks have been returned.
ErrorCode
— (String
)An error code.
ErrorDetails
— (String
)The details of any returned error.
LogResult
— (String
)The last 4 KB of the execution log, which is base64-encoded.
ResponseStreamContentType
— (String
)The type of data the stream is returning.
-
(AWS.Response)
—
Returns:
listAliases(params = {}, callback) ⇒ AWS.Request
Returns a list of aliases for a Lambda function.
Service Reference:
Examples:
Calling the listAliases operation
var params = { FunctionName: 'STRING_VALUE', /* required */ FunctionVersion: 'STRING_VALUE', Marker: 'STRING_VALUE', MaxItems: 'NUMBER_VALUE' }; lambda.listAliases(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Partial ARN -
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
FunctionVersion
— (String
)Specify a function version to only list aliases that invoke that version.
Marker
— (String
)Specify the pagination token that's returned by a previous request to retrieve the next page of results.
MaxItems
— (Integer
)Limit the number of aliases returned.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:NextMarker
— (String
)The pagination token that's included if more results are available.
Aliases
— (Array<map>
)A list of aliases.
AliasArn
— (String
)The Amazon Resource Name (ARN) of the alias.
Name
— (String
)The name of the alias.
FunctionVersion
— (String
)The function version that the alias invokes.
Description
— (String
)A description of the alias.
RoutingConfig
— (map
)The routing configuration of the alias.
AdditionalVersionWeights
— (map<Float>
)The second version, and the percentage of traffic that's routed to it.
RevisionId
— (String
)A unique identifier that changes when you update the alias.
-
(AWS.Response)
—
Returns:
listCodeSigningConfigs(params = {}, callback) ⇒ AWS.Request
Returns a list of code signing configurations. A request returns up to 10,000 configurations per call. You can use the
MaxItems
parameter to return fewer configurations per call.Service Reference:
Examples:
Calling the listCodeSigningConfigs operation
var params = { Marker: 'STRING_VALUE', MaxItems: 'NUMBER_VALUE' }; lambda.listCodeSigningConfigs(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
Marker
— (String
)Specify the pagination token that's returned by a previous request to retrieve the next page of results.
MaxItems
— (Integer
)Maximum number of items to return.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:NextMarker
— (String
)The pagination token that's included if more results are available.
CodeSigningConfigs
— (Array<map>
)The code signing configurations
CodeSigningConfigId
— required — (String
)Unique identifer for the Code signing configuration.
CodeSigningConfigArn
— required — (String
)The Amazon Resource Name (ARN) of the Code signing configuration.
Description
— (String
)Code signing configuration description.
AllowedPublishers
— required — (map
)List of allowed publishers.
SigningProfileVersionArns
— required — (Array<String>
)The Amazon Resource Name (ARN) for each of the signing profiles. A signing profile defines a trusted user who can sign a code package.
CodeSigningPolicies
— required — (map
)The code signing policy controls the validation failure action for signature mismatch or expiry.
UntrustedArtifactOnDeployment
— (String
)Code signing configuration policy for deployment validation failure. If you set the policy to
Enforce
, Lambda blocks the deployment request if signature validation checks fail. If you set the policy toWarn
, Lambda allows the deployment and creates a CloudWatch log.Default value:
Possible values include:Warn
"Warn"
"Enforce"
LastModified
— required — (String
)The date and time that the Code signing configuration was last modified, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
-
(AWS.Response)
—
Returns:
listEventSourceMappings(params = {}, callback) ⇒ AWS.Request
Lists event source mappings. Specify an
EventSourceArn
to show only event source mappings for a single event source.Service Reference:
Examples:
Calling the listEventSourceMappings operation
var params = { EventSourceArn: 'STRING_VALUE', FunctionName: 'STRING_VALUE', Marker: 'STRING_VALUE', MaxItems: 'NUMBER_VALUE' }; lambda.listEventSourceMappings(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
EventSourceArn
— (String
)The Amazon Resource Name (ARN) of the event source.
-
Amazon Kinesis – The ARN of the data stream or a stream consumer.
-
Amazon DynamoDB Streams – The ARN of the stream.
-
Amazon Simple Queue Service – The ARN of the queue.
-
Amazon Managed Streaming for Apache Kafka – The ARN of the cluster or the ARN of the VPC connection (for cross-account event source mappings).
-
Amazon MQ – The ARN of the broker.
-
Amazon DocumentDB – The ARN of the DocumentDB change stream.
-
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
MyFunction
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Version or Alias ARN –
arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD
. -
Partial ARN –
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.
-
Marker
— (String
)A pagination token returned by a previous call.
MaxItems
— (Integer
)The maximum number of event source mappings to return. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:NextMarker
— (String
)A pagination token that's returned when the response doesn't contain all event source mappings.
EventSourceMappings
— (Array<map>
)A list of event source mappings.
UUID
— (String
)The identifier of the event source mapping.
StartingPosition
— (String
)The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Stream event sources.
Possible values include:AT_TIMESTAMP
is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed Apache Kafka."TRIM_HORIZON"
"LATEST"
"AT_TIMESTAMP"
StartingPositionTimestamp
— (Date
)With
StartingPosition
set toAT_TIMESTAMP
, the time from which to start reading.StartingPositionTimestamp
cannot be in the future.BatchSize
— (Integer
)The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).
Default value: Varies by service. For Amazon SQS, the default is 10. For all other services, the default is 100.
Related setting: When you set
BatchSize
to a value greater than 10, you must setMaximumBatchingWindowInSeconds
to at least 1.MaximumBatchingWindowInSeconds
— (Integer
)The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure
MaximumBatchingWindowInSeconds
to any value from 0 seconds to 300 seconds in increments of seconds.For streams and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching window is 500 ms. Note that because you can only change
MaximumBatchingWindowInSeconds
in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it. To restore the default batching window, you must create a new event source mapping.Related setting: For streams and Amazon SQS event sources, when you set
BatchSize
to a value greater than 10, you must setMaximumBatchingWindowInSeconds
to at least 1.ParallelizationFactor
— (Integer
)(Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.
EventSourceArn
— (String
)The Amazon Resource Name (ARN) of the event source.
FilterCriteria
— (map
)An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see Lambda event filtering.
If filter criteria is encrypted, this field shows up as
null
in the response of ListEventSourceMapping API calls. You can view this field in plaintext in the response of GetEventSourceMapping and DeleteEventSourceMapping calls if you havekms:Decrypt
permissions for the correct KMS key.Filters
— (Array<map>
)A list of filters.
Pattern
— (String
)A filter pattern. For more information on the syntax of a filter pattern, see Filter rule syntax.
FunctionArn
— (String
)The ARN of the Lambda function.
LastModified
— (Date
)The date that the event source mapping was last updated or that its state changed.
LastProcessingResult
— (String
)The result of the last Lambda invocation of your function.
State
— (String
)The state of the event source mapping. It can be one of the following:
Creating
,Enabling
,Enabled
,Disabling
,Disabled
,Updating
, orDeleting
.StateTransitionReason
— (String
)Indicates whether a user or Lambda made the last change to the event source mapping.
DestinationConfig
— (map
)(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka event sources only) A configuration object that specifies the destination of an event after Lambda processes it.
OnSuccess
— (map
)The destination configuration for successful invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
OnFailure
— (map
)The destination configuration for failed invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
To retain records of asynchronous invocations, you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.
To retain records of failed invocations from Kinesis and DynamoDB event sources, you can configure an Amazon SNS topic or Amazon SQS queue as the destination.
To retain records of failed invocations from self-managed Kafka or Amazon MSK, you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.
Topics
— (Array<String>
)The name of the Kafka topic.
Queues
— (Array<String>
)(Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
SourceAccessConfigurations
— (Array<map>
)An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
Type
— (String
)The type of authentication protocol, VPC components, or virtual host for your event source. For example:
"Type":"SASL_SCRAM_512_AUTH"
.-
BASIC_AUTH
– (Amazon MQ) The Secrets Manager secret that stores your broker credentials. -
BASIC_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers. -
VPC_SUBNET
– (Self-managed Apache Kafka) The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your self-managed Apache Kafka cluster. -
VPC_SECURITY_GROUP
– (Self-managed Apache Kafka) The VPC security group used to manage access to your self-managed Apache Kafka brokers. -
SASL_SCRAM_256_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your self-managed Apache Kafka brokers. -
SASL_SCRAM_512_AUTH
– (Amazon MSK, Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your self-managed Apache Kafka brokers. -
VIRTUAL_HOST
–- (RabbitMQ) The name of the virtual host in your RabbitMQ broker. Lambda uses this RabbitMQ host as the event source. This property cannot be specified in an UpdateEventSourceMapping API call. -
CLIENT_CERTIFICATE_TLS_AUTH
– (Amazon MSK, self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and private key password (optional) used for mutual TLS authentication of your MSK/Apache Kafka brokers. -
SERVER_ROOT_CA_CERTIFICATE
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the root CA certificate (X.509 PEM) used for TLS encryption of your Apache Kafka brokers.
"BASIC_AUTH"
"VPC_SUBNET"
"VPC_SECURITY_GROUP"
"SASL_SCRAM_512_AUTH"
"SASL_SCRAM_256_AUTH"
"VIRTUAL_HOST"
"CLIENT_CERTIFICATE_TLS_AUTH"
"SERVER_ROOT_CA_CERTIFICATE"
-
URI
— (String
)The value for your chosen configuration in
Type
. For example:"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"
.
SelfManagedEventSource
— (map
)The self-managed Apache Kafka cluster for your event source.
Endpoints
— (map<Array<String>>
)The list of bootstrap servers for your Kafka brokers in the following format:
"KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]
.
MaximumRecordAgeInSeconds
— (Integer
)(Kinesis and DynamoDB Streams only) Discard records older than the specified age. The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records.
Note: The minimum valid value for maximum record age is 60s. Although values less than 60 and greater than -1 fall within the parameter's absolute range, they are not allowedBisectBatchOnFunctionError
— (Boolean
)(Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
MaximumRetryAttempts
— (Integer
)(Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. The default value is -1, which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.
TumblingWindowInSeconds
— (Integer
)(Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window.
FunctionResponseTypes
— (Array<String>
)(Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event source mapping.
AmazonManagedKafkaEventSourceConfig
— (map
)Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
ConsumerGroupId
— (String
)The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see Customizable consumer group ID.
SelfManagedKafkaEventSourceConfig
— (map
)Specific configuration settings for a self-managed Apache Kafka event source.
ConsumerGroupId
— (String
)The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see Customizable consumer group ID.
ScalingConfig
— (map
)(Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring maximum concurrency for Amazon SQS event sources.
MaximumConcurrency
— (Integer
)Limits the number of concurrent instances that the Amazon SQS event source can invoke.
DocumentDBEventSourceConfig
— (map
)Specific configuration settings for a DocumentDB event source.
DatabaseName
— (String
)The name of the database to consume within the DocumentDB cluster.
CollectionName
— (String
)The name of the collection to consume within the database. If you do not specify a collection, Lambda consumes all collections.
FullDocument
— (String
)Determines what DocumentDB sends to your event stream during document update operations. If set to UpdateLookup, DocumentDB sends a delta describing the changes, along with a copy of the entire document. Otherwise, DocumentDB sends only a partial document that contains the changes.
Possible values include:"UpdateLookup"
"Default"
KMSKeyArn
— (String
)The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your function's filter criteria.
FilterCriteriaError
— (map
)An object that contains details about an error related to filter criteria encryption.
ErrorCode
— (String
)The KMS exception that resulted from filter criteria encryption or decryption.
Message
— (String
)The error message.
-
(AWS.Response)
—
Returns:
listFunctionEventInvokeConfigs(params = {}, callback) ⇒ AWS.Request
Retrieves a list of configurations for asynchronous invocation for a function.
To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.
Service Reference:
Examples:
Calling the listFunctionEventInvokeConfigs operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Marker: 'STRING_VALUE', MaxItems: 'NUMBER_VALUE' }; lambda.listFunctionEventInvokeConfigs(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name -
my-function
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN -
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Marker
— (String
)Specify the pagination token that's returned by a previous request to retrieve the next page of results.
MaxItems
— (Integer
)The maximum number of configurations to return.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:FunctionEventInvokeConfigs
— (Array<map>
)A list of configurations.
LastModified
— (Date
)The date and time that the configuration was last updated.
FunctionArn
— (String
)The Amazon Resource Name (ARN) of the function.
MaximumRetryAttempts
— (Integer
)The maximum number of times to retry when the function returns an error.
MaximumEventAgeInSeconds
— (Integer
)The maximum age of a request that Lambda sends to a function for processing.
DestinationConfig
— (map
)A destination for events after they have been sent to a function for processing.
Destinations
-
Function - The Amazon Resource Name (ARN) of a Lambda function.
-
Queue - The ARN of a standard SQS queue.
-
Topic - The ARN of a standard SNS topic.
-
Event Bus - The ARN of an Amazon EventBridge event bus.
OnSuccess
— (map
)The destination configuration for successful invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
OnFailure
— (map
)The destination configuration for failed invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
To retain records of asynchronous invocations, you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.
To retain records of failed invocations from Kinesis and DynamoDB event sources, you can configure an Amazon SNS topic or Amazon SQS queue as the destination.
To retain records of failed invocations from self-managed Kafka or Amazon MSK, you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.
-
NextMarker
— (String
)The pagination token that's included if more results are available.
-
(AWS.Response)
—
Returns:
listFunctions(params = {}, callback) ⇒ AWS.Request
Returns a list of Lambda functions, with the version-specific configuration of each. Lambda returns up to 50 functions per call.
Set
FunctionVersion
toALL
to include all published versions of each function in addition to the unpublished version.Note: TheListFunctions
operation returns a subset of the FunctionConfiguration fields. To get the additional fields (State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode, RuntimeVersionConfig) for a function or version, use GetFunction.Service Reference:
Examples:
Calling the listFunctions operation
var params = { FunctionVersion: ALL, Marker: 'STRING_VALUE', MasterRegion: 'STRING_VALUE', MaxItems: 'NUMBER_VALUE' }; lambda.listFunctions(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
MasterRegion
— (String
)For Lambda@Edge functions, the Amazon Web Services Region of the master function. For example,
us-east-1
filters the list of functions to include only Lambda@Edge functions replicated from a master function in US East (N. Virginia). If specified, you must setFunctionVersion
toALL
.FunctionVersion
— (String
)Set to
Possible values include:ALL
to include entries for all published versions of each function."ALL"
Marker
— (String
)Specify the pagination token that's returned by a previous request to retrieve the next page of results.
MaxItems
— (Integer
)The maximum number of functions to return in the response. Note that
ListFunctions
returns a maximum of 50 items in each response, even if you set the number higher.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:NextMarker
— (String
)The pagination token that's included if more results are available.
Functions
— (Array<map>
)A list of Lambda functions.
FunctionName
— (String
)The name of the function.
FunctionArn
— (String
)The function's Amazon Resource Name (ARN).
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Role
— (String
)The function's execution role.
Handler
— (String
)The function that Lambda calls to begin running your function.
CodeSize
— (Integer
)The size of the function's deployment package, in bytes.
Description
— (String
)The function's description.
Timeout
— (Integer
)The amount of time in seconds that Lambda allows a function to run before stopping it.
MemorySize
— (Integer
)The amount of memory available to the function at runtime.
LastModified
— (String
)The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
CodeSha256
— (String
)The SHA256 hash of the function's deployment package.
Version
— (String
)The version of the Lambda function.
VpcConfig
— (map
)The function's networking configuration.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
VpcId
— (String
)The ID of the VPC.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
DeadLetterConfig
— (map
)The function's dead letter queue.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Environment
— (map
)The function's environment variables. Omitted from CloudTrail logs.
Variables
— (map<String>
)Environment variable key-value pairs. Omitted from CloudTrail logs.
Error
— (map
)Error messages for environment variables that couldn't be applied.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
KMSKeyArn
— (String
)The KMS key that's used to encrypt the function's environment variables. When Lambda SnapStart is activated, this key is also used to encrypt the function's snapshot. This key is returned only if you've configured a customer managed key.
TracingConfig
— (map
)The function's X-Ray tracing configuration.
Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
MasterArn
— (String
)For Lambda@Edge functions, the ARN of the main function.
RevisionId
— (String
)The latest updated revision of the function or alias.
Layers
— (Array<map>
)The function's layers.
Arn
— (String
)The Amazon Resource Name (ARN) of the function layer.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
State
— (String
)The current state of the function. When the state is
Possible values include:Inactive
, you can reactivate the function by invoking it."Pending"
"Active"
"Inactive"
"Failed"
StateReason
— (String
)The reason for the function's current state.
StateReasonCode
— (String
)The reason code for the function's current state. When the code is
Possible values include:Creating
, you can't invoke or modify the function."Idle"
"Creating"
"Restoring"
"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
LastUpdateStatus
— (String
)The status of the last update that was performed on the function. This is first set to
Possible values include:Successful
after function creation completes."Successful"
"Failed"
"InProgress"
LastUpdateStatusReason
— (String
)The reason for the last update that was performed on the function.
LastUpdateStatusReasonCode
— (String
)The reason code for the last update that was performed on the function.
Possible values include:"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
PackageType
— (String
)The type of deployment package. Set to
Possible values include:Image
for container image and setZip
for .zip file archive."Zip"
"Image"
ImageConfigResponse
— (map
)The function's image configuration values.
ImageConfig
— (map
)Configuration values that override the container image Dockerfile.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
Error
— (map
)Error response to
GetFunctionConfiguration
.ErrorCode
— (String
)Error code.
Message
— (String
)Error message.
SigningProfileVersionArn
— (String
)The ARN of the signing profile version.
SigningJobArn
— (String
)The ARN of the signing job.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is
x86_64
.EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)Set
ApplyOn
toPublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version. For more information, see Improving startup performance with Lambda SnapStart.ApplyOn
— (String
)When set to
Possible values include:PublishedVersions
, Lambda creates a snapshot of the execution environment when you publish a function version."PublishedVersions"
"None"
OptimizationStatus
— (String
)When you provide a qualified Amazon Resource Name (ARN), this response element indicates whether SnapStart is activated for the specified function version.
Possible values include:"On"
"Off"
RuntimeVersionConfig
— (map
)The ARN of the runtime and any errors that occured.
RuntimeVersionArn
— (String
)The ARN of the runtime version you want the function to use.
Error
— (map
)Error response when Lambda is unable to retrieve the runtime version for a function.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
-
(AWS.Response)
—
Returns:
listFunctionsByCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
List the functions that use the specified code signing configuration. You can use this method prior to deleting a code signing configuration, to verify that no functions are using it.
Service Reference:
Examples:
Calling the listFunctionsByCodeSigningConfig operation
var params = { CodeSigningConfigArn: 'STRING_VALUE', /* required */ Marker: 'STRING_VALUE', MaxItems: 'NUMBER_VALUE' }; lambda.listFunctionsByCodeSigningConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CodeSigningConfigArn
— (String
)The The Amazon Resource Name (ARN) of the code signing configuration.
Marker
— (String
)Specify the pagination token that's returned by a previous request to retrieve the next page of results.
MaxItems
— (Integer
)Maximum number of items to return.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:NextMarker
— (String
)The pagination token that's included if more results are available.
FunctionArns
— (Array<String>
)The function ARNs.
-
(AWS.Response)
—
Returns:
listFunctionUrlConfigs(params = {}, callback) ⇒ AWS.Request
Returns a list of Lambda function URLs for the specified function.
Service Reference:
Examples:
Calling the listFunctionUrlConfigs operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Marker: 'STRING_VALUE', MaxItems: 'NUMBER_VALUE' }; lambda.listFunctionUrlConfigs(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Marker
— (String
)Specify the pagination token that's returned by a previous request to retrieve the next page of results.
MaxItems
— (Integer
)The maximum number of function URLs to return in the response. Note that
ListFunctionUrlConfigs
returns a maximum of 50 items in each response, even if you set the number higher.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:FunctionUrlConfigs
— (Array<map>
)A list of function URL configurations.
FunctionUrl
— required — (String
)The HTTP URL endpoint for your function.
FunctionArn
— required — (String
)The Amazon Resource Name (ARN) of your function.
CreationTime
— required — (String
)When the function URL was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
LastModifiedTime
— required — (String
)When the function URL configuration was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
Cors
— (map
)The cross-origin resource sharing (CORS) settings for your function URL.
AllowCredentials
— (Boolean
)Whether to allow cookies or other credentials in requests to your function URL. The default is
false
.AllowHeaders
— (Array<String>
)The HTTP headers that origins can include in requests to your function URL. For example:
Date
,Keep-Alive
,X-Custom-Header
.AllowMethods
— (Array<String>
)The HTTP methods that are allowed when calling your function URL. For example:
GET
,POST
,DELETE
, or the wildcard character (*
).AllowOrigins
— (Array<String>
)The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example:
https://www.example.com
,http://localhost:60905
.Alternatively, you can grant access to all origins using the wildcard character (
*
).ExposeHeaders
— (Array<String>
)The HTTP headers in your function response that you want to expose to origins that call your function URL. For example:
Date
,Keep-Alive
,X-Custom-Header
.MaxAge
— (Integer
)The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to
0
, which means that the browser doesn't cache results.
AuthType
— required — (String
)The type of authentication that your function URL uses. Set to
Possible values include:AWS_IAM
if you want to restrict access to authenticated users only. Set toNONE
if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs."NONE"
"AWS_IAM"
InvokeMode
— (String
)Use one of the following options:
-
BUFFERED
– This is the default option. Lambda invokes your function using theInvoke
API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB. -
RESPONSE_STREAM
– Your function streams payload results as they become available. Lambda invokes your function using theInvokeWithResponseStream
API operation. The maximum response payload size is 20 MB, however, you can request a quota increase.
"BUFFERED"
"RESPONSE_STREAM"
-
NextMarker
— (String
)The pagination token that's included if more results are available.
-
(AWS.Response)
—
Returns:
listLayers(params = {}, callback) ⇒ AWS.Request
Lists Lambda layers and shows information about the latest version of each. Specify a runtime identifier to list only layers that indicate that they're compatible with that runtime. Specify a compatible architecture to include only layers that are compatible with that instruction set architecture.
Service Reference:
Examples:
Calling the listLayers operation
var params = { CompatibleArchitecture: x86_64 | arm64, CompatibleRuntime: nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | dotnet8 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2 | nodejs18.x | python3.10 | java17 | ruby3.2 | ruby3.3 | python3.11 | nodejs20.x | provided.al2023 | python3.12 | java21, Marker: 'STRING_VALUE', MaxItems: 'NUMBER_VALUE' }; lambda.listLayers(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CompatibleRuntime
— (String
)A runtime identifier.
The following list includes deprecated runtimes. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Marker
— (String
)A pagination token returned by a previous call.
MaxItems
— (Integer
)The maximum number of layers to return.
CompatibleArchitecture
— (String
)The compatible instruction set architecture.
Possible values include:"x86_64"
"arm64"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:NextMarker
— (String
)A pagination token returned when the response doesn't contain all layers.
Layers
— (Array<map>
)A list of function layers.
LayerName
— (String
)The name of the layer.
LayerArn
— (String
)The Amazon Resource Name (ARN) of the function layer.
LatestMatchingVersion
— (map
)The newest version of the layer.
LayerVersionArn
— (String
)The ARN of the layer version.
Version
— (Integer
)The version number.
Description
— (String
)The description of the version.
CreatedDate
— (String
)The date that the version was created, in ISO 8601 format. For example,
2018-11-27T15:10:45.123+0000
.CompatibleRuntimes
— (Array<String>
)The layer's compatible runtimes.
The following list includes deprecated runtimes. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
LicenseInfo
— (String
)The layer's open-source license.
CompatibleArchitectures
— (Array<String>
)A list of compatible instruction set architectures.
-
(AWS.Response)
—
Returns:
listLayerVersions(params = {}, callback) ⇒ AWS.Request
Lists the versions of an Lambda layer. Versions that have been deleted aren't listed. Specify a runtime identifier to list only versions that indicate that they're compatible with that runtime. Specify a compatible architecture to include only layer versions that are compatible with that architecture.
Service Reference:
Examples:
Calling the listLayerVersions operation
var params = { LayerName: 'STRING_VALUE', /* required */ CompatibleArchitecture: x86_64 | arm64, CompatibleRuntime: nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | dotnet8 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2 | nodejs18.x | python3.10 | java17 | ruby3.2 | ruby3.3 | python3.11 | nodejs20.x | provided.al2023 | python3.12 | java21, Marker: 'STRING_VALUE', MaxItems: 'NUMBER_VALUE' }; lambda.listLayerVersions(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CompatibleRuntime
— (String
)A runtime identifier.
The following list includes deprecated runtimes. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
LayerName
— (String
)The name or Amazon Resource Name (ARN) of the layer.
Marker
— (String
)A pagination token returned by a previous call.
MaxItems
— (Integer
)The maximum number of versions to return.
CompatibleArchitecture
— (String
)The compatible instruction set architecture.
Possible values include:"x86_64"
"arm64"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:NextMarker
— (String
)A pagination token returned when the response doesn't contain all versions.
LayerVersions
— (Array<map>
)A list of versions.
LayerVersionArn
— (String
)The ARN of the layer version.
Version
— (Integer
)The version number.
Description
— (String
)The description of the version.
CreatedDate
— (String
)The date that the version was created, in ISO 8601 format. For example,
2018-11-27T15:10:45.123+0000
.CompatibleRuntimes
— (Array<String>
)The layer's compatible runtimes.
The following list includes deprecated runtimes. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
LicenseInfo
— (String
)The layer's open-source license.
CompatibleArchitectures
— (Array<String>
)A list of compatible instruction set architectures.
-
(AWS.Response)
—
Returns:
listProvisionedConcurrencyConfigs(params = {}, callback) ⇒ AWS.Request
Retrieves a list of provisioned concurrency configurations for a function.
Service Reference:
Examples:
Calling the listProvisionedConcurrencyConfigs operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Marker: 'STRING_VALUE', MaxItems: 'NUMBER_VALUE' }; lambda.listProvisionedConcurrencyConfigs(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Marker
— (String
)Specify the pagination token that's returned by a previous request to retrieve the next page of results.
MaxItems
— (Integer
)Specify a number to limit the number of configurations returned.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:ProvisionedConcurrencyConfigs
— (Array<map>
)A list of provisioned concurrency configurations.
FunctionArn
— (String
)The Amazon Resource Name (ARN) of the alias or version.
RequestedProvisionedConcurrentExecutions
— (Integer
)The amount of provisioned concurrency requested.
AvailableProvisionedConcurrentExecutions
— (Integer
)The amount of provisioned concurrency available.
AllocatedProvisionedConcurrentExecutions
— (Integer
)The amount of provisioned concurrency allocated. When a weighted alias is used during linear and canary deployments, this value fluctuates depending on the amount of concurrency that is provisioned for the function versions.
Status
— (String
)The status of the allocation process.
Possible values include:"IN_PROGRESS"
"READY"
"FAILED"
StatusReason
— (String
)For failed allocations, the reason that provisioned concurrency could not be allocated.
LastModified
— (String
)The date and time that a user last updated the configuration, in ISO 8601 format.
NextMarker
— (String
)The pagination token that's included if more results are available.
-
(AWS.Response)
—
Returns:
listTags(params = {}, callback) ⇒ AWS.Request
Returns a function's tags. You can also view tags with GetFunction.
Service Reference:
Examples:
Calling the listTags operation
var params = { Resource: 'STRING_VALUE' /* required */ }; lambda.listTags(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
Resource
— (String
)The function's Amazon Resource Name (ARN). Note: Lambda does not support adding tags to aliases or versions.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Tags
— (map<String>
)The function's tags.
-
(AWS.Response)
—
Returns:
listVersionsByFunction(params = {}, callback) ⇒ AWS.Request
Returns a list of versions, with the version-specific configuration of each. Lambda returns up to 50 versions per call.
Service Reference:
Examples:
Calling the listVersionsByFunction operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Marker: 'STRING_VALUE', MaxItems: 'NUMBER_VALUE' }; lambda.listVersionsByFunction(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Partial ARN -
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Marker
— (String
)Specify the pagination token that's returned by a previous request to retrieve the next page of results.
MaxItems
— (Integer
)The maximum number of versions to return. Note that
ListVersionsByFunction
returns a maximum of 50 items in each response, even if you set the number higher.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:NextMarker
— (String
)The pagination token that's included if more results are available.
Versions
— (Array<map>
)A list of Lambda function versions.
FunctionName
— (String
)The name of the function.
FunctionArn
— (String
)The function's Amazon Resource Name (ARN).
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Role
— (String
)The function's execution role.
Handler
— (String
)The function that Lambda calls to begin running your function.
CodeSize
— (Integer
)The size of the function's deployment package, in bytes.
Description
— (String
)The function's description.
Timeout
— (Integer
)The amount of time in seconds that Lambda allows a function to run before stopping it.
MemorySize
— (Integer
)The amount of memory available to the function at runtime.
LastModified
— (String
)The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
CodeSha256
— (String
)The SHA256 hash of the function's deployment package.
Version
— (String
)The version of the Lambda function.
VpcConfig
— (map
)The function's networking configuration.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
VpcId
— (String
)The ID of the VPC.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
DeadLetterConfig
— (map
)The function's dead letter queue.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Environment
— (map
)The function's environment variables. Omitted from CloudTrail logs.
Variables
— (map<String>
)Environment variable key-value pairs. Omitted from CloudTrail logs.
Error
— (map
)Error messages for environment variables that couldn't be applied.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
KMSKeyArn
— (String
)The KMS key that's used to encrypt the function's environment variables. When Lambda SnapStart is activated, this key is also used to encrypt the function's snapshot. This key is returned only if you've configured a customer managed key.
TracingConfig
— (map
)The function's X-Ray tracing configuration.
Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
MasterArn
— (String
)For Lambda@Edge functions, the ARN of the main function.
RevisionId
— (String
)The latest updated revision of the function or alias.
Layers
— (Array<map>
)The function's layers.
Arn
— (String
)The Amazon Resource Name (ARN) of the function layer.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
State
— (String
)The current state of the function. When the state is
Possible values include:Inactive
, you can reactivate the function by invoking it."Pending"
"Active"
"Inactive"
"Failed"
StateReason
— (String
)The reason for the function's current state.
StateReasonCode
— (String
)The reason code for the function's current state. When the code is
Possible values include:Creating
, you can't invoke or modify the function."Idle"
"Creating"
"Restoring"
"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
LastUpdateStatus
— (String
)The status of the last update that was performed on the function. This is first set to
Possible values include:Successful
after function creation completes."Successful"
"Failed"
"InProgress"
LastUpdateStatusReason
— (String
)The reason for the last update that was performed on the function.
LastUpdateStatusReasonCode
— (String
)The reason code for the last update that was performed on the function.
Possible values include:"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
PackageType
— (String
)The type of deployment package. Set to
Possible values include:Image
for container image and setZip
for .zip file archive."Zip"
"Image"
ImageConfigResponse
— (map
)The function's image configuration values.
ImageConfig
— (map
)Configuration values that override the container image Dockerfile.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
Error
— (map
)Error response to
GetFunctionConfiguration
.ErrorCode
— (String
)Error code.
Message
— (String
)Error message.
SigningProfileVersionArn
— (String
)The ARN of the signing profile version.
SigningJobArn
— (String
)The ARN of the signing job.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is
x86_64
.EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)Set
ApplyOn
toPublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version. For more information, see Improving startup performance with Lambda SnapStart.ApplyOn
— (String
)When set to
Possible values include:PublishedVersions
, Lambda creates a snapshot of the execution environment when you publish a function version."PublishedVersions"
"None"
OptimizationStatus
— (String
)When you provide a qualified Amazon Resource Name (ARN), this response element indicates whether SnapStart is activated for the specified function version.
Possible values include:"On"
"Off"
RuntimeVersionConfig
— (map
)The ARN of the runtime and any errors that occured.
RuntimeVersionArn
— (String
)The ARN of the runtime version you want the function to use.
Error
— (map
)Error response when Lambda is unable to retrieve the runtime version for a function.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
-
(AWS.Response)
—
Returns:
publishLayerVersion(params = {}, callback) ⇒ AWS.Request
Creates an Lambda layer from a ZIP archive. Each time you call
PublishLayerVersion
with the same layer name, a new version is created.Add layers to your function with CreateFunction or UpdateFunctionConfiguration.
Service Reference:
Examples:
Calling the publishLayerVersion operation
var params = { Content: { /* required */ S3Bucket: 'STRING_VALUE', S3Key: 'STRING_VALUE', S3ObjectVersion: 'STRING_VALUE', ZipFile: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */ }, LayerName: 'STRING_VALUE', /* required */ CompatibleArchitectures: [ x86_64 | arm64, /* more items */ ], CompatibleRuntimes: [ nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | dotnet8 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2 | nodejs18.x | python3.10 | java17 | ruby3.2 | ruby3.3 | python3.11 | nodejs20.x | provided.al2023 | python3.12 | java21, /* more items */ ], Description: 'STRING_VALUE', LicenseInfo: 'STRING_VALUE' }; lambda.publishLayerVersion(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
LayerName
— (String
)The name or Amazon Resource Name (ARN) of the layer.
Description
— (String
)The description of the version.
Content
— (map
)The function layer archive.
S3Bucket
— (String
)The Amazon S3 bucket of the layer archive.
S3Key
— (String
)The Amazon S3 key of the layer archive.
S3ObjectVersion
— (String
)For versioned objects, the version of the layer archive object to use.
ZipFile
— (Buffer, Typed Array, Blob, String
)The base64-encoded contents of the layer archive. Amazon Web Services SDK and Amazon Web Services CLI clients handle the encoding for you.
CompatibleRuntimes
— (Array<String>
)A list of compatible function runtimes. Used for filtering with ListLayers and ListLayerVersions.
The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.
LicenseInfo
— (String
)The layer's software license. It can be any of the following:
-
An SPDX license identifier. For example,
MIT
. -
The URL of a license hosted on the internet. For example,
https://opensource.org/licenses/MIT
. -
The full text of the license.
-
CompatibleArchitectures
— (Array<String>
)A list of compatible instruction set architectures.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Content
— (map
)Details about the layer version.
Location
— (String
)A link to the layer archive in Amazon S3 that is valid for 10 minutes.
CodeSha256
— (String
)The SHA-256 hash of the layer archive.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
LayerArn
— (String
)The ARN of the layer.
LayerVersionArn
— (String
)The ARN of the layer version.
Description
— (String
)The description of the version.
CreatedDate
— (String
)The date that the layer version was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
Version
— (Integer
)The version number.
CompatibleRuntimes
— (Array<String>
)The layer's compatible runtimes.
The following list includes deprecated runtimes. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
LicenseInfo
— (String
)The layer's software license.
CompatibleArchitectures
— (Array<String>
)A list of compatible instruction set architectures.
-
(AWS.Response)
—
Returns:
publishVersion(params = {}, callback) ⇒ AWS.Request
Creates a version from the current code and configuration of a function. Use versions to create a snapshot of your function code and configuration that doesn't change.
Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version. Use UpdateFunctionCode or UpdateFunctionConfiguration to update the function before publishing a version.
Clients can invoke versions directly or with an alias. To create an alias, use CreateAlias.
Service Reference:
Examples:
Calling the publishVersion operation
var params = { FunctionName: 'STRING_VALUE', /* required */ CodeSha256: 'STRING_VALUE', Description: 'STRING_VALUE', RevisionId: 'STRING_VALUE' }; lambda.publishVersion(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Partial ARN -
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
CodeSha256
— (String
)Only publish a version if the hash value matches the value that's specified. Use this option to avoid publishing a version if the function code has changed since you last updated it. You can get the hash for the version that you uploaded from the output of UpdateFunctionCode.
Description
— (String
)A description for the version to override the description in the function configuration.
RevisionId
— (String
)Only update the function if the revision ID matches the ID that's specified. Use this option to avoid publishing a version if the function configuration has changed since you last updated it.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:FunctionName
— (String
)The name of the function.
FunctionArn
— (String
)The function's Amazon Resource Name (ARN).
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Role
— (String
)The function's execution role.
Handler
— (String
)The function that Lambda calls to begin running your function.
CodeSize
— (Integer
)The size of the function's deployment package, in bytes.
Description
— (String
)The function's description.
Timeout
— (Integer
)The amount of time in seconds that Lambda allows a function to run before stopping it.
MemorySize
— (Integer
)The amount of memory available to the function at runtime.
LastModified
— (String
)The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
CodeSha256
— (String
)The SHA256 hash of the function's deployment package.
Version
— (String
)The version of the Lambda function.
VpcConfig
— (map
)The function's networking configuration.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
VpcId
— (String
)The ID of the VPC.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
DeadLetterConfig
— (map
)The function's dead letter queue.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Environment
— (map
)The function's environment variables. Omitted from CloudTrail logs.
Variables
— (map<String>
)Environment variable key-value pairs. Omitted from CloudTrail logs.
Error
— (map
)Error messages for environment variables that couldn't be applied.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
KMSKeyArn
— (String
)The KMS key that's used to encrypt the function's environment variables. When Lambda SnapStart is activated, this key is also used to encrypt the function's snapshot. This key is returned only if you've configured a customer managed key.
TracingConfig
— (map
)The function's X-Ray tracing configuration.
Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
MasterArn
— (String
)For Lambda@Edge functions, the ARN of the main function.
RevisionId
— (String
)The latest updated revision of the function or alias.
Layers
— (Array<map>
)The function's layers.
Arn
— (String
)The Amazon Resource Name (ARN) of the function layer.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
State
— (String
)The current state of the function. When the state is
Possible values include:Inactive
, you can reactivate the function by invoking it."Pending"
"Active"
"Inactive"
"Failed"
StateReason
— (String
)The reason for the function's current state.
StateReasonCode
— (String
)The reason code for the function's current state. When the code is
Possible values include:Creating
, you can't invoke or modify the function."Idle"
"Creating"
"Restoring"
"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
LastUpdateStatus
— (String
)The status of the last update that was performed on the function. This is first set to
Possible values include:Successful
after function creation completes."Successful"
"Failed"
"InProgress"
LastUpdateStatusReason
— (String
)The reason for the last update that was performed on the function.
LastUpdateStatusReasonCode
— (String
)The reason code for the last update that was performed on the function.
Possible values include:"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
PackageType
— (String
)The type of deployment package. Set to
Possible values include:Image
for container image and setZip
for .zip file archive."Zip"
"Image"
ImageConfigResponse
— (map
)The function's image configuration values.
ImageConfig
— (map
)Configuration values that override the container image Dockerfile.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
Error
— (map
)Error response to
GetFunctionConfiguration
.ErrorCode
— (String
)Error code.
Message
— (String
)Error message.
SigningProfileVersionArn
— (String
)The ARN of the signing profile version.
SigningJobArn
— (String
)The ARN of the signing job.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is
x86_64
.EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)Set
ApplyOn
toPublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version. For more information, see Improving startup performance with Lambda SnapStart.ApplyOn
— (String
)When set to
Possible values include:PublishedVersions
, Lambda creates a snapshot of the execution environment when you publish a function version."PublishedVersions"
"None"
OptimizationStatus
— (String
)When you provide a qualified Amazon Resource Name (ARN), this response element indicates whether SnapStart is activated for the specified function version.
Possible values include:"On"
"Off"
RuntimeVersionConfig
— (map
)The ARN of the runtime and any errors that occured.
RuntimeVersionArn
— (String
)The ARN of the runtime version you want the function to use.
Error
— (map
)Error response when Lambda is unable to retrieve the runtime version for a function.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
-
(AWS.Response)
—
Returns:
putFunctionCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
Update the code signing configuration for the function. Changes to the code signing configuration take effect the next time a user tries to deploy a code package to the function.
Service Reference:
Examples:
Calling the putFunctionCodeSigningConfig operation
var params = { CodeSigningConfigArn: 'STRING_VALUE', /* required */ FunctionName: 'STRING_VALUE' /* required */ }; lambda.putFunctionCodeSigningConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CodeSigningConfigArn
— (String
)The The Amazon Resource Name (ARN) of the code signing configuration.
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Partial ARN -
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CodeSigningConfigArn
— (String
)The The Amazon Resource Name (ARN) of the code signing configuration.
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Partial ARN -
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
-
(AWS.Response)
—
Returns:
putFunctionConcurrency(params = {}, callback) ⇒ AWS.Request
Sets the maximum number of simultaneous executions for a function, and reserves capacity for that concurrency level.
Concurrency settings apply to the function as a whole, including all published versions and the unpublished version. Reserving concurrency both ensures that your function has capacity to process the specified number of events simultaneously, and prevents it from scaling beyond that level. Use GetFunction to see the current setting for a function.
Use GetAccountSettings to see your Regional concurrency limit. You can reserve concurrency for as many functions as you like, as long as you leave at least 100 simultaneous executions unreserved for functions that aren't configured with a per-function limit. For more information, see Lambda function scaling.
Service Reference:
Examples:
Calling the putFunctionConcurrency operation
var params = { FunctionName: 'STRING_VALUE', /* required */ ReservedConcurrentExecutions: 'NUMBER_VALUE' /* required */ }; lambda.putFunctionConcurrency(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
ReservedConcurrentExecutions
— (Integer
)The number of simultaneous executions to reserve for the function.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:ReservedConcurrentExecutions
— (Integer
)The number of concurrent executions that are reserved for this function. For more information, see Managing Lambda reserved concurrency.
-
(AWS.Response)
—
Returns:
putFunctionEventInvokeConfig(params = {}, callback) ⇒ AWS.Request
Configures options for asynchronous invocation on a function, version, or alias. If a configuration already exists for a function, version, or alias, this operation overwrites it. If you exclude any settings, they are removed. To set one option without affecting existing settings for other options, use UpdateFunctionEventInvokeConfig.
By default, Lambda retries an asynchronous invocation twice if the function returns an error. It retains events in a queue for up to six hours. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it. To retain discarded events, configure a dead-letter queue with UpdateFunctionConfiguration.
To send an invocation record to a queue, topic, function, or event bus, specify a destination. You can configure separate destinations for successful invocations (on-success) and events that fail all processing attempts (on-failure). You can configure destinations in addition to or instead of a dead-letter queue.
Service Reference:
Examples:
Calling the putFunctionEventInvokeConfig operation
var params = { FunctionName: 'STRING_VALUE', /* required */ DestinationConfig: { OnFailure: { Destination: 'STRING_VALUE' }, OnSuccess: { Destination: 'STRING_VALUE' } }, MaximumEventAgeInSeconds: 'NUMBER_VALUE', MaximumRetryAttempts: 'NUMBER_VALUE', Qualifier: 'STRING_VALUE' }; lambda.putFunctionEventInvokeConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name -
my-function
(name-only),my-function:v1
(with alias). -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN -
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)A version number or alias name.
MaximumRetryAttempts
— (Integer
)The maximum number of times to retry when the function returns an error.
MaximumEventAgeInSeconds
— (Integer
)The maximum age of a request that Lambda sends to a function for processing.
DestinationConfig
— (map
)A destination for events after they have been sent to a function for processing.
Destinations
-
Function - The Amazon Resource Name (ARN) of a Lambda function.
-
Queue - The ARN of a standard SQS queue.
-
Topic - The ARN of a standard SNS topic.
-
Event Bus - The ARN of an Amazon EventBridge event bus.
OnSuccess
— (map
)The destination configuration for successful invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
OnFailure
— (map
)The destination configuration for failed invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
To retain records of asynchronous invocations, you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.
To retain records of failed invocations from Kinesis and DynamoDB event sources, you can configure an Amazon SNS topic or Amazon SQS queue as the destination.
To retain records of failed invocations from self-managed Kafka or Amazon MSK, you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:LastModified
— (Date
)The date and time that the configuration was last updated.
FunctionArn
— (String
)The Amazon Resource Name (ARN) of the function.
MaximumRetryAttempts
— (Integer
)The maximum number of times to retry when the function returns an error.
MaximumEventAgeInSeconds
— (Integer
)The maximum age of a request that Lambda sends to a function for processing.
DestinationConfig
— (map
)A destination for events after they have been sent to a function for processing.
Destinations
-
Function - The Amazon Resource Name (ARN) of a Lambda function.
-
Queue - The ARN of a standard SQS queue.
-
Topic - The ARN of a standard SNS topic.
-
Event Bus - The ARN of an Amazon EventBridge event bus.
OnSuccess
— (map
)The destination configuration for successful invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
OnFailure
— (map
)The destination configuration for failed invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
To retain records of asynchronous invocations, you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.
To retain records of failed invocations from Kinesis and DynamoDB event sources, you can configure an Amazon SNS topic or Amazon SQS queue as the destination.
To retain records of failed invocations from self-managed Kafka or Amazon MSK, you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.
-
-
(AWS.Response)
—
Returns:
putFunctionRecursionConfig(params = {}, callback) ⇒ AWS.Request
Sets your function's recursive loop detection configuration.
When you configure a Lambda function to output to the same service or resource that invokes the function, it's possible to create an infinite recursive loop. For example, a Lambda function might write a message to an Amazon Simple Queue Service (Amazon SQS) queue, which then invokes the same function. This invocation causes the function to write another message to the queue, which in turn invokes the function again.
Lambda can detect certain types of recursive loops shortly after they occur. When Lambda detects a recursive loop and your function's recursive loop detection configuration is set to
Terminate
, it stops your function being invoked and notifies you.Service Reference:
Examples:
Calling the putFunctionRecursionConfig operation
var params = { FunctionName: 'STRING_VALUE', /* required */ RecursiveLoop: Allow | Terminate /* required */ }; lambda.putFunctionRecursionConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
RecursiveLoop
— (String
)If you set your function's recursive loop detection configuration to
Allow
, Lambda doesn't take any action when it detects your function being invoked as part of a recursive loop. We recommend that you only use this setting if your design intentionally uses a Lambda function to write data back to the same Amazon Web Services resource that invokes it.If you set your function's recursive loop detection configuration to
Terminate
, Lambda stops your function being invoked and notifies you when it detects your function being invoked as part of a recursive loop.By default, Lambda sets your function's configuration to
Terminate
.If your design intentionally uses a Lambda function to write data back to the same Amazon Web Services resource that invokes the function, then use caution and implement suitable guard rails to prevent unexpected charges being billed to your Amazon Web Services account. To learn more about best practices for using recursive invocation patterns, see Recursive patterns that cause run-away Lambda functions in Serverless Land.
"Allow"
"Terminate"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:RecursiveLoop
— (String
)The status of your function's recursive loop detection configuration.
When this value is set to
Allow
and Lambda detects your function being invoked as part of a recursive loop, it doesn't take any action.When this value is set to
Possible values include:Terminate
and Lambda detects your function being invoked as part of a recursive loop, it stops your function being invoked and notifies you."Allow"
"Terminate"
-
(AWS.Response)
—
Returns:
putProvisionedConcurrencyConfig(params = {}, callback) ⇒ AWS.Request
Adds a provisioned concurrency configuration to a function's alias or version.
Service Reference:
Examples:
Calling the putProvisionedConcurrencyConfig operation
var params = { FunctionName: 'STRING_VALUE', /* required */ ProvisionedConcurrentExecutions: 'NUMBER_VALUE', /* required */ Qualifier: 'STRING_VALUE' /* required */ }; lambda.putProvisionedConcurrencyConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)The version number or alias name.
ProvisionedConcurrentExecutions
— (Integer
)The amount of provisioned concurrency to allocate for the version or alias.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:RequestedProvisionedConcurrentExecutions
— (Integer
)The amount of provisioned concurrency requested.
AvailableProvisionedConcurrentExecutions
— (Integer
)The amount of provisioned concurrency available.
AllocatedProvisionedConcurrentExecutions
— (Integer
)The amount of provisioned concurrency allocated. When a weighted alias is used during linear and canary deployments, this value fluctuates depending on the amount of concurrency that is provisioned for the function versions.
Status
— (String
)The status of the allocation process.
Possible values include:"IN_PROGRESS"
"READY"
"FAILED"
StatusReason
— (String
)For failed allocations, the reason that provisioned concurrency could not be allocated.
LastModified
— (String
)The date and time that a user last updated the configuration, in ISO 8601 format.
-
(AWS.Response)
—
Returns:
putRuntimeManagementConfig(params = {}, callback) ⇒ AWS.Request
Sets the runtime management configuration for a function's version. For more information, see Runtime updates.
Service Reference:
Examples:
Calling the putRuntimeManagementConfig operation
var params = { FunctionName: 'STRING_VALUE', /* required */ UpdateRuntimeOn: Auto | Manual | FunctionUpdate, /* required */ Qualifier: 'STRING_VALUE', RuntimeVersionArn: 'STRING_VALUE' }; lambda.putRuntimeManagementConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)Specify a version of the function. This can be
$LATEST
or a published version number. If no value is specified, the configuration for the$LATEST
version is returned.UpdateRuntimeOn
— (String
)Specify the runtime update mode.
-
Auto (default) - Automatically update to the most recent and secure runtime version using a Two-phase runtime version rollout. This is the best choice for most customers to ensure they always benefit from runtime updates.
-
Function update - Lambda updates the runtime of your function to the most recent and secure runtime version when you update your function. This approach synchronizes runtime updates with function deployments, giving you control over when runtime updates are applied and allowing you to detect and mitigate rare runtime update incompatibilities early. When using this setting, you need to regularly update your functions to keep their runtime up-to-date.
-
Manual - You specify a runtime version in your function configuration. The function will use this runtime version indefinitely. In the rare case where a new runtime version is incompatible with an existing function, this allows you to roll back your function to an earlier runtime version. For more information, see Roll back a runtime version.
"Auto"
"Manual"
"FunctionUpdate"
-
RuntimeVersionArn
— (String
)The ARN of the runtime version you want the function to use.
Note: This is only required if you're using the Manual runtime update mode.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UpdateRuntimeOn
— (String
)The runtime update mode.
Possible values include:"Auto"
"Manual"
"FunctionUpdate"
FunctionArn
— (String
)The ARN of the function
RuntimeVersionArn
— (String
)The ARN of the runtime the function is configured to use. If the runtime update mode is manual, the ARN is returned, otherwise
null
is returned.
-
(AWS.Response)
—
Returns:
removeLayerVersionPermission(params = {}, callback) ⇒ AWS.Request
Removes a statement from the permissions policy for a version of an Lambda layer. For more information, see AddLayerVersionPermission.
Service Reference:
Examples:
Calling the removeLayerVersionPermission operation
var params = { LayerName: 'STRING_VALUE', /* required */ StatementId: 'STRING_VALUE', /* required */ VersionNumber: 'NUMBER_VALUE', /* required */ RevisionId: 'STRING_VALUE' }; lambda.removeLayerVersionPermission(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
LayerName
— (String
)The name or Amazon Resource Name (ARN) of the layer.
VersionNumber
— (Integer
)The version number.
StatementId
— (String
)The identifier that was specified when the statement was added.
RevisionId
— (String
)Only update the policy if the revision ID matches the ID specified. Use this option to avoid modifying a policy that has changed since you last read it.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
removePermission(params = {}, callback) ⇒ AWS.Request
Revokes function-use permission from an Amazon Web Servicesservice or another Amazon Web Services account. You can get the ID of the statement from the output of GetPolicy.
Service Reference:
Examples:
Calling the removePermission operation
var params = { FunctionName: 'STRING_VALUE', /* required */ StatementId: 'STRING_VALUE', /* required */ Qualifier: 'STRING_VALUE', RevisionId: 'STRING_VALUE' }; lambda.removePermission(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function
(name-only),my-function:v1
(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
StatementId
— (String
)Statement ID of the permission to remove.
Qualifier
— (String
)Specify a version or alias to remove permissions from a published version of the function.
RevisionId
— (String
)Update the policy only if the revision ID matches the ID that's specified. Use this option to avoid modifying a policy that has changed since you last read it.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
tagResource(params = {}, callback) ⇒ AWS.Request
Adds tags to a function.
Service Reference:
Examples:
Calling the tagResource operation
var params = { Resource: 'STRING_VALUE', /* required */ Tags: { /* required */ '<TagKey>': 'STRING_VALUE', /* '<TagKey>': ... */ } }; lambda.tagResource(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
Resource
— (String
)The function's Amazon Resource Name (ARN).
Tags
— (map<String>
)A list of tags to apply to the function.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
untagResource(params = {}, callback) ⇒ AWS.Request
Removes tags from a function.
Service Reference:
Examples:
Calling the untagResource operation
var params = { Resource: 'STRING_VALUE', /* required */ TagKeys: [ /* required */ 'STRING_VALUE', /* more items */ ] }; lambda.untagResource(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
Resource
— (String
)The function's Amazon Resource Name (ARN).
TagKeys
— (Array<String>
)A list of tag keys to remove from the function.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
updateAlias(params = {}, callback) ⇒ AWS.Request
Updates the configuration of a Lambda function alias.
Service Reference:
Examples:
Calling the updateAlias operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Name: 'STRING_VALUE', /* required */ Description: 'STRING_VALUE', FunctionVersion: 'STRING_VALUE', RevisionId: 'STRING_VALUE', RoutingConfig: { AdditionalVersionWeights: { '<AdditionalVersion>': 'NUMBER_VALUE', /* '<AdditionalVersion>': ... */ } } }; lambda.updateAlias(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Partial ARN -
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Name
— (String
)The name of the alias.
FunctionVersion
— (String
)The function version that the alias invokes.
Description
— (String
)A description of the alias.
RoutingConfig
— (map
)The routing configuration of the alias.
AdditionalVersionWeights
— (map<Float>
)The second version, and the percentage of traffic that's routed to it.
RevisionId
— (String
)Only update the alias if the revision ID matches the ID that's specified. Use this option to avoid modifying an alias that has changed since you last read it.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:AliasArn
— (String
)The Amazon Resource Name (ARN) of the alias.
Name
— (String
)The name of the alias.
FunctionVersion
— (String
)The function version that the alias invokes.
Description
— (String
)A description of the alias.
RoutingConfig
— (map
)The routing configuration of the alias.
AdditionalVersionWeights
— (map<Float>
)The second version, and the percentage of traffic that's routed to it.
RevisionId
— (String
)A unique identifier that changes when you update the alias.
-
(AWS.Response)
—
Returns:
updateCodeSigningConfig(params = {}, callback) ⇒ AWS.Request
Update the code signing configuration. Changes to the code signing configuration take effect the next time a user tries to deploy a code package to the function.
Service Reference:
Examples:
Calling the updateCodeSigningConfig operation
var params = { CodeSigningConfigArn: 'STRING_VALUE', /* required */ AllowedPublishers: { SigningProfileVersionArns: [ /* required */ 'STRING_VALUE', /* more items */ ] }, CodeSigningPolicies: { UntrustedArtifactOnDeployment: Warn | Enforce }, Description: 'STRING_VALUE' }; lambda.updateCodeSigningConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
CodeSigningConfigArn
— (String
)The The Amazon Resource Name (ARN) of the code signing configuration.
Description
— (String
)Descriptive name for this code signing configuration.
AllowedPublishers
— (map
)Signing profiles for this code signing configuration.
SigningProfileVersionArns
— required — (Array<String>
)The Amazon Resource Name (ARN) for each of the signing profiles. A signing profile defines a trusted user who can sign a code package.
CodeSigningPolicies
— (map
)The code signing policy.
UntrustedArtifactOnDeployment
— (String
)Code signing configuration policy for deployment validation failure. If you set the policy to
Enforce
, Lambda blocks the deployment request if signature validation checks fail. If you set the policy toWarn
, Lambda allows the deployment and creates a CloudWatch log.Default value:
Possible values include:Warn
"Warn"
"Enforce"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CodeSigningConfig
— (map
)The code signing configuration
CodeSigningConfigId
— required — (String
)Unique identifer for the Code signing configuration.
CodeSigningConfigArn
— required — (String
)The Amazon Resource Name (ARN) of the Code signing configuration.
Description
— (String
)Code signing configuration description.
AllowedPublishers
— required — (map
)List of allowed publishers.
SigningProfileVersionArns
— required — (Array<String>
)The Amazon Resource Name (ARN) for each of the signing profiles. A signing profile defines a trusted user who can sign a code package.
CodeSigningPolicies
— required — (map
)The code signing policy controls the validation failure action for signature mismatch or expiry.
UntrustedArtifactOnDeployment
— (String
)Code signing configuration policy for deployment validation failure. If you set the policy to
Enforce
, Lambda blocks the deployment request if signature validation checks fail. If you set the policy toWarn
, Lambda allows the deployment and creates a CloudWatch log.Default value:
Possible values include:Warn
"Warn"
"Enforce"
LastModified
— required — (String
)The date and time that the Code signing configuration was last modified, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
-
(AWS.Response)
—
Returns:
updateEventSourceMapping(params = {}, callback) ⇒ AWS.Request
Updates an event source mapping. You can change the function that Lambda invokes, or pause invocation and resume later from the same location.
For details about how to configure different event sources, see the following topics.
The following error handling options are available only for stream sources (DynamoDB and Kinesis):
-
BisectBatchOnFunctionError
– If the function returns an error, split the batch in two and retry. -
DestinationConfig
– Send discarded records to an Amazon SQS queue or Amazon SNS topic. -
MaximumRecordAgeInSeconds
– Discard records older than the specified age. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires -
MaximumRetryAttempts
– Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires. -
ParallelizationFactor
– Process multiple batches from each shard concurrently.
For information about which configuration parameters apply to each event source, see the following topics.
Service Reference:
Examples:
Calling the updateEventSourceMapping operation
var params = { UUID: 'STRING_VALUE', /* required */ BatchSize: 'NUMBER_VALUE', BisectBatchOnFunctionError: true || false, DestinationConfig: { OnFailure: { Destination: 'STRING_VALUE' }, OnSuccess: { Destination: 'STRING_VALUE' } }, DocumentDBEventSourceConfig: { CollectionName: 'STRING_VALUE', DatabaseName: 'STRING_VALUE', FullDocument: UpdateLookup | Default }, Enabled: true || false, FilterCriteria: { Filters: [ { Pattern: 'STRING_VALUE' }, /* more items */ ] }, FunctionName: 'STRING_VALUE', FunctionResponseTypes: [ ReportBatchItemFailures, /* more items */ ], KMSKeyArn: 'STRING_VALUE', MaximumBatchingWindowInSeconds: 'NUMBER_VALUE', MaximumRecordAgeInSeconds: 'NUMBER_VALUE', MaximumRetryAttempts: 'NUMBER_VALUE', ParallelizationFactor: 'NUMBER_VALUE', ScalingConfig: { MaximumConcurrency: 'NUMBER_VALUE' }, SourceAccessConfigurations: [ { Type: BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH | VIRTUAL_HOST | CLIENT_CERTIFICATE_TLS_AUTH | SERVER_ROOT_CA_CERTIFICATE, URI: 'STRING_VALUE' }, /* more items */ ], TumblingWindowInSeconds: 'NUMBER_VALUE' }; lambda.updateEventSourceMapping(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
UUID
— (String
)The identifier of the event source mapping.
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
MyFunction
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Version or Alias ARN –
arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD
. -
Partial ARN –
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.
-
Enabled
— (Boolean
)When true, the event source mapping is active. When false, Lambda pauses polling and invocation.
Default: True
BatchSize
— (Integer
)The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).
-
Amazon Kinesis – Default 100. Max 10,000.
-
Amazon DynamoDB Streams – Default 100. Max 10,000.
-
Amazon Simple Queue Service – Default 10. For standard queues the max is 10,000. For FIFO queues the max is 10.
-
Amazon Managed Streaming for Apache Kafka – Default 100. Max 10,000.
-
Self-managed Apache Kafka – Default 100. Max 10,000.
-
Amazon MQ (ActiveMQ and RabbitMQ) – Default 100. Max 10,000.
-
DocumentDB – Default 100. Max 10,000.
-
FilterCriteria
— (map
)An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see Lambda event filtering.
Filters
— (Array<map>
)A list of filters.
Pattern
— (String
)A filter pattern. For more information on the syntax of a filter pattern, see Filter rule syntax.
MaximumBatchingWindowInSeconds
— (Integer
)The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure
MaximumBatchingWindowInSeconds
to any value from 0 seconds to 300 seconds in increments of seconds.For Kinesis, DynamoDB, and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching window is 500 ms. Note that because you can only change
MaximumBatchingWindowInSeconds
in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it. To restore the default batching window, you must create a new event source mapping.Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, when you set
BatchSize
to a value greater than 10, you must setMaximumBatchingWindowInSeconds
to at least 1.DestinationConfig
— (map
)(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Kafka only) A configuration object that specifies the destination of an event after Lambda processes it.
OnSuccess
— (map
)The destination configuration for successful invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
OnFailure
— (map
)The destination configuration for failed invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
To retain records of asynchronous invocations, you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.
To retain records of failed invocations from Kinesis and DynamoDB event sources, you can configure an Amazon SNS topic or Amazon SQS queue as the destination.
To retain records of failed invocations from self-managed Kafka or Amazon MSK, you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.
MaximumRecordAgeInSeconds
— (Integer
)(Kinesis and DynamoDB Streams only) Discard records older than the specified age. The default value is infinite (-1).
BisectBatchOnFunctionError
— (Boolean
)(Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry.
MaximumRetryAttempts
— (Integer
)(Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires.
ParallelizationFactor
— (Integer
)(Kinesis and DynamoDB Streams only) The number of batches to process from each shard concurrently.
SourceAccessConfigurations
— (Array<map>
)An array of authentication protocols or VPC components required to secure your event source.
Type
— (String
)The type of authentication protocol, VPC components, or virtual host for your event source. For example:
"Type":"SASL_SCRAM_512_AUTH"
.-
BASIC_AUTH
– (Amazon MQ) The Secrets Manager secret that stores your broker credentials. -
BASIC_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers. -
VPC_SUBNET
– (Self-managed Apache Kafka) The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your self-managed Apache Kafka cluster. -
VPC_SECURITY_GROUP
– (Self-managed Apache Kafka) The VPC security group used to manage access to your self-managed Apache Kafka brokers. -
SASL_SCRAM_256_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your self-managed Apache Kafka brokers. -
SASL_SCRAM_512_AUTH
– (Amazon MSK, Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your self-managed Apache Kafka brokers. -
VIRTUAL_HOST
–- (RabbitMQ) The name of the virtual host in your RabbitMQ broker. Lambda uses this RabbitMQ host as the event source. This property cannot be specified in an UpdateEventSourceMapping API call. -
CLIENT_CERTIFICATE_TLS_AUTH
– (Amazon MSK, self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and private key password (optional) used for mutual TLS authentication of your MSK/Apache Kafka brokers. -
SERVER_ROOT_CA_CERTIFICATE
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the root CA certificate (X.509 PEM) used for TLS encryption of your Apache Kafka brokers.
"BASIC_AUTH"
"VPC_SUBNET"
"VPC_SECURITY_GROUP"
"SASL_SCRAM_512_AUTH"
"SASL_SCRAM_256_AUTH"
"VIRTUAL_HOST"
"CLIENT_CERTIFICATE_TLS_AUTH"
"SERVER_ROOT_CA_CERTIFICATE"
-
URI
— (String
)The value for your chosen configuration in
Type
. For example:"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"
.
TumblingWindowInSeconds
— (Integer
)(Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window.
FunctionResponseTypes
— (Array<String>
)(Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event source mapping.
ScalingConfig
— (map
)(Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring maximum concurrency for Amazon SQS event sources.
MaximumConcurrency
— (Integer
)Limits the number of concurrent instances that the Amazon SQS event source can invoke.
DocumentDBEventSourceConfig
— (map
)Specific configuration settings for a DocumentDB event source.
DatabaseName
— (String
)The name of the database to consume within the DocumentDB cluster.
CollectionName
— (String
)The name of the collection to consume within the database. If you do not specify a collection, Lambda consumes all collections.
FullDocument
— (String
)Determines what DocumentDB sends to your event stream during document update operations. If set to UpdateLookup, DocumentDB sends a delta describing the changes, along with a copy of the entire document. Otherwise, DocumentDB sends only a partial document that contains the changes.
Possible values include:"UpdateLookup"
"Default"
KMSKeyArn
— (String
)The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your function's filter criteria. By default, Lambda does not encrypt your filter criteria object. Specify this property to encrypt data using your own customer managed key.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UUID
— (String
)The identifier of the event source mapping.
StartingPosition
— (String
)The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Stream event sources.
Possible values include:AT_TIMESTAMP
is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed Apache Kafka."TRIM_HORIZON"
"LATEST"
"AT_TIMESTAMP"
StartingPositionTimestamp
— (Date
)With
StartingPosition
set toAT_TIMESTAMP
, the time from which to start reading.StartingPositionTimestamp
cannot be in the future.BatchSize
— (Integer
)The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).
Default value: Varies by service. For Amazon SQS, the default is 10. For all other services, the default is 100.
Related setting: When you set
BatchSize
to a value greater than 10, you must setMaximumBatchingWindowInSeconds
to at least 1.MaximumBatchingWindowInSeconds
— (Integer
)The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure
MaximumBatchingWindowInSeconds
to any value from 0 seconds to 300 seconds in increments of seconds.For streams and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching window is 500 ms. Note that because you can only change
MaximumBatchingWindowInSeconds
in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it. To restore the default batching window, you must create a new event source mapping.Related setting: For streams and Amazon SQS event sources, when you set
BatchSize
to a value greater than 10, you must setMaximumBatchingWindowInSeconds
to at least 1.ParallelizationFactor
— (Integer
)(Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.
EventSourceArn
— (String
)The Amazon Resource Name (ARN) of the event source.
FilterCriteria
— (map
)An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see Lambda event filtering.
If filter criteria is encrypted, this field shows up as
null
in the response of ListEventSourceMapping API calls. You can view this field in plaintext in the response of GetEventSourceMapping and DeleteEventSourceMapping calls if you havekms:Decrypt
permissions for the correct KMS key.Filters
— (Array<map>
)A list of filters.
Pattern
— (String
)A filter pattern. For more information on the syntax of a filter pattern, see Filter rule syntax.
FunctionArn
— (String
)The ARN of the Lambda function.
LastModified
— (Date
)The date that the event source mapping was last updated or that its state changed.
LastProcessingResult
— (String
)The result of the last Lambda invocation of your function.
State
— (String
)The state of the event source mapping. It can be one of the following:
Creating
,Enabling
,Enabled
,Disabling
,Disabled
,Updating
, orDeleting
.StateTransitionReason
— (String
)Indicates whether a user or Lambda made the last change to the event source mapping.
DestinationConfig
— (map
)(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka event sources only) A configuration object that specifies the destination of an event after Lambda processes it.
OnSuccess
— (map
)The destination configuration for successful invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
OnFailure
— (map
)The destination configuration for failed invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
To retain records of asynchronous invocations, you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.
To retain records of failed invocations from Kinesis and DynamoDB event sources, you can configure an Amazon SNS topic or Amazon SQS queue as the destination.
To retain records of failed invocations from self-managed Kafka or Amazon MSK, you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.
Topics
— (Array<String>
)The name of the Kafka topic.
Queues
— (Array<String>
)(Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
SourceAccessConfigurations
— (Array<map>
)An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
Type
— (String
)The type of authentication protocol, VPC components, or virtual host for your event source. For example:
"Type":"SASL_SCRAM_512_AUTH"
.-
BASIC_AUTH
– (Amazon MQ) The Secrets Manager secret that stores your broker credentials. -
BASIC_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers. -
VPC_SUBNET
– (Self-managed Apache Kafka) The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your self-managed Apache Kafka cluster. -
VPC_SECURITY_GROUP
– (Self-managed Apache Kafka) The VPC security group used to manage access to your self-managed Apache Kafka brokers. -
SASL_SCRAM_256_AUTH
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your self-managed Apache Kafka brokers. -
SASL_SCRAM_512_AUTH
– (Amazon MSK, Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your self-managed Apache Kafka brokers. -
VIRTUAL_HOST
–- (RabbitMQ) The name of the virtual host in your RabbitMQ broker. Lambda uses this RabbitMQ host as the event source. This property cannot be specified in an UpdateEventSourceMapping API call. -
CLIENT_CERTIFICATE_TLS_AUTH
– (Amazon MSK, self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and private key password (optional) used for mutual TLS authentication of your MSK/Apache Kafka brokers. -
SERVER_ROOT_CA_CERTIFICATE
– (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the root CA certificate (X.509 PEM) used for TLS encryption of your Apache Kafka brokers.
"BASIC_AUTH"
"VPC_SUBNET"
"VPC_SECURITY_GROUP"
"SASL_SCRAM_512_AUTH"
"SASL_SCRAM_256_AUTH"
"VIRTUAL_HOST"
"CLIENT_CERTIFICATE_TLS_AUTH"
"SERVER_ROOT_CA_CERTIFICATE"
-
URI
— (String
)The value for your chosen configuration in
Type
. For example:"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"
.
SelfManagedEventSource
— (map
)The self-managed Apache Kafka cluster for your event source.
Endpoints
— (map<Array<String>>
)The list of bootstrap servers for your Kafka brokers in the following format:
"KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]
.
MaximumRecordAgeInSeconds
— (Integer
)(Kinesis and DynamoDB Streams only) Discard records older than the specified age. The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records.
Note: The minimum valid value for maximum record age is 60s. Although values less than 60 and greater than -1 fall within the parameter's absolute range, they are not allowedBisectBatchOnFunctionError
— (Boolean
)(Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
MaximumRetryAttempts
— (Integer
)(Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. The default value is -1, which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.
TumblingWindowInSeconds
— (Integer
)(Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window.
FunctionResponseTypes
— (Array<String>
)(Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event source mapping.
AmazonManagedKafkaEventSourceConfig
— (map
)Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
ConsumerGroupId
— (String
)The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see Customizable consumer group ID.
SelfManagedKafkaEventSourceConfig
— (map
)Specific configuration settings for a self-managed Apache Kafka event source.
ConsumerGroupId
— (String
)The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see Customizable consumer group ID.
ScalingConfig
— (map
)(Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring maximum concurrency for Amazon SQS event sources.
MaximumConcurrency
— (Integer
)Limits the number of concurrent instances that the Amazon SQS event source can invoke.
DocumentDBEventSourceConfig
— (map
)Specific configuration settings for a DocumentDB event source.
DatabaseName
— (String
)The name of the database to consume within the DocumentDB cluster.
CollectionName
— (String
)The name of the collection to consume within the database. If you do not specify a collection, Lambda consumes all collections.
FullDocument
— (String
)Determines what DocumentDB sends to your event stream during document update operations. If set to UpdateLookup, DocumentDB sends a delta describing the changes, along with a copy of the entire document. Otherwise, DocumentDB sends only a partial document that contains the changes.
Possible values include:"UpdateLookup"
"Default"
KMSKeyArn
— (String
)The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your function's filter criteria.
FilterCriteriaError
— (map
)An object that contains details about an error related to filter criteria encryption.
ErrorCode
— (String
)The KMS exception that resulted from filter criteria encryption or decryption.
Message
— (String
)The error message.
-
(AWS.Response)
—
Returns:
updateFunctionCode(params = {}, callback) ⇒ AWS.Request
Updates a Lambda function's code. If code signing is enabled for the function, the code package must be signed by a trusted publisher. For more information, see Configuring code signing for Lambda.
If the function's package type is
Image
, then you must specify the code package inImageUri
as the URI of a container image in the Amazon ECR registry.If the function's package type is
Zip
, then you must specify the deployment package as a .zip file archive. Enter the Amazon S3 bucket and key of the code .zip file location. You can also provide the function code inline using theZipFile
field.The code in the deployment package must be compatible with the target instruction set architecture of the function (
x86-64
orarm64
).The function's code is locked when you publish a version. You can't modify the code of a published version, only the unpublished version.
Note: For a function defined as a container image, Lambda resolves the image tag to an image digest. In Amazon ECR, if you update the image tag to a new image, Lambda does not automatically update the function.Service Reference:
Examples:
Calling the updateFunctionCode operation
var params = { FunctionName: 'STRING_VALUE', /* required */ Architectures: [ x86_64 | arm64, /* more items */ ], DryRun: true || false, ImageUri: 'STRING_VALUE', Publish: true || false, RevisionId: 'STRING_VALUE', S3Bucket: 'STRING_VALUE', S3Key: 'STRING_VALUE', S3ObjectVersion: 'STRING_VALUE', ZipFile: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */ }; lambda.updateFunctionCode(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
ZipFile
— (Buffer, Typed Array, Blob, String
)The base64-encoded contents of the deployment package. Amazon Web Services SDK and CLI clients handle the encoding for you. Use only with a function defined with a .zip file archive deployment package.
S3Bucket
— (String
)An Amazon S3 bucket in the same Amazon Web Services Region as your function. The bucket can be in a different Amazon Web Services account. Use only with a function defined with a .zip file archive deployment package.
S3Key
— (String
)The Amazon S3 key of the deployment package. Use only with a function defined with a .zip file archive deployment package.
S3ObjectVersion
— (String
)For versioned objects, the version of the deployment package object to use.
ImageUri
— (String
)URI of a container image in the Amazon ECR registry. Do not use for a function defined with a .zip file archive.
Publish
— (Boolean
)Set to true to publish a new version of the function after updating the code. This has the same effect as calling PublishVersion separately.
DryRun
— (Boolean
)Set to true to validate the request parameters and access permissions without modifying the function code.
RevisionId
— (String
)Update the function only if the revision ID matches the ID that's specified. Use this option to avoid modifying a function that has changed since you last read it.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is
x86_64
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:FunctionName
— (String
)The name of the function.
FunctionArn
— (String
)The function's Amazon Resource Name (ARN).
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Role
— (String
)The function's execution role.
Handler
— (String
)The function that Lambda calls to begin running your function.
CodeSize
— (Integer
)The size of the function's deployment package, in bytes.
Description
— (String
)The function's description.
Timeout
— (Integer
)The amount of time in seconds that Lambda allows a function to run before stopping it.
MemorySize
— (Integer
)The amount of memory available to the function at runtime.
LastModified
— (String
)The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
CodeSha256
— (String
)The SHA256 hash of the function's deployment package.
Version
— (String
)The version of the Lambda function.
VpcConfig
— (map
)The function's networking configuration.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
VpcId
— (String
)The ID of the VPC.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
DeadLetterConfig
— (map
)The function's dead letter queue.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Environment
— (map
)The function's environment variables. Omitted from CloudTrail logs.
Variables
— (map<String>
)Environment variable key-value pairs. Omitted from CloudTrail logs.
Error
— (map
)Error messages for environment variables that couldn't be applied.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
KMSKeyArn
— (String
)The KMS key that's used to encrypt the function's environment variables. When Lambda SnapStart is activated, this key is also used to encrypt the function's snapshot. This key is returned only if you've configured a customer managed key.
TracingConfig
— (map
)The function's X-Ray tracing configuration.
Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
MasterArn
— (String
)For Lambda@Edge functions, the ARN of the main function.
RevisionId
— (String
)The latest updated revision of the function or alias.
Layers
— (Array<map>
)The function's layers.
Arn
— (String
)The Amazon Resource Name (ARN) of the function layer.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
State
— (String
)The current state of the function. When the state is
Possible values include:Inactive
, you can reactivate the function by invoking it."Pending"
"Active"
"Inactive"
"Failed"
StateReason
— (String
)The reason for the function's current state.
StateReasonCode
— (String
)The reason code for the function's current state. When the code is
Possible values include:Creating
, you can't invoke or modify the function."Idle"
"Creating"
"Restoring"
"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
LastUpdateStatus
— (String
)The status of the last update that was performed on the function. This is first set to
Possible values include:Successful
after function creation completes."Successful"
"Failed"
"InProgress"
LastUpdateStatusReason
— (String
)The reason for the last update that was performed on the function.
LastUpdateStatusReasonCode
— (String
)The reason code for the last update that was performed on the function.
Possible values include:"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
PackageType
— (String
)The type of deployment package. Set to
Possible values include:Image
for container image and setZip
for .zip file archive."Zip"
"Image"
ImageConfigResponse
— (map
)The function's image configuration values.
ImageConfig
— (map
)Configuration values that override the container image Dockerfile.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
Error
— (map
)Error response to
GetFunctionConfiguration
.ErrorCode
— (String
)Error code.
Message
— (String
)Error message.
SigningProfileVersionArn
— (String
)The ARN of the signing profile version.
SigningJobArn
— (String
)The ARN of the signing job.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is
x86_64
.EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)Set
ApplyOn
toPublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version. For more information, see Improving startup performance with Lambda SnapStart.ApplyOn
— (String
)When set to
Possible values include:PublishedVersions
, Lambda creates a snapshot of the execution environment when you publish a function version."PublishedVersions"
"None"
OptimizationStatus
— (String
)When you provide a qualified Amazon Resource Name (ARN), this response element indicates whether SnapStart is activated for the specified function version.
Possible values include:"On"
"Off"
RuntimeVersionConfig
— (map
)The ARN of the runtime and any errors that occured.
RuntimeVersionArn
— (String
)The ARN of the runtime version you want the function to use.
Error
— (map
)Error response when Lambda is unable to retrieve the runtime version for a function.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
-
(AWS.Response)
—
Returns:
updateFunctionConfiguration(params = {}, callback) ⇒ AWS.Request
Modify the version-specific settings of a Lambda function.
When you update a function, Lambda provisions an instance of the function and its supporting resources. If your function connects to a VPC, this process can take a minute. During this time, you can't modify the function, but you can still invoke it. The
LastUpdateStatus
,LastUpdateStatusReason
, andLastUpdateStatusReasonCode
fields in the response from GetFunctionConfiguration indicate when the update is complete and the function is processing events with the new configuration. For more information, see Lambda function states.These settings can vary between versions of a function and are locked when you publish a version. You can't modify the configuration of a published version, only the unpublished version.
To configure function concurrency, use PutFunctionConcurrency. To grant invoke permissions to an Amazon Web Services account or Amazon Web Servicesservice, use AddPermission.
Service Reference:
Examples:
Calling the updateFunctionConfiguration operation
var params = { FunctionName: 'STRING_VALUE', /* required */ DeadLetterConfig: { TargetArn: 'STRING_VALUE' }, Description: 'STRING_VALUE', Environment: { Variables: { '<EnvironmentVariableName>': 'STRING_VALUE', /* '<EnvironmentVariableName>': ... */ } }, EphemeralStorage: { Size: 'NUMBER_VALUE' /* required */ }, FileSystemConfigs: [ { Arn: 'STRING_VALUE', /* required */ LocalMountPath: 'STRING_VALUE' /* required */ }, /* more items */ ], Handler: 'STRING_VALUE', ImageConfig: { Command: [ 'STRING_VALUE', /* more items */ ], EntryPoint: [ 'STRING_VALUE', /* more items */ ], WorkingDirectory: 'STRING_VALUE' }, KMSKeyArn: 'STRING_VALUE', Layers: [ 'STRING_VALUE', /* more items */ ], LoggingConfig: { ApplicationLogLevel: TRACE | DEBUG | INFO | WARN | ERROR | FATAL, LogFormat: JSON | Text, LogGroup: 'STRING_VALUE', SystemLogLevel: DEBUG | INFO | WARN }, MemorySize: 'NUMBER_VALUE', RevisionId: 'STRING_VALUE', Role: 'STRING_VALUE', Runtime: nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | dotnet8 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2 | nodejs18.x | python3.10 | java17 | ruby3.2 | ruby3.3 | python3.11 | nodejs20.x | provided.al2023 | python3.12 | java21, SnapStart: { ApplyOn: PublishedVersions | None }, Timeout: 'NUMBER_VALUE', TracingConfig: { Mode: Active | PassThrough }, VpcConfig: { Ipv6AllowedForDualStack: true || false, SecurityGroupIds: [ 'STRING_VALUE', /* more items */ ], SubnetIds: [ 'STRING_VALUE', /* more items */ ] } }; lambda.updateFunctionConfiguration(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Role
— (String
)The Amazon Resource Name (ARN) of the function's execution role.
Handler
— (String
)The name of the method within your code that Lambda calls to run your function. Handler is required if the deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Lambda programming model.
Description
— (String
)A description of the function.
Timeout
— (Integer
)The amount of time (in seconds) that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds. For more information, see Lambda execution environment.
MemorySize
— (Integer
)The amount of memory available to the function at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB.
VpcConfig
— (map
)For network connectivity to Amazon Web Services resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can access resources and the internet only through that VPC. For more information, see Configuring a Lambda function to access resources in a VPC.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
Environment
— (map
)Environment variables that are accessible from function code during execution.
Variables
— (map<String>
)Environment variable key-value pairs. For more information, see Using Lambda environment variables.
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
DeadLetterConfig
— (map
)A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see Dead-letter queues.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
KMSKeyArn
— (String
)The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's environment variables. When Lambda SnapStart is activated, Lambda also uses this key is to encrypt your function's snapshot. If you deploy your function using a container image, Lambda also uses this key to encrypt your function when it's deployed. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). If you don't provide a customer managed key, Lambda uses a default service key.
TracingConfig
— (map
)Set
Mode
toActive
to sample and trace a subset of incoming requests with X-Ray.Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
RevisionId
— (String
)Update the function only if the revision ID matches the ID that's specified. Use this option to avoid modifying a function that has changed since you last read it.
Layers
— (Array<String>
)A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
ImageConfig
— (map
)Container image configuration values that override the values in the container image Docker file.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)The function's SnapStart setting.
ApplyOn
— (String
)Set to
Possible values include:PublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version."PublishedVersions"
"None"
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:FunctionName
— (String
)The name of the function.
FunctionArn
— (String
)The function's Amazon Resource Name (ARN).
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Role
— (String
)The function's execution role.
Handler
— (String
)The function that Lambda calls to begin running your function.
CodeSize
— (Integer
)The size of the function's deployment package, in bytes.
Description
— (String
)The function's description.
Timeout
— (Integer
)The amount of time in seconds that Lambda allows a function to run before stopping it.
MemorySize
— (Integer
)The amount of memory available to the function at runtime.
LastModified
— (String
)The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
CodeSha256
— (String
)The SHA256 hash of the function's deployment package.
Version
— (String
)The version of the Lambda function.
VpcConfig
— (map
)The function's networking configuration.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
VpcId
— (String
)The ID of the VPC.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
DeadLetterConfig
— (map
)The function's dead letter queue.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Environment
— (map
)The function's environment variables. Omitted from CloudTrail logs.
Variables
— (map<String>
)Environment variable key-value pairs. Omitted from CloudTrail logs.
Error
— (map
)Error messages for environment variables that couldn't be applied.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
KMSKeyArn
— (String
)The KMS key that's used to encrypt the function's environment variables. When Lambda SnapStart is activated, this key is also used to encrypt the function's snapshot. This key is returned only if you've configured a customer managed key.
TracingConfig
— (map
)The function's X-Ray tracing configuration.
Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
MasterArn
— (String
)For Lambda@Edge functions, the ARN of the main function.
RevisionId
— (String
)The latest updated revision of the function or alias.
Layers
— (Array<map>
)The function's layers.
Arn
— (String
)The Amazon Resource Name (ARN) of the function layer.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
State
— (String
)The current state of the function. When the state is
Possible values include:Inactive
, you can reactivate the function by invoking it."Pending"
"Active"
"Inactive"
"Failed"
StateReason
— (String
)The reason for the function's current state.
StateReasonCode
— (String
)The reason code for the function's current state. When the code is
Possible values include:Creating
, you can't invoke or modify the function."Idle"
"Creating"
"Restoring"
"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
LastUpdateStatus
— (String
)The status of the last update that was performed on the function. This is first set to
Possible values include:Successful
after function creation completes."Successful"
"Failed"
"InProgress"
LastUpdateStatusReason
— (String
)The reason for the last update that was performed on the function.
LastUpdateStatusReasonCode
— (String
)The reason code for the last update that was performed on the function.
Possible values include:"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
PackageType
— (String
)The type of deployment package. Set to
Possible values include:Image
for container image and setZip
for .zip file archive."Zip"
"Image"
ImageConfigResponse
— (map
)The function's image configuration values.
ImageConfig
— (map
)Configuration values that override the container image Dockerfile.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
Error
— (map
)Error response to
GetFunctionConfiguration
.ErrorCode
— (String
)Error code.
Message
— (String
)Error message.
SigningProfileVersionArn
— (String
)The ARN of the signing profile version.
SigningJobArn
— (String
)The ARN of the signing job.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is
x86_64
.EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)Set
ApplyOn
toPublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version. For more information, see Improving startup performance with Lambda SnapStart.ApplyOn
— (String
)When set to
Possible values include:PublishedVersions
, Lambda creates a snapshot of the execution environment when you publish a function version."PublishedVersions"
"None"
OptimizationStatus
— (String
)When you provide a qualified Amazon Resource Name (ARN), this response element indicates whether SnapStart is activated for the specified function version.
Possible values include:"On"
"Off"
RuntimeVersionConfig
— (map
)The ARN of the runtime and any errors that occured.
RuntimeVersionArn
— (String
)The ARN of the runtime version you want the function to use.
Error
— (map
)Error response when Lambda is unable to retrieve the runtime version for a function.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
-
(AWS.Response)
—
Returns:
updateFunctionEventInvokeConfig(params = {}, callback) ⇒ AWS.Request
Updates the configuration for asynchronous invocation for a function, version, or alias.
To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.
Service Reference:
Examples:
Calling the updateFunctionEventInvokeConfig operation
var params = { FunctionName: 'STRING_VALUE', /* required */ DestinationConfig: { OnFailure: { Destination: 'STRING_VALUE' }, OnSuccess: { Destination: 'STRING_VALUE' } }, MaximumEventAgeInSeconds: 'NUMBER_VALUE', MaximumRetryAttempts: 'NUMBER_VALUE', Qualifier: 'STRING_VALUE' }; lambda.updateFunctionEventInvokeConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name -
my-function
(name-only),my-function:v1
(with alias). -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN -
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)A version number or alias name.
MaximumRetryAttempts
— (Integer
)The maximum number of times to retry when the function returns an error.
MaximumEventAgeInSeconds
— (Integer
)The maximum age of a request that Lambda sends to a function for processing.
DestinationConfig
— (map
)A destination for events after they have been sent to a function for processing.
Destinations
-
Function - The Amazon Resource Name (ARN) of a Lambda function.
-
Queue - The ARN of a standard SQS queue.
-
Topic - The ARN of a standard SNS topic.
-
Event Bus - The ARN of an Amazon EventBridge event bus.
OnSuccess
— (map
)The destination configuration for successful invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
OnFailure
— (map
)The destination configuration for failed invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
To retain records of asynchronous invocations, you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.
To retain records of failed invocations from Kinesis and DynamoDB event sources, you can configure an Amazon SNS topic or Amazon SQS queue as the destination.
To retain records of failed invocations from self-managed Kafka or Amazon MSK, you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:LastModified
— (Date
)The date and time that the configuration was last updated.
FunctionArn
— (String
)The Amazon Resource Name (ARN) of the function.
MaximumRetryAttempts
— (Integer
)The maximum number of times to retry when the function returns an error.
MaximumEventAgeInSeconds
— (Integer
)The maximum age of a request that Lambda sends to a function for processing.
DestinationConfig
— (map
)A destination for events after they have been sent to a function for processing.
Destinations
-
Function - The Amazon Resource Name (ARN) of a Lambda function.
-
Queue - The ARN of a standard SQS queue.
-
Topic - The ARN of a standard SNS topic.
-
Event Bus - The ARN of an Amazon EventBridge event bus.
OnSuccess
— (map
)The destination configuration for successful invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
OnFailure
— (map
)The destination configuration for failed invocations.
Destination
— (String
)The Amazon Resource Name (ARN) of the destination resource.
To retain records of asynchronous invocations, you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.
To retain records of failed invocations from Kinesis and DynamoDB event sources, you can configure an Amazon SNS topic or Amazon SQS queue as the destination.
To retain records of failed invocations from self-managed Kafka or Amazon MSK, you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.
-
-
(AWS.Response)
—
Returns:
updateFunctionUrlConfig(params = {}, callback) ⇒ AWS.Request
Updates the configuration for a Lambda function URL.
Service Reference:
Examples:
Calling the updateFunctionUrlConfig operation
var params = { FunctionName: 'STRING_VALUE', /* required */ AuthType: NONE | AWS_IAM, Cors: { AllowCredentials: true || false, AllowHeaders: [ 'STRING_VALUE', /* more items */ ], AllowMethods: [ 'STRING_VALUE', /* more items */ ], AllowOrigins: [ 'STRING_VALUE', /* more items */ ], ExposeHeaders: [ 'STRING_VALUE', /* more items */ ], MaxAge: 'NUMBER_VALUE' }, InvokeMode: BUFFERED | RESPONSE_STREAM, Qualifier: 'STRING_VALUE' }; lambda.updateFunctionUrlConfig(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
(defaults to: {})
—
FunctionName
— (String
)The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function
. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)The alias name.
AuthType
— (String
)The type of authentication that your function URL uses. Set to
Possible values include:AWS_IAM
if you want to restrict access to authenticated users only. Set toNONE
if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs."NONE"
"AWS_IAM"
Cors
— (map
)The cross-origin resource sharing (CORS) settings for your function URL.
AllowCredentials
— (Boolean
)Whether to allow cookies or other credentials in requests to your function URL. The default is
false
.AllowHeaders
— (Array<String>
)The HTTP headers that origins can include in requests to your function URL. For example:
Date
,Keep-Alive
,X-Custom-Header
.AllowMethods
— (Array<String>
)The HTTP methods that are allowed when calling your function URL. For example:
GET
,POST
,DELETE
, or the wildcard character (*
).AllowOrigins
— (Array<String>
)The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example:
https://www.example.com
,http://localhost:60905
.Alternatively, you can grant access to all origins using the wildcard character (
*
).ExposeHeaders
— (Array<String>
)The HTTP headers in your function response that you want to expose to origins that call your function URL. For example:
Date
,Keep-Alive
,X-Custom-Header
.MaxAge
— (Integer
)The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to
0
, which means that the browser doesn't cache results.
InvokeMode
— (String
)Use one of the following options:
-
BUFFERED
– This is the default option. Lambda invokes your function using theInvoke
API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB. -
RESPONSE_STREAM
– Your function streams payload results as they become available. Lambda invokes your function using theInvokeWithResponseStream
API operation. The maximum response payload size is 20 MB, however, you can request a quota increase.
"BUFFERED"
"RESPONSE_STREAM"
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:FunctionUrl
— (String
)The HTTP URL endpoint for your function.
FunctionArn
— (String
)The Amazon Resource Name (ARN) of your function.
AuthType
— (String
)The type of authentication that your function URL uses. Set to
Possible values include:AWS_IAM
if you want to restrict access to authenticated users only. Set toNONE
if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs."NONE"
"AWS_IAM"
Cors
— (map
)The cross-origin resource sharing (CORS) settings for your function URL.
AllowCredentials
— (Boolean
)Whether to allow cookies or other credentials in requests to your function URL. The default is
false
.AllowHeaders
— (Array<String>
)The HTTP headers that origins can include in requests to your function URL. For example:
Date
,Keep-Alive
,X-Custom-Header
.AllowMethods
— (Array<String>
)The HTTP methods that are allowed when calling your function URL. For example:
GET
,POST
,DELETE
, or the wildcard character (*
).AllowOrigins
— (Array<String>
)The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example:
https://www.example.com
,http://localhost:60905
.Alternatively, you can grant access to all origins using the wildcard character (
*
).ExposeHeaders
— (Array<String>
)The HTTP headers in your function response that you want to expose to origins that call your function URL. For example:
Date
,Keep-Alive
,X-Custom-Header
.MaxAge
— (Integer
)The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to
0
, which means that the browser doesn't cache results.
CreationTime
— (String
)When the function URL was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
LastModifiedTime
— (String
)When the function URL configuration was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
InvokeMode
— (String
)Use one of the following options:
-
BUFFERED
– This is the default option. Lambda invokes your function using theInvoke
API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB. -
RESPONSE_STREAM
– Your function streams payload results as they become available. Lambda invokes your function using theInvokeWithResponseStream
API operation. The maximum response payload size is 20 MB, however, you can request a quota increase.
"BUFFERED"
"RESPONSE_STREAM"
-
-
(AWS.Response)
—
Returns:
waitFor(state, params = {}, callback) ⇒ AWS.Request
Waits for a given Lambda resource. The final callback or 'complete' event will be fired only when the resource is either in its final state or the waiter has timed out and stopped polling for the final state.
Examples:
Waiting for the functionExists state
var params = { FunctionName: 'STRING_VALUE', /* required */ }; lambda.waitFor('functionExists', params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
state
(String)
—
the resource state to wait for. Available states for this service are listed in "Waiter Resource States" below.
-
params
(map)
(defaults to: {})
—
a list of parameters for the given state. See each waiter resource state for required parameters.
Callback (callback):
-
function(err, data) { ... }
Callback containing error and data information. See the respective resource state for the expected error or data information.
If the waiter times out its requests, it will return a
ResourceNotReady
error.
Returns:
Waiter Resource States:
Waiter Resource Details
lambda.waitFor('functionExists', params = {}, [callback]) ⇒ AWS.Request
Waits for the
functionExists
state by periodically calling the underlying Lambda.getFunction() operation every 1 seconds (at most 20 times).Examples:
Waiting for the functionExists state
var params = { FunctionName: 'STRING_VALUE', /* required */ }; lambda.waitFor('functionExists', params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function
(name-only),my-function:v1
(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)Specify a version or alias to get details about a published version of the function.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Configuration
— (map
)The configuration of the function or version.
FunctionName
— (String
)The name of the function.
FunctionArn
— (String
)The function's Amazon Resource Name (ARN).
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Role
— (String
)The function's execution role.
Handler
— (String
)The function that Lambda calls to begin running your function.
CodeSize
— (Integer
)The size of the function's deployment package, in bytes.
Description
— (String
)The function's description.
Timeout
— (Integer
)The amount of time in seconds that Lambda allows a function to run before stopping it.
MemorySize
— (Integer
)The amount of memory available to the function at runtime.
LastModified
— (String
)The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
CodeSha256
— (String
)The SHA256 hash of the function's deployment package.
Version
— (String
)The version of the Lambda function.
VpcConfig
— (map
)The function's networking configuration.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
VpcId
— (String
)The ID of the VPC.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
DeadLetterConfig
— (map
)The function's dead letter queue.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Environment
— (map
)The function's environment variables. Omitted from CloudTrail logs.
Variables
— (map<String>
)Environment variable key-value pairs. Omitted from CloudTrail logs.
Error
— (map
)Error messages for environment variables that couldn't be applied.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
KMSKeyArn
— (String
)The KMS key that's used to encrypt the function's environment variables. When Lambda SnapStart is activated, this key is also used to encrypt the function's snapshot. This key is returned only if you've configured a customer managed key.
TracingConfig
— (map
)The function's X-Ray tracing configuration.
Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
MasterArn
— (String
)For Lambda@Edge functions, the ARN of the main function.
RevisionId
— (String
)The latest updated revision of the function or alias.
Layers
— (Array<map>
)The function's layers.
Arn
— (String
)The Amazon Resource Name (ARN) of the function layer.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
State
— (String
)The current state of the function. When the state is
Possible values include:Inactive
, you can reactivate the function by invoking it."Pending"
"Active"
"Inactive"
"Failed"
StateReason
— (String
)The reason for the function's current state.
StateReasonCode
— (String
)The reason code for the function's current state. When the code is
Possible values include:Creating
, you can't invoke or modify the function."Idle"
"Creating"
"Restoring"
"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
LastUpdateStatus
— (String
)The status of the last update that was performed on the function. This is first set to
Possible values include:Successful
after function creation completes."Successful"
"Failed"
"InProgress"
LastUpdateStatusReason
— (String
)The reason for the last update that was performed on the function.
LastUpdateStatusReasonCode
— (String
)The reason code for the last update that was performed on the function.
Possible values include:"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
PackageType
— (String
)The type of deployment package. Set to
Possible values include:Image
for container image and setZip
for .zip file archive."Zip"
"Image"
ImageConfigResponse
— (map
)The function's image configuration values.
ImageConfig
— (map
)Configuration values that override the container image Dockerfile.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
Error
— (map
)Error response to
GetFunctionConfiguration
.ErrorCode
— (String
)Error code.
Message
— (String
)Error message.
SigningProfileVersionArn
— (String
)The ARN of the signing profile version.
SigningJobArn
— (String
)The ARN of the signing job.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is
x86_64
.EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)Set
ApplyOn
toPublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version. For more information, see Improving startup performance with Lambda SnapStart.ApplyOn
— (String
)When set to
Possible values include:PublishedVersions
, Lambda creates a snapshot of the execution environment when you publish a function version."PublishedVersions"
"None"
OptimizationStatus
— (String
)When you provide a qualified Amazon Resource Name (ARN), this response element indicates whether SnapStart is activated for the specified function version.
Possible values include:"On"
"Off"
RuntimeVersionConfig
— (map
)The ARN of the runtime and any errors that occured.
RuntimeVersionArn
— (String
)The ARN of the runtime version you want the function to use.
Error
— (map
)Error response when Lambda is unable to retrieve the runtime version for a function.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
Code
— (map
)The deployment package of the function or version.
RepositoryType
— (String
)The service that's hosting the file.
Location
— (String
)A presigned URL that you can use to download the deployment package.
ImageUri
— (String
)URI of a container image in the Amazon ECR registry.
ResolvedImageUri
— (String
)The resolved URI for the image.
Tags
— (map<String>
)The function's tags.
Concurrency
— (map
)The function's reserved concurrency.
ReservedConcurrentExecutions
— (Integer
)The number of concurrent executions that are reserved for this function. For more information, see Managing Lambda reserved concurrency.
-
(AWS.Response)
—
Returns:
See Also:
lambda.waitFor('functionActive', params = {}, [callback]) ⇒ AWS.Request
Waits for the
functionActive
state by periodically calling the underlying Lambda.getFunctionConfiguration() operation every 5 seconds (at most 60 times).Examples:
Waiting for the functionActive state
var params = { FunctionName: 'STRING_VALUE', /* required */ }; lambda.waitFor('functionActive', params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function
(name-only),my-function:v1
(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)Specify a version or alias to get details about a published version of the function.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:FunctionName
— (String
)The name of the function.
FunctionArn
— (String
)The function's Amazon Resource Name (ARN).
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Role
— (String
)The function's execution role.
Handler
— (String
)The function that Lambda calls to begin running your function.
CodeSize
— (Integer
)The size of the function's deployment package, in bytes.
Description
— (String
)The function's description.
Timeout
— (Integer
)The amount of time in seconds that Lambda allows a function to run before stopping it.
MemorySize
— (Integer
)The amount of memory available to the function at runtime.
LastModified
— (String
)The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
CodeSha256
— (String
)The SHA256 hash of the function's deployment package.
Version
— (String
)The version of the Lambda function.
VpcConfig
— (map
)The function's networking configuration.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
VpcId
— (String
)The ID of the VPC.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
DeadLetterConfig
— (map
)The function's dead letter queue.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Environment
— (map
)The function's environment variables. Omitted from CloudTrail logs.
Variables
— (map<String>
)Environment variable key-value pairs. Omitted from CloudTrail logs.
Error
— (map
)Error messages for environment variables that couldn't be applied.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
KMSKeyArn
— (String
)The KMS key that's used to encrypt the function's environment variables. When Lambda SnapStart is activated, this key is also used to encrypt the function's snapshot. This key is returned only if you've configured a customer managed key.
TracingConfig
— (map
)The function's X-Ray tracing configuration.
Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
MasterArn
— (String
)For Lambda@Edge functions, the ARN of the main function.
RevisionId
— (String
)The latest updated revision of the function or alias.
Layers
— (Array<map>
)The function's layers.
Arn
— (String
)The Amazon Resource Name (ARN) of the function layer.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
State
— (String
)The current state of the function. When the state is
Possible values include:Inactive
, you can reactivate the function by invoking it."Pending"
"Active"
"Inactive"
"Failed"
StateReason
— (String
)The reason for the function's current state.
StateReasonCode
— (String
)The reason code for the function's current state. When the code is
Possible values include:Creating
, you can't invoke or modify the function."Idle"
"Creating"
"Restoring"
"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
LastUpdateStatus
— (String
)The status of the last update that was performed on the function. This is first set to
Possible values include:Successful
after function creation completes."Successful"
"Failed"
"InProgress"
LastUpdateStatusReason
— (String
)The reason for the last update that was performed on the function.
LastUpdateStatusReasonCode
— (String
)The reason code for the last update that was performed on the function.
Possible values include:"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
PackageType
— (String
)The type of deployment package. Set to
Possible values include:Image
for container image and setZip
for .zip file archive."Zip"
"Image"
ImageConfigResponse
— (map
)The function's image configuration values.
ImageConfig
— (map
)Configuration values that override the container image Dockerfile.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
Error
— (map
)Error response to
GetFunctionConfiguration
.ErrorCode
— (String
)Error code.
Message
— (String
)Error message.
SigningProfileVersionArn
— (String
)The ARN of the signing profile version.
SigningJobArn
— (String
)The ARN of the signing job.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is
x86_64
.EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)Set
ApplyOn
toPublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version. For more information, see Improving startup performance with Lambda SnapStart.ApplyOn
— (String
)When set to
Possible values include:PublishedVersions
, Lambda creates a snapshot of the execution environment when you publish a function version."PublishedVersions"
"None"
OptimizationStatus
— (String
)When you provide a qualified Amazon Resource Name (ARN), this response element indicates whether SnapStart is activated for the specified function version.
Possible values include:"On"
"Off"
RuntimeVersionConfig
— (map
)The ARN of the runtime and any errors that occured.
RuntimeVersionArn
— (String
)The ARN of the runtime version you want the function to use.
Error
— (map
)Error response when Lambda is unable to retrieve the runtime version for a function.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
-
(AWS.Response)
—
Returns:
See Also:
lambda.waitFor('functionUpdated', params = {}, [callback]) ⇒ AWS.Request
Waits for the
functionUpdated
state by periodically calling the underlying Lambda.getFunctionConfiguration() operation every 5 seconds (at most 60 times).Examples:
Waiting for the functionUpdated state
var params = { FunctionName: 'STRING_VALUE', /* required */ }; lambda.waitFor('functionUpdated', params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function
(name-only),my-function:v1
(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)Specify a version or alias to get details about a published version of the function.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:FunctionName
— (String
)The name of the function.
FunctionArn
— (String
)The function's Amazon Resource Name (ARN).
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Role
— (String
)The function's execution role.
Handler
— (String
)The function that Lambda calls to begin running your function.
CodeSize
— (Integer
)The size of the function's deployment package, in bytes.
Description
— (String
)The function's description.
Timeout
— (Integer
)The amount of time in seconds that Lambda allows a function to run before stopping it.
MemorySize
— (Integer
)The amount of memory available to the function at runtime.
LastModified
— (String
)The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
CodeSha256
— (String
)The SHA256 hash of the function's deployment package.
Version
— (String
)The version of the Lambda function.
VpcConfig
— (map
)The function's networking configuration.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
VpcId
— (String
)The ID of the VPC.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
DeadLetterConfig
— (map
)The function's dead letter queue.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Environment
— (map
)The function's environment variables. Omitted from CloudTrail logs.
Variables
— (map<String>
)Environment variable key-value pairs. Omitted from CloudTrail logs.
Error
— (map
)Error messages for environment variables that couldn't be applied.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
KMSKeyArn
— (String
)The KMS key that's used to encrypt the function's environment variables. When Lambda SnapStart is activated, this key is also used to encrypt the function's snapshot. This key is returned only if you've configured a customer managed key.
TracingConfig
— (map
)The function's X-Ray tracing configuration.
Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
MasterArn
— (String
)For Lambda@Edge functions, the ARN of the main function.
RevisionId
— (String
)The latest updated revision of the function or alias.
Layers
— (Array<map>
)The function's layers.
Arn
— (String
)The Amazon Resource Name (ARN) of the function layer.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
State
— (String
)The current state of the function. When the state is
Possible values include:Inactive
, you can reactivate the function by invoking it."Pending"
"Active"
"Inactive"
"Failed"
StateReason
— (String
)The reason for the function's current state.
StateReasonCode
— (String
)The reason code for the function's current state. When the code is
Possible values include:Creating
, you can't invoke or modify the function."Idle"
"Creating"
"Restoring"
"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
LastUpdateStatus
— (String
)The status of the last update that was performed on the function. This is first set to
Possible values include:Successful
after function creation completes."Successful"
"Failed"
"InProgress"
LastUpdateStatusReason
— (String
)The reason for the last update that was performed on the function.
LastUpdateStatusReasonCode
— (String
)The reason code for the last update that was performed on the function.
Possible values include:"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
PackageType
— (String
)The type of deployment package. Set to
Possible values include:Image
for container image and setZip
for .zip file archive."Zip"
"Image"
ImageConfigResponse
— (map
)The function's image configuration values.
ImageConfig
— (map
)Configuration values that override the container image Dockerfile.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
Error
— (map
)Error response to
GetFunctionConfiguration
.ErrorCode
— (String
)Error code.
Message
— (String
)Error message.
SigningProfileVersionArn
— (String
)The ARN of the signing profile version.
SigningJobArn
— (String
)The ARN of the signing job.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is
x86_64
.EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)Set
ApplyOn
toPublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version. For more information, see Improving startup performance with Lambda SnapStart.ApplyOn
— (String
)When set to
Possible values include:PublishedVersions
, Lambda creates a snapshot of the execution environment when you publish a function version."PublishedVersions"
"None"
OptimizationStatus
— (String
)When you provide a qualified Amazon Resource Name (ARN), this response element indicates whether SnapStart is activated for the specified function version.
Possible values include:"On"
"Off"
RuntimeVersionConfig
— (map
)The ARN of the runtime and any errors that occured.
RuntimeVersionArn
— (String
)The ARN of the runtime version you want the function to use.
Error
— (map
)Error response when Lambda is unable to retrieve the runtime version for a function.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
-
(AWS.Response)
—
Returns:
See Also:
lambda.waitFor('functionActiveV2', params = {}, [callback]) ⇒ AWS.Request
Waits for the
functionActiveV2
state by periodically calling the underlying Lambda.getFunction() operation every 1 seconds (at most 300 times).Examples:
Waiting for the functionActiveV2 state
var params = { FunctionName: 'STRING_VALUE', /* required */ }; lambda.waitFor('functionActiveV2', params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function
(name-only),my-function:v1
(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)Specify a version or alias to get details about a published version of the function.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Configuration
— (map
)The configuration of the function or version.
FunctionName
— (String
)The name of the function.
FunctionArn
— (String
)The function's Amazon Resource Name (ARN).
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Role
— (String
)The function's execution role.
Handler
— (String
)The function that Lambda calls to begin running your function.
CodeSize
— (Integer
)The size of the function's deployment package, in bytes.
Description
— (String
)The function's description.
Timeout
— (Integer
)The amount of time in seconds that Lambda allows a function to run before stopping it.
MemorySize
— (Integer
)The amount of memory available to the function at runtime.
LastModified
— (String
)The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
CodeSha256
— (String
)The SHA256 hash of the function's deployment package.
Version
— (String
)The version of the Lambda function.
VpcConfig
— (map
)The function's networking configuration.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
VpcId
— (String
)The ID of the VPC.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
DeadLetterConfig
— (map
)The function's dead letter queue.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Environment
— (map
)The function's environment variables. Omitted from CloudTrail logs.
Variables
— (map<String>
)Environment variable key-value pairs. Omitted from CloudTrail logs.
Error
— (map
)Error messages for environment variables that couldn't be applied.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
KMSKeyArn
— (String
)The KMS key that's used to encrypt the function's environment variables. When Lambda SnapStart is activated, this key is also used to encrypt the function's snapshot. This key is returned only if you've configured a customer managed key.
TracingConfig
— (map
)The function's X-Ray tracing configuration.
Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
MasterArn
— (String
)For Lambda@Edge functions, the ARN of the main function.
RevisionId
— (String
)The latest updated revision of the function or alias.
Layers
— (Array<map>
)The function's layers.
Arn
— (String
)The Amazon Resource Name (ARN) of the function layer.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
State
— (String
)The current state of the function. When the state is
Possible values include:Inactive
, you can reactivate the function by invoking it."Pending"
"Active"
"Inactive"
"Failed"
StateReason
— (String
)The reason for the function's current state.
StateReasonCode
— (String
)The reason code for the function's current state. When the code is
Possible values include:Creating
, you can't invoke or modify the function."Idle"
"Creating"
"Restoring"
"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
LastUpdateStatus
— (String
)The status of the last update that was performed on the function. This is first set to
Possible values include:Successful
after function creation completes."Successful"
"Failed"
"InProgress"
LastUpdateStatusReason
— (String
)The reason for the last update that was performed on the function.
LastUpdateStatusReasonCode
— (String
)The reason code for the last update that was performed on the function.
Possible values include:"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
PackageType
— (String
)The type of deployment package. Set to
Possible values include:Image
for container image and setZip
for .zip file archive."Zip"
"Image"
ImageConfigResponse
— (map
)The function's image configuration values.
ImageConfig
— (map
)Configuration values that override the container image Dockerfile.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
Error
— (map
)Error response to
GetFunctionConfiguration
.ErrorCode
— (String
)Error code.
Message
— (String
)Error message.
SigningProfileVersionArn
— (String
)The ARN of the signing profile version.
SigningJobArn
— (String
)The ARN of the signing job.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is
x86_64
.EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)Set
ApplyOn
toPublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version. For more information, see Improving startup performance with Lambda SnapStart.ApplyOn
— (String
)When set to
Possible values include:PublishedVersions
, Lambda creates a snapshot of the execution environment when you publish a function version."PublishedVersions"
"None"
OptimizationStatus
— (String
)When you provide a qualified Amazon Resource Name (ARN), this response element indicates whether SnapStart is activated for the specified function version.
Possible values include:"On"
"Off"
RuntimeVersionConfig
— (map
)The ARN of the runtime and any errors that occured.
RuntimeVersionArn
— (String
)The ARN of the runtime version you want the function to use.
Error
— (map
)Error response when Lambda is unable to retrieve the runtime version for a function.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
Code
— (map
)The deployment package of the function or version.
RepositoryType
— (String
)The service that's hosting the file.
Location
— (String
)A presigned URL that you can use to download the deployment package.
ImageUri
— (String
)URI of a container image in the Amazon ECR registry.
ResolvedImageUri
— (String
)The resolved URI for the image.
Tags
— (map<String>
)The function's tags.
Concurrency
— (map
)The function's reserved concurrency.
ReservedConcurrentExecutions
— (Integer
)The number of concurrent executions that are reserved for this function. For more information, see Managing Lambda reserved concurrency.
-
(AWS.Response)
—
Returns:
See Also:
lambda.waitFor('functionUpdatedV2', params = {}, [callback]) ⇒ AWS.Request
Waits for the
functionUpdatedV2
state by periodically calling the underlying Lambda.getFunction() operation every 1 seconds (at most 300 times).Examples:
Waiting for the functionUpdatedV2 state
var params = { FunctionName: 'STRING_VALUE', /* required */ }; lambda.waitFor('functionUpdatedV2', params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function
(name-only),my-function:v1
(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)Specify a version or alias to get details about a published version of the function.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Configuration
— (map
)The configuration of the function or version.
FunctionName
— (String
)The name of the function.
FunctionArn
— (String
)The function's Amazon Resource Name (ARN).
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Role
— (String
)The function's execution role.
Handler
— (String
)The function that Lambda calls to begin running your function.
CodeSize
— (Integer
)The size of the function's deployment package, in bytes.
Description
— (String
)The function's description.
Timeout
— (Integer
)The amount of time in seconds that Lambda allows a function to run before stopping it.
MemorySize
— (Integer
)The amount of memory available to the function at runtime.
LastModified
— (String
)The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
CodeSha256
— (String
)The SHA256 hash of the function's deployment package.
Version
— (String
)The version of the Lambda function.
VpcConfig
— (map
)The function's networking configuration.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
VpcId
— (String
)The ID of the VPC.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
DeadLetterConfig
— (map
)The function's dead letter queue.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Environment
— (map
)The function's environment variables. Omitted from CloudTrail logs.
Variables
— (map<String>
)Environment variable key-value pairs. Omitted from CloudTrail logs.
Error
— (map
)Error messages for environment variables that couldn't be applied.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
KMSKeyArn
— (String
)The KMS key that's used to encrypt the function's environment variables. When Lambda SnapStart is activated, this key is also used to encrypt the function's snapshot. This key is returned only if you've configured a customer managed key.
TracingConfig
— (map
)The function's X-Ray tracing configuration.
Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
MasterArn
— (String
)For Lambda@Edge functions, the ARN of the main function.
RevisionId
— (String
)The latest updated revision of the function or alias.
Layers
— (Array<map>
)The function's layers.
Arn
— (String
)The Amazon Resource Name (ARN) of the function layer.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
State
— (String
)The current state of the function. When the state is
Possible values include:Inactive
, you can reactivate the function by invoking it."Pending"
"Active"
"Inactive"
"Failed"
StateReason
— (String
)The reason for the function's current state.
StateReasonCode
— (String
)The reason code for the function's current state. When the code is
Possible values include:Creating
, you can't invoke or modify the function."Idle"
"Creating"
"Restoring"
"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
LastUpdateStatus
— (String
)The status of the last update that was performed on the function. This is first set to
Possible values include:Successful
after function creation completes."Successful"
"Failed"
"InProgress"
LastUpdateStatusReason
— (String
)The reason for the last update that was performed on the function.
LastUpdateStatusReasonCode
— (String
)The reason code for the last update that was performed on the function.
Possible values include:"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
PackageType
— (String
)The type of deployment package. Set to
Possible values include:Image
for container image and setZip
for .zip file archive."Zip"
"Image"
ImageConfigResponse
— (map
)The function's image configuration values.
ImageConfig
— (map
)Configuration values that override the container image Dockerfile.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
Error
— (map
)Error response to
GetFunctionConfiguration
.ErrorCode
— (String
)Error code.
Message
— (String
)Error message.
SigningProfileVersionArn
— (String
)The ARN of the signing profile version.
SigningJobArn
— (String
)The ARN of the signing job.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is
x86_64
.EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)Set
ApplyOn
toPublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version. For more information, see Improving startup performance with Lambda SnapStart.ApplyOn
— (String
)When set to
Possible values include:PublishedVersions
, Lambda creates a snapshot of the execution environment when you publish a function version."PublishedVersions"
"None"
OptimizationStatus
— (String
)When you provide a qualified Amazon Resource Name (ARN), this response element indicates whether SnapStart is activated for the specified function version.
Possible values include:"On"
"Off"
RuntimeVersionConfig
— (map
)The ARN of the runtime and any errors that occured.
RuntimeVersionArn
— (String
)The ARN of the runtime version you want the function to use.
Error
— (map
)Error response when Lambda is unable to retrieve the runtime version for a function.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
Code
— (map
)The deployment package of the function or version.
RepositoryType
— (String
)The service that's hosting the file.
Location
— (String
)A presigned URL that you can use to download the deployment package.
ImageUri
— (String
)URI of a container image in the Amazon ECR registry.
ResolvedImageUri
— (String
)The resolved URI for the image.
Tags
— (map<String>
)The function's tags.
Concurrency
— (map
)The function's reserved concurrency.
ReservedConcurrentExecutions
— (Integer
)The number of concurrent executions that are reserved for this function. For more information, see Managing Lambda reserved concurrency.
-
(AWS.Response)
—
Returns:
See Also:
lambda.waitFor('publishedVersionActive', params = {}, [callback]) ⇒ AWS.Request
Waits for the
publishedVersionActive
state by periodically calling the underlying Lambda.getFunctionConfiguration() operation every 5 seconds (at most 312 times).Examples:
Waiting for the publishedVersionActive state
var params = { FunctionName: 'STRING_VALUE', /* required */ }; lambda.waitFor('publishedVersionActive', params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });
Parameters:
-
params
(Object)
—
FunctionName
— (String
)The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function
(name-only),my-function:v1
(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN –
123456789012:function:my-function
.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
Qualifier
— (String
)Specify a version or alias to get details about a published version of the function.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:FunctionName
— (String
)The name of the function.
FunctionArn
— (String
)The function's Amazon Resource Name (ARN).
Runtime
— (String
)The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
Possible values include:"nodejs"
"nodejs4.3"
"nodejs6.10"
"nodejs8.10"
"nodejs10.x"
"nodejs12.x"
"nodejs14.x"
"nodejs16.x"
"java8"
"java8.al2"
"java11"
"python2.7"
"python3.6"
"python3.7"
"python3.8"
"python3.9"
"dotnetcore1.0"
"dotnetcore2.0"
"dotnetcore2.1"
"dotnetcore3.1"
"dotnet6"
"dotnet8"
"nodejs4.3-edge"
"go1.x"
"ruby2.5"
"ruby2.7"
"provided"
"provided.al2"
"nodejs18.x"
"python3.10"
"java17"
"ruby3.2"
"ruby3.3"
"python3.11"
"nodejs20.x"
"provided.al2023"
"python3.12"
"java21"
Role
— (String
)The function's execution role.
Handler
— (String
)The function that Lambda calls to begin running your function.
CodeSize
— (Integer
)The size of the function's deployment package, in bytes.
Description
— (String
)The function's description.
Timeout
— (Integer
)The amount of time in seconds that Lambda allows a function to run before stopping it.
MemorySize
— (Integer
)The amount of memory available to the function at runtime.
LastModified
— (String
)The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
CodeSha256
— (String
)The SHA256 hash of the function's deployment package.
Version
— (String
)The version of the Lambda function.
VpcConfig
— (map
)The function's networking configuration.
SubnetIds
— (Array<String>
)A list of VPC subnet IDs.
SecurityGroupIds
— (Array<String>
)A list of VPC security group IDs.
VpcId
— (String
)The ID of the VPC.
Ipv6AllowedForDualStack
— (Boolean
)Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
DeadLetterConfig
— (map
)The function's dead letter queue.
TargetArn
— (String
)The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Environment
— (map
)The function's environment variables. Omitted from CloudTrail logs.
Variables
— (map<String>
)Environment variable key-value pairs. Omitted from CloudTrail logs.
Error
— (map
)Error messages for environment variables that couldn't be applied.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
KMSKeyArn
— (String
)The KMS key that's used to encrypt the function's environment variables. When Lambda SnapStart is activated, this key is also used to encrypt the function's snapshot. This key is returned only if you've configured a customer managed key.
TracingConfig
— (map
)The function's X-Ray tracing configuration.
Mode
— (String
)The tracing mode.
Possible values include:"Active"
"PassThrough"
MasterArn
— (String
)For Lambda@Edge functions, the ARN of the main function.
RevisionId
— (String
)The latest updated revision of the function or alias.
Layers
— (Array<map>
)The function's layers.
Arn
— (String
)The Amazon Resource Name (ARN) of the function layer.
CodeSize
— (Integer
)The size of the layer archive in bytes.
SigningProfileVersionArn
— (String
)The Amazon Resource Name (ARN) for a signing profile version.
SigningJobArn
— (String
)The Amazon Resource Name (ARN) of a signing job.
State
— (String
)The current state of the function. When the state is
Possible values include:Inactive
, you can reactivate the function by invoking it."Pending"
"Active"
"Inactive"
"Failed"
StateReason
— (String
)The reason for the function's current state.
StateReasonCode
— (String
)The reason code for the function's current state. When the code is
Possible values include:Creating
, you can't invoke or modify the function."Idle"
"Creating"
"Restoring"
"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
LastUpdateStatus
— (String
)The status of the last update that was performed on the function. This is first set to
Possible values include:Successful
after function creation completes."Successful"
"Failed"
"InProgress"
LastUpdateStatusReason
— (String
)The reason for the last update that was performed on the function.
LastUpdateStatusReasonCode
— (String
)The reason code for the last update that was performed on the function.
Possible values include:"EniLimitExceeded"
"InsufficientRolePermissions"
"InvalidConfiguration"
"InternalError"
"SubnetOutOfIPAddresses"
"InvalidSubnet"
"InvalidSecurityGroup"
"ImageDeleted"
"ImageAccessDenied"
"InvalidImage"
"KMSKeyAccessDenied"
"KMSKeyNotFound"
"InvalidStateKMSKey"
"DisabledKMSKey"
"EFSIOError"
"EFSMountConnectivityError"
"EFSMountFailure"
"EFSMountTimeout"
"InvalidRuntime"
"InvalidZipFileException"
"FunctionError"
FileSystemConfigs
— (Array<map>
)Connection settings for an Amazon EFS file system.
Arn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.
LocalMountPath
— required — (String
)The path where the function can access the file system, starting with
/mnt/
.
PackageType
— (String
)The type of deployment package. Set to
Possible values include:Image
for container image and setZip
for .zip file archive."Zip"
"Image"
ImageConfigResponse
— (map
)The function's image configuration values.
ImageConfig
— (map
)Configuration values that override the container image Dockerfile.
EntryPoint
— (Array<String>
)Specifies the entry point to their application, which is typically the location of the runtime executable.
Command
— (Array<String>
)Specifies parameters that you want to pass in with ENTRYPOINT.
WorkingDirectory
— (String
)Specifies the working directory.
Error
— (map
)Error response to
GetFunctionConfiguration
.ErrorCode
— (String
)Error code.
Message
— (String
)Error message.
SigningProfileVersionArn
— (String
)The ARN of the signing profile version.
SigningJobArn
— (String
)The ARN of the signing job.
Architectures
— (Array<String>
)The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is
x86_64
.EphemeralStorage
— (map
)The size of the function's
/tmp
directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).Size
— required — (Integer
)The size of the function's
/tmp
directory.
SnapStart
— (map
)Set
ApplyOn
toPublishedVersions
to create a snapshot of the initialized execution environment when you publish a function version. For more information, see Improving startup performance with Lambda SnapStart.ApplyOn
— (String
)When set to
Possible values include:PublishedVersions
, Lambda creates a snapshot of the execution environment when you publish a function version."PublishedVersions"
"None"
OptimizationStatus
— (String
)When you provide a qualified Amazon Resource Name (ARN), this response element indicates whether SnapStart is activated for the specified function version.
Possible values include:"On"
"Off"
RuntimeVersionConfig
— (map
)The ARN of the runtime and any errors that occured.
RuntimeVersionArn
— (String
)The ARN of the runtime version you want the function to use.
Error
— (map
)Error response when Lambda is unable to retrieve the runtime version for a function.
ErrorCode
— (String
)The error code.
Message
— (String
)The error message.
LoggingConfig
— (map
)The function's Amazon CloudWatch Logs configuration settings.
LogFormat
— (String
)The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Possible values include:"JSON"
"Text"
ApplicationLogLevel
— (String
)Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where
Possible values include:TRACE
is the highest level andFATAL
is the lowest."TRACE"
"DEBUG"
"INFO"
"WARN"
"ERROR"
"FATAL"
SystemLogLevel
— (String
)Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where
Possible values include:DEBUG
is the highest level andWARN
is the lowest."DEBUG"
"INFO"
"WARN"
LogGroup
— (String
)The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named
/aws/lambda/<function name>
. To use a different log group, enter an existing log group or enter a new log group name.
-
(AWS.Response)
—
Returns:
See Also:
Generated on Fri Aug 30 18:31:54 2024 by yard 0.9.36 (ruby-2.5.1). - invokeWithResponseStream(params = {}, callback) ⇒ AWS.Request