Lambda¶
Installation¶
To install the Lambda client:
Clients¶
The package provides a synchronous client, LambdaClient, and an asynchronous client, AsyncLambdaClient. Both clients use the same models.
Operations that use event streams are available only on AsyncLambdaClient. They are marked Async only under Operations.
LambdaClient
¶
LambdaClient(config: LambdaConfig | None = None, plugins: list[Plugin] | None = None)
Bases: Client[LambdaConfig]
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.
Lambda Event Functions, previously known as Lambda functions, run your
code in response to events and API calls. In the Lambda API, the Amazon
Web Services SDKs, and the CLI, Event Functions are still called
functions, for example in CreateFunction and Invoke. You don't
need to change any existing code.
The Lambda API Reference provides information about each of the API methods for Lambda Event Functions, 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.
AsyncLambdaClient
¶
AsyncLambdaClient(config: AsyncLambdaConfig | None = None, plugins: list[Plugin] | None = None)
Bases: AsyncClient[AsyncLambdaConfig]
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.
Lambda Event Functions, previously known as Lambda functions, run your
code in response to events and API calls. In the Lambda API, the Amazon
Web Services SDKs, and the CLI, Event Functions are still called
functions, for example in CreateFunction and Invoke. You don't
need to change any existing code.
The Lambda API Reference provides information about each of the API methods for Lambda Event Functions, 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.
Operations¶
add_layer_version_permissionadd_permissioncheckpoint_durable_executioncreate_aliascreate_capacity_providercreate_code_signing_configcreate_event_source_mappingcreate_functioncreate_function_url_configdelete_aliasdelete_capacity_providerdelete_code_signing_configdelete_event_source_mappingdelete_functiondelete_function_code_signing_configdelete_function_concurrencydelete_function_event_invoke_configdelete_function_url_configdelete_layer_versiondelete_provisioned_concurrency_configdelete_resource_policyget_account_settingsget_aliasget_capacity_providerget_code_signing_configget_durable_executionget_durable_execution_historyget_durable_execution_stateget_event_source_mappingget_functionget_function_code_signing_configget_function_concurrencyget_function_configurationget_function_event_invoke_configget_function_recursion_configget_function_scaling_configget_function_url_configget_layer_versionget_layer_version_by_arnget_layer_version_policyget_policyget_provisioned_concurrency_configget_resource_policyget_runtime_management_configinvokeinvoke_asyncinvoke_with_response_streamAsync onlylist_aliaseslist_capacity_providerslist_code_signing_configslist_durable_executions_by_functionlist_event_source_mappingslist_function_event_invoke_configslist_function_url_configslist_function_versions_by_capacity_providerlist_functionslist_functions_by_code_signing_configlist_layer_versionslist_layerslist_provisioned_concurrency_configslist_tagslist_versions_by_functionpublish_layer_versionpublish_versionput_function_code_signing_configput_function_concurrencyput_function_event_invoke_configput_function_recursion_configput_function_scaling_configput_provisioned_concurrency_configput_resource_policyput_runtime_management_configremove_layer_version_permissionremove_permissionsend_durable_execution_callback_failuresend_durable_execution_callback_heartbeatsend_durable_execution_callback_successstop_durable_executiontag_resourceuntag_resourceupdate_aliasupdate_capacity_providerupdate_code_signing_configupdate_event_source_mappingupdate_function_codeupdate_function_configurationupdate_function_event_invoke_configupdate_function_url_config
Configuration¶
LambdaConfig
dataclass
¶
Bases: AwsConfig
Lambda configuration.
Attributes¶
auth_scheme_resolver
class-attribute
instance-attribute
¶
An auth scheme resolver that determines the auth scheme for each operation.
auth_schemes
class-attribute
instance-attribute
¶
A map of auth scheme ids to auth schemes.
aws_access_key_id
class-attribute
instance-attribute
¶
aws_access_key_id: str | None = None
The identifier for a secret access key.
aws_credentials_identity_resolver
class-attribute
instance-attribute
¶
aws_credentials_identity_resolver: IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None = None
Resolves AWS Credentials. Required for operations that use Sigv4 Auth.
aws_secret_access_key
class-attribute
instance-attribute
¶
aws_secret_access_key: str | None = None
A secret access key that can be used to sign requests.
aws_session_token
class-attribute
instance-attribute
¶
aws_session_token: str | None = None
The session token used with temporary AWS credentials.
endpoint_resolver
class-attribute
instance-attribute
¶
The endpoint resolver used to resolve the final endpoint per-operation based on the configuration.
interceptors
class-attribute
instance-attribute
¶
The list of interceptors, which are hooks that are called during the execution of a request.
protocol
class-attribute
instance-attribute
¶
Pass a protocol class reference from smithy_aws_core.protocols to select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom protocols a protocol instance may also be passed.
region
class-attribute
instance-attribute
¶
region: str | None = None
The AWS region to connect to. The configured region is used to determine the service endpoint.
sdk_ua_app_id
class-attribute
instance-attribute
¶
sdk_ua_app_id: str | None = None
A unique and opaque application ID that is appended to the User-Agent header.
use_dualstack_endpoint
class-attribute
instance-attribute
¶
use_dualstack_endpoint: bool | None = None
When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
use_fips_endpoint
class-attribute
instance-attribute
¶
use_fips_endpoint: bool | None = None
When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
user_agent_extra
class-attribute
instance-attribute
¶
user_agent_extra: str | None = None
Additional suffix to be added to the User-Agent header.
Methods:¶
resolve
classmethod
¶
resolve(*, profile: str | None = None, fs: FileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_LambdaConfigOverrides]) -> Self
Resolve config from environment, config files, defaults, and explicit overrides.
Plugin
module-attribute
¶
Plugin: TypeAlias = Callable[[LambdaConfig], None]
A callable that customizes a client configuration. Service-level plugins are applied once to the base configuration inherited by every operation. Operation-level plugins apply only to a single operation invocation.
AsyncLambdaConfig
dataclass
¶
Bases: AsyncAwsConfig
Lambda configuration (async-resolved).
Attributes¶
auth_scheme_resolver
class-attribute
instance-attribute
¶
An auth scheme resolver that determines the auth scheme for each operation.
auth_schemes
class-attribute
instance-attribute
¶
A map of auth scheme ids to auth schemes.
aws_access_key_id
class-attribute
instance-attribute
¶
aws_access_key_id: str | None = None
The identifier for a secret access key.
aws_credentials_identity_resolver
class-attribute
instance-attribute
¶
aws_credentials_identity_resolver: AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None = None
Resolves AWS Credentials. Required for operations that use Sigv4 Auth.
aws_secret_access_key
class-attribute
instance-attribute
¶
aws_secret_access_key: str | None = None
A secret access key that can be used to sign requests.
aws_session_token
class-attribute
instance-attribute
¶
aws_session_token: str | None = None
The session token used with temporary AWS credentials.
endpoint_resolver
class-attribute
instance-attribute
¶
The endpoint resolver used to resolve the final endpoint per-operation based on the configuration.
interceptors
class-attribute
instance-attribute
¶
The list of interceptors, which are hooks that are called during the execution of a request.
protocol
class-attribute
instance-attribute
¶
Pass a protocol class reference from smithy_aws_core.aio.protocols to select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For custom protocols a protocol instance may also be passed.
region
class-attribute
instance-attribute
¶
region: str | None = None
The AWS region to connect to. The configured region is used to determine the service endpoint.
sdk_ua_app_id
class-attribute
instance-attribute
¶
sdk_ua_app_id: str | None = None
A unique and opaque application ID that is appended to the User-Agent header.
use_dualstack_endpoint
class-attribute
instance-attribute
¶
use_dualstack_endpoint: bool | None = None
When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
use_fips_endpoint
class-attribute
instance-attribute
¶
use_fips_endpoint: bool | None = None
When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
user_agent_extra
class-attribute
instance-attribute
¶
user_agent_extra: str | None = None
Additional suffix to be added to the User-Agent header.
Methods:¶
resolve
async
classmethod
¶
resolve(*, profile: str | None = None, fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncLambdaConfigOverrides]) -> Self
Resolve config from environment, config files, defaults, and explicit overrides.
Plugin
module-attribute
¶
Plugin: TypeAlias = Callable[[AsyncLambdaConfig], None]
A callable that customizes a client configuration. Service-level plugins are applied once to the base configuration inherited by every operation. Operation-level plugins apply only to a single operation invocation.
Structures¶
AccountLimitAccountUsageAliasConfigurationAliasRoutingConfigurationAllowedPublishersAmazonManagedKafkaEventSourceConfigCallbackDetailsCallbackFailedDetailsCallbackOptionsCallbackStartedDetailsCallbackSucceededDetailsCallbackTimedOutDetailsCapacityProviderCapacityProviderConfigCapacityProviderLoggingConfigCapacityProviderPermissionsConfigCapacityProviderScalingConfigCapacityProviderTelemetryConfigCapacityProviderVpcConfigChainedInvokeDetailsChainedInvokeFailedDetailsChainedInvokeOptionsChainedInvokeStartedDetailsChainedInvokeStoppedDetailsChainedInvokeSucceededDetailsChainedInvokeTimedOutDetailsCheckpointUpdatedExecutionStateCodeSigningConfigCodeSigningPoliciesConcurrencyContextDetailsContextFailedDetailsContextOptionsContextStartedDetailsContextSucceededDetailsCorsDeadLetterConfigDestinationConfigDocumentDBEventSourceConfigDurableConfigEnvironmentEnvironmentErrorEnvironmentResponseEphemeralStorageErrorObjectEventEventErrorEventInputEventResultEventSourceMappingConfigurationEventSourceMappingLoggingConfigEventSourceMappingMetricsConfigExecutionExecutionDetailsExecutionFailedDetailsExecutionStartedDetailsExecutionStoppedDetailsExecutionSucceededDetailsExecutionTimedOutDetailsFileSystemConfigFilterFilterCriteriaFilterCriteriaErrorFunctionCodeFunctionCodeLocationFunctionCodeLocationErrorFunctionConfigurationFunctionEventInvokeConfigFunctionRuntimeConfigFunctionScalingConfigFunctionUrlConfigFunctionVersionsByCapacityProviderListItemImageConfigImageConfigErrorImageConfigResponseInstanceRequirementsInvocationCompletedDetailsInvokeResponseStreamUpdateInvokeWithResponseStreamCompleteEventKafkaSchemaRegistryAccessConfigKafkaSchemaRegistryConfigKafkaSchemaValidationConfigLambdaManagedInstancesCapacityProviderConfigLayerLayerVersionContentInputLayerVersionContentOutputLayerVersionsListItemLayersListItemLoggingConfigOnFailureOnSuccessOperationOperationUpdatePropagateTagsProvisionedConcurrencyConfigListItemProvisionedPollerConfigResolvedS3ObjectRetryDetailsRuntimeVersionConfigRuntimeVersionErrorS3FilesConfigScalingConfigSelfManagedEventSourceSelfManagedKafkaEventSourceConfigSnapStartSnapStartResponseSourceAccessConfigurationStepDetailsStepFailedDetailsStepOptionsStepStartedDetailsStepSucceededDetailsTagsErrorTargetTrackingScalingPolicyTenancyConfigTraceHeaderTracingConfigTracingConfigResponseVpcConfigVpcConfigResponseWaitCancelledDetailsWaitDetailsWaitOptionsWaitStartedDetailsWaitSucceededDetails
Dictionaries¶
AliasRoutingConfigurationDictAllowedPublishersDictAmazonManagedKafkaEventSourceConfigDictCallbackOptionsDictCapacityProviderConfigDictCapacityProviderLoggingConfigDictCapacityProviderPermissionsConfigDictCapacityProviderScalingConfigDictCapacityProviderTelemetryConfigDictCapacityProviderVpcConfigDictChainedInvokeOptionsDictCodeSigningPoliciesDictContextOptionsDictCorsDictDeadLetterConfigDictDestinationConfigDictDocumentDBEventSourceConfigDictDurableConfigDictEnvironmentDictEphemeralStorageDictErrorObjectDictEventSourceMappingLoggingConfigDictEventSourceMappingMetricsConfigDictFileSystemConfigDictFilterCriteriaDictFilterDictFunctionCodeDictFunctionRuntimeConfigDictFunctionScalingConfigDictImageConfigDictInstanceRequirementsDictKafkaSchemaRegistryAccessConfigDictKafkaSchemaRegistryConfigDictKafkaSchemaValidationConfigDictLambdaManagedInstancesCapacityProviderConfigDictLayerVersionContentInputDictLoggingConfigDictOnFailureDictOnSuccessDictOperationUpdateDictPropagateTagsDictProvisionedPollerConfigDictS3FilesConfigDictScalingConfigDictSelfManagedEventSourceDictSelfManagedKafkaEventSourceConfigDictSnapStartDictSourceAccessConfigurationDictStepOptionsDictTargetTrackingScalingPolicyDictTenancyConfigDictTracingConfigDictVpcConfigDictWaitOptionsDict
Errors¶
AliasLimitExceededExceptionCallbackTimeoutExceptionCapacityProviderLimitExceededExceptionCodeArtifactUserDeletedExceptionCodeArtifactUserFailedExceptionCodeArtifactUserPendingExceptionCodeSigningConfigNotFoundExceptionCodeStorageExceededExceptionCodeVerificationFailedExceptionDurableExecutionAlreadyStartedExceptionEC2AccessDeniedExceptionEC2ThrottledExceptionEC2UnexpectedExceptionEFSIOExceptionEFSMountConnectivityExceptionEFSMountFailureExceptionEFSMountTimeoutExceptionENILimitReachedExceptionENINotReadyExceptionFunctionVersionsPerCapacityProviderLimitExceededExceptionInvalidCodeSignatureExceptionInvalidParameterValueExceptionInvalidRequestContentExceptionInvalidRuntimeExceptionInvalidSecurityGroupIDExceptionInvalidSubnetIDExceptionInvalidZipFileExceptionKMSAccessDeniedExceptionKMSDisabledExceptionKMSInvalidStateExceptionKMSNotFoundExceptionModeNotSupportedExceptionNoPublishedVersionExceptionPolicyLengthExceededExceptionPreconditionFailedExceptionProvisionedConcurrencyConfigNotFoundExceptionPublicPolicyExceptionRecursiveInvocationExceptionRequestTooLargeExceptionResourceConflictExceptionResourceInUseExceptionResourceNotFoundExceptionResourceNotReadyExceptionRuntimeAliasDeletedExceptionRuntimeVersionDeletedExceptionS3FilesMountConnectivityExceptionS3FilesMountFailureExceptionS3FilesMountTimeoutExceptionSerializedRequestEntityTooLargeExceptionServiceErrorServiceExceptionServiceQuotaExceededExceptionSnapStartExceptionSnapStartNotReadyExceptionSnapStartRegenerationFailureExceptionSnapStartTimeoutExceptionSubnetIPAddressLimitReachedExceptionTooManyRequestsExceptionUnsupportedMediaTypeException
Unions¶
Enums¶
ApplicationLogLevelArchitectureCapacityProviderPredefinedMetricTypeCapacityProviderScalingModeCapacityProviderStateCodeSigningPolicyDirectS3ReadEndPointTypeEventSourceMappingMetricEventSourceMappingSystemLogLevelEventSourcePositionEventTypeExecutionStatusFullDocumentFunctionResponseTypeFunctionUrlAuthTypeFunctionVersionFunctionVersionLatestPublishedInvocationTypeInvokeModeKafkaEventSourceMappingConsumptionModeKafkaSchemaRegistryAuthTypeKafkaSchemaValidationAttributeLastUpdateStatusLastUpdateStatusReasonCodeLogFormatLogTypeOperationActionOperationStatusOperationTypePackageTypePropagateTagsModeProvisionedConcurrencyStatusEnumRecursiveLoopResponseStreamingInvocationTypeRuntimeS3ObjectStorageModeSchemaRegistryEventRecordFormatSnapStartApplyOnSnapStartOptimizationStatusSourceAccessTypeStateStateReasonCodeSystemLogLevelTenantIsolationModeThrottleReasonTracingModeUpdateRuntimeOn