Lambda class

This is the AWS Lambda API Reference. The AWS Lambda Developer Guide provides additional information. For the service overview, see What is AWS Lambda, and for information about how the service works, see AWS Lambda: How it Works in the AWS Lambda Developer Guide.

Constructors

Lambda({required String region, AwsClientCredentials? credentials, AwsClientCredentialsProvider? credentialsProvider, Client? client, String? endpointUrl})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addLayerVersionPermission({required String action, required String layerName, required String principal, required String statementId, required int versionNumber, String? organizationId, String? revisionId}) Future<AddLayerVersionPermissionResponse>
Adds permissions to the resource-based policy of a version of an AWS Lambda layer. Use this action to grant layer usage permission to other accounts. You can grant permission to a single account, all AWS accounts, or all accounts in an organization.
addPermission({required String action, required String functionName, required String principal, required String statementId, String? eventSourceToken, String? qualifier, String? revisionId, String? sourceAccount, String? sourceArn}) Future<AddPermissionResponse>
Grants an AWS service or another account 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.
close() → void
Closes the internal HTTP client if none was provided at creation. If a client was passed as a constructor argument, this becomes a noop.
createAlias({required String functionName, required String functionVersion, required String name, String? description, AliasRoutingConfiguration? routingConfig}) Future<AliasConfiguration>
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.
createCodeSigningConfig({required AllowedPublishers allowedPublishers, CodeSigningPolicies? codeSigningPolicies, String? description}) Future<CreateCodeSigningConfigResponse>
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).
createEventSourceMapping({required String functionName, int? batchSize, bool? bisectBatchOnFunctionError, DestinationConfig? destinationConfig, bool? enabled, String? eventSourceArn, List<FunctionResponseType>? functionResponseTypes, int? maximumBatchingWindowInSeconds, int? maximumRecordAgeInSeconds, int? maximumRetryAttempts, int? parallelizationFactor, List<String>? queues, SelfManagedEventSource? selfManagedEventSource, List<SourceAccessConfiguration>? sourceAccessConfigurations, EventSourcePosition? startingPosition, DateTime? startingPositionTimestamp, List<String>? topics, int? tumblingWindowInSeconds}) Future<EventSourceMappingConfiguration>
Creates a mapping between an event source and an AWS Lambda function. Lambda reads items from the event source and triggers the function.
createFunction({required FunctionCode code, required String functionName, required String role, String? codeSigningConfigArn, DeadLetterConfig? deadLetterConfig, String? description, Environment? environment, List<FileSystemConfig>? fileSystemConfigs, String? handler, ImageConfig? imageConfig, String? kMSKeyArn, List<String>? layers, int? memorySize, PackageType? packageType, bool? publish, Runtime? runtime, Map<String, String>? tags, int? timeout, TracingConfig? tracingConfig, VpcConfig? vpcConfig}) Future<FunctionConfiguration>
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 AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X-Ray for request tracing.
deleteAlias({required String functionName, required String name}) Future<void>
Deletes a Lambda function alias.
deleteCodeSigningConfig({required String codeSigningConfigArn}) Future<void>
Deletes the code signing configuration. You can delete the code signing configuration only if no function is using it.
deleteEventSourceMapping({required String uuid}) Future<EventSourceMappingConfiguration>
Deletes an event source mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.
deleteFunction({required String functionName, String? qualifier}) Future<void>
Deletes a Lambda function. To delete a specific function version, use the Qualifier parameter. Otherwise, all versions and aliases are deleted.
deleteFunctionCodeSigningConfig({required String functionName}) Future<void>
Removes the code signing configuration from the function.
deleteFunctionConcurrency({required String functionName}) Future<void>
Removes a concurrent execution limit from a function.
deleteFunctionEventInvokeConfig({required String functionName, String? qualifier}) Future<void>
Deletes the configuration for asynchronous invocation for a function, version, or alias.
deleteLayerVersion({required String layerName, required int versionNumber}) Future<void>
Deletes a version of an AWS 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.
deleteProvisionedConcurrencyConfig({required String functionName, required String qualifier}) Future<void>
Deletes the provisioned concurrency configuration for a function.
getAccountSettings() Future<GetAccountSettingsResponse>
Retrieves details about your account's limits and usage in an AWS Region.
getAlias({required String functionName, required String name}) Future<AliasConfiguration>
Returns details about a Lambda function alias.
getCodeSigningConfig({required String codeSigningConfigArn}) Future<GetCodeSigningConfigResponse>
Returns information about the specified code signing configuration.
getEventSourceMapping({required String uuid}) Future<EventSourceMappingConfiguration>
Returns details about an event source mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.
getFunction({required String functionName, String? qualifier}) Future<GetFunctionResponse>
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.
getFunctionCodeSigningConfig({required String functionName}) Future<GetFunctionCodeSigningConfigResponse>
Returns the code signing configuration for the specified function.
getFunctionConcurrency({required String functionName}) Future<GetFunctionConcurrencyResponse>
Returns details about the reserved concurrency configuration for a function. To set a concurrency limit for a function, use PutFunctionConcurrency.
getFunctionConfiguration({required String functionName, String? qualifier}) Future<FunctionConfiguration>
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.
getFunctionEventInvokeConfig({required String functionName, String? qualifier}) Future<FunctionEventInvokeConfig>
Retrieves the configuration for asynchronous invocation for a function, version, or alias.
getLayerVersion({required String layerName, required int versionNumber}) Future<GetLayerVersionResponse>
Returns information about a version of an AWS Lambda layer, with a link to download the layer archive that's valid for 10 minutes.
getLayerVersionByArn({required String arn}) Future<GetLayerVersionResponse>
Returns information about a version of an AWS Lambda layer, with a link to download the layer archive that's valid for 10 minutes.
getLayerVersionPolicy({required String layerName, required int versionNumber}) Future<GetLayerVersionPolicyResponse>
Returns the permission policy for a version of an AWS Lambda layer. For more information, see AddLayerVersionPermission.
getPolicy({required String functionName, String? qualifier}) Future<GetPolicyResponse>
Returns the resource-based IAM policy for a function, version, or alias.
getProvisionedConcurrencyConfig({required String functionName, required String qualifier}) Future<GetProvisionedConcurrencyConfigResponse>
Retrieves the provisioned concurrency configuration for a function's alias or version.
invoke({required String functionName, String? clientContext, InvocationType? invocationType, LogType? logType, Uint8List? payload, String? qualifier}) Future<InvocationResponse>
Invokes a Lambda function. You can invoke a function synchronously (and wait for the response), or asynchronously. To invoke a function asynchronously, set InvocationType to Event.
invokeAsync({required String functionName, required Uint8List invokeArgs}) Future<InvokeAsyncResponse>
May throw ServiceException. May throw ResourceNotFoundException. May throw InvalidRequestContentException. May throw InvalidRuntimeException. May throw ResourceConflictException.
listAliases({required String functionName, String? functionVersion, String? marker, int? maxItems}) Future<ListAliasesResponse>
Returns a list of aliases for a Lambda function.
listCodeSigningConfigs({String? marker, int? maxItems}) Future<ListCodeSigningConfigsResponse>
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.
listEventSourceMappings({String? eventSourceArn, String? functionName, String? marker, int? maxItems}) Future<ListEventSourceMappingsResponse>
Lists event source mappings. Specify an EventSourceArn to only show event source mappings for a single event source.
listFunctionEventInvokeConfigs({required String functionName, String? marker, int? maxItems}) Future<ListFunctionEventInvokeConfigsResponse>
Retrieves a list of configurations for asynchronous invocation for a function.
listFunctions({FunctionVersion? functionVersion, String? marker, String? masterRegion, int? maxItems}) Future<ListFunctionsResponse>
Returns a list of Lambda functions, with the version-specific configuration of each. Lambda returns up to 50 functions per call.
listFunctionsByCodeSigningConfig({required String codeSigningConfigArn, String? marker, int? maxItems}) Future<ListFunctionsByCodeSigningConfigResponse>
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.
listLayers({Runtime? compatibleRuntime, String? marker, int? maxItems}) Future<ListLayersResponse>
Lists AWS 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.
listLayerVersions({required String layerName, Runtime? compatibleRuntime, String? marker, int? maxItems}) Future<ListLayerVersionsResponse>
Lists the versions of an AWS 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.
listProvisionedConcurrencyConfigs({required String functionName, String? marker, int? maxItems}) Future<ListProvisionedConcurrencyConfigsResponse>
Retrieves a list of provisioned concurrency configurations for a function.
listTags({required String resource}) Future<ListTagsResponse>
Returns a function's tags. You can also view tags with GetFunction.
listVersionsByFunction({required String functionName, String? marker, int? maxItems}) Future<ListVersionsByFunctionResponse>
Returns a list of versions, with the version-specific configuration of each. Lambda returns up to 50 versions per call.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
publishLayerVersion({required LayerVersionContentInput content, required String layerName, List<Runtime>? compatibleRuntimes, String? description, String? licenseInfo}) Future<PublishLayerVersionResponse>
Creates an AWS Lambda layer from a ZIP archive. Each time you call PublishLayerVersion with the same layer name, a new version is created.
publishVersion({required String functionName, String? codeSha256, String? description, String? revisionId}) Future<FunctionConfiguration>
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.
putFunctionCodeSigningConfig({required String codeSigningConfigArn, required String functionName}) Future<PutFunctionCodeSigningConfigResponse>
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.
putFunctionConcurrency({required String functionName, required int reservedConcurrentExecutions}) Future<Concurrency>
Sets the maximum number of simultaneous executions for a function, and reserves capacity for that concurrency level.
putFunctionEventInvokeConfig({required String functionName, DestinationConfig? destinationConfig, int? maximumEventAgeInSeconds, int? maximumRetryAttempts, String? qualifier}) Future<FunctionEventInvokeConfig>
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.
putProvisionedConcurrencyConfig({required String functionName, required int provisionedConcurrentExecutions, required String qualifier}) Future<PutProvisionedConcurrencyConfigResponse>
Adds a provisioned concurrency configuration to a function's alias or version.
removeLayerVersionPermission({required String layerName, required String statementId, required int versionNumber, String? revisionId}) Future<void>
Removes a statement from the permissions policy for a version of an AWS Lambda layer. For more information, see AddLayerVersionPermission.
removePermission({required String functionName, required String statementId, String? qualifier, String? revisionId}) Future<void>
Revokes function-use permission from an AWS service or another account. You can get the ID of the statement from the output of GetPolicy.
tagResource({required String resource, required Map<String, String> tags}) Future<void>
Adds tags to a function.
toString() String
A string representation of this object.
inherited
untagResource({required String resource, required List<String> tagKeys}) Future<void>
Removes tags from a function.
updateAlias({required String functionName, required String name, String? description, String? functionVersion, String? revisionId, AliasRoutingConfiguration? routingConfig}) Future<AliasConfiguration>
Updates the configuration of a Lambda function alias.
updateCodeSigningConfig({required String codeSigningConfigArn, AllowedPublishers? allowedPublishers, CodeSigningPolicies? codeSigningPolicies, String? description}) Future<UpdateCodeSigningConfigResponse>
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.
updateEventSourceMapping({required String uuid, int? batchSize, bool? bisectBatchOnFunctionError, DestinationConfig? destinationConfig, bool? enabled, String? functionName, List<FunctionResponseType>? functionResponseTypes, int? maximumBatchingWindowInSeconds, int? maximumRecordAgeInSeconds, int? maximumRetryAttempts, int? parallelizationFactor, List<SourceAccessConfiguration>? sourceAccessConfigurations, int? tumblingWindowInSeconds}) Future<EventSourceMappingConfiguration>
Updates an event source mapping. You can change the function that AWS Lambda invokes, or pause invocation and resume later from the same location.
updateFunctionCode({required String functionName, bool? dryRun, String? imageUri, bool? publish, String? revisionId, String? s3Bucket, String? s3Key, String? s3ObjectVersion, Uint8List? zipFile}) Future<FunctionConfiguration>
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.
updateFunctionConfiguration({required String functionName, DeadLetterConfig? deadLetterConfig, String? description, Environment? environment, List<FileSystemConfig>? fileSystemConfigs, String? handler, ImageConfig? imageConfig, String? kMSKeyArn, List<String>? layers, int? memorySize, String? revisionId, String? role, Runtime? runtime, int? timeout, TracingConfig? tracingConfig, VpcConfig? vpcConfig}) Future<FunctionConfiguration>
Modify the version-specific settings of a Lambda function.
updateFunctionEventInvokeConfig({required String functionName, DestinationConfig? destinationConfig, int? maximumEventAgeInSeconds, int? maximumRetryAttempts, String? qualifier}) Future<FunctionEventInvokeConfig>
Updates the configuration for asynchronous invocation for a function, version, or alias.

Operators

operator ==(Object other) bool
The equality operator.
inherited