Skip to content

Lambda

Client

AsyncLambdaClient

AsyncLambdaClient(config: Config | None = None, plugins: list[Plugin] | None = None)

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.

Parameters:

Name Type Description Default
config Config | None

Optional configuration for the client. Here you can set things like the endpoint for HTTP services or auth credentials.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. These can be used to set defaults, for example.

None

Operations

Configuration

Config dataclass

Config(*, auth_scheme_resolver: HTTPAuthSchemeResolver | None = None, auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None, aws_access_key_id: str | None = None, aws_credentials_identity_resolver: IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None = None, aws_secret_access_key: str | None = None, aws_session_token: str | None = None, endpoint_resolver: EndpointResolver | None = None, endpoint_uri: str | URI | None = None, http_request_config: HTTPRequestConfiguration | None = None, interceptors: list[_ServiceInterceptor] | None = None, protocol: ClientProtocol[Any, Any] | None = None, region: str | None = None, retry_strategy: RetryStrategy | RetryStrategyOptions | None = None, sdk_ua_app_id: str | None = None, transport: ClientTransport[Any, Any] | None = None, user_agent_extra: str | None = None)

Configuration for Lambda.

Attributes

auth_scheme_resolver instance-attribute
auth_scheme_resolver: HTTPAuthSchemeResolver = auth_scheme_resolver or HTTPAuthSchemeResolver()

An auth scheme resolver that determines the auth scheme for each operation.

auth_schemes instance-attribute
auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] = auth_schemes or {ShapeID('aws.auth#sigv4'): SigV4AuthScheme(service='lambda')}

A map of auth scheme ids to auth schemes.

aws_access_key_id instance-attribute
aws_access_key_id: str | None = aws_access_key_id

The identifier for a secret access key.

aws_credentials_identity_resolver instance-attribute
aws_credentials_identity_resolver: IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None = aws_credentials_identity_resolver

Resolves AWS Credentials. Required for operations that use Sigv4 Auth.

aws_secret_access_key instance-attribute
aws_secret_access_key: str | None = aws_secret_access_key

A secret access key that can be used to sign requests.

aws_session_token instance-attribute
aws_session_token: str | None = aws_session_token

An access key ID that identifies temporary security credentials.

endpoint_resolver instance-attribute
endpoint_resolver: EndpointResolver = endpoint_resolver or StandardRegionalEndpointsResolver(endpoint_prefix='lambda')

The endpoint resolver used to resolve the final endpoint per-operation based on the configuration.

endpoint_uri instance-attribute
endpoint_uri: str | URI | None = endpoint_uri

A static URI to route requests to.

http_request_config instance-attribute
http_request_config: HTTPRequestConfiguration | None = http_request_config

Configuration for individual HTTP requests.

interceptors instance-attribute
interceptors: list[_ServiceInterceptor] = interceptors or []

The list of interceptors, which are hooks that are called during the execution of a request.

protocol instance-attribute
protocol: ClientProtocol[Any, Any] | None = protocol or RestJsonClientProtocol(_SCHEMA_AWS_GIR_API_SERVICE)

The protocol to serialize and deserialize requests with.

region instance-attribute
region: str | None = region

The AWS region to connect to. The configured region is used to determine the service endpoint.

retry_strategy instance-attribute
retry_strategy: RetryStrategy | RetryStrategyOptions | None = retry_strategy

The retry strategy or options for configuring retry behavior. Can be either a configured RetryStrategy or RetryStrategyOptions to create one.

sdk_ua_app_id instance-attribute
sdk_ua_app_id: str | None = sdk_ua_app_id

A unique and opaque application ID that is appended to the User-Agent header.

transport instance-attribute
transport: ClientTransport[Any, Any] | None = transport or AWSCRTHTTPClient()

The transport to use to send requests (e.g. an HTTP client).

user_agent_extra instance-attribute
user_agent_extra: str | None = user_agent_extra

Additional suffix to be added to the User-Agent header.

Methods:

set_auth_scheme
set_auth_scheme(scheme: AuthScheme[Any, Any, Any, Any]) -> None

Sets the implementation of an auth scheme.

Using this method ensures the correct key is used.

Parameters:

Name Type Description Default
scheme AuthScheme[Any, Any, Any, Any]

The auth scheme to add.

required

Plugin module-attribute

Plugin: TypeAlias = Callable[[Config], None]

A callable that allows customizing the config object on each request.

Structures

Errors

Unions

Enums