2017/05/04 - AWS Lambda - 1 updated api methods
Changes Support for UpdateFunctionCode DryRun option
{'DryRun': 'boolean'}
Updates the code for the specified Lambda function. This operation must only be used on an existing Lambda function and cannot be used to update the function configuration.
If you are using the versioning feature, note this API will always update the $LATEST version of your Lambda function. For information about the versioning feature, see AWS Lambda Function Versioning and Aliases .
This operation requires permission for the lambda:UpdateFunctionCode action.
See also: AWS API Documentation
Request Syntax
client.update_function_code( FunctionName='string', ZipFile=b'bytes', S3Bucket='string', S3Key='string', S3ObjectVersion='string', Publish=True|False, DryRun=True|False )
string
[REQUIRED]
The existing Lambda function name whose code you want to replace.
You can specify a function name (for example, Thumbnail ) or you can specify Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail ). AWS Lambda also allows you to specify a partial ARN (for example, account-id:Thumbnail ). Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 characters in length.
bytes
The contents of your zip file containing your deployment package. If you are using the web API directly, the contents of the zip file must be base64-encoded. If you are using the AWS SDKs or the AWS CLI, the SDKs or CLI will do the encoding for you. For more information about creating a .zip file, see Execution Permissions in the AWS Lambda Developer Guide .
string
Amazon S3 bucket name where the .zip file containing your deployment package is stored. This bucket must reside in the same AWS Region where you are creating the Lambda function.
string
The Amazon S3 object (the deployment package) key name you want to upload.
string
The Amazon S3 object (the deployment package) version you want to upload.
boolean
This boolean parameter can be used to request AWS Lambda to update the Lambda function and publish a version as an atomic operation.
boolean
This boolean parameter can be used to test your request to AWS Lambda to update the Lambda function and publish a version as an atomic operation. It will do all necessary computation and validation of your code but will not upload it or a publish a version. Each time this operation is invoked, the CodeSha256 hash value the provided code will also be computed and returned in the response.
dict
Response Syntax
{ 'FunctionName': 'string', 'FunctionArn': 'string', 'Runtime': 'nodejs'|'nodejs4.3'|'nodejs6.10'|'java8'|'python2.7'|'python3.6'|'dotnetcore1.0'|'nodejs4.3-edge', 'Role': 'string', 'Handler': 'string', 'CodeSize': 123, 'Description': 'string', 'Timeout': 123, 'MemorySize': 123, 'LastModified': 'string', 'CodeSha256': 'string', 'Version': 'string', 'VpcConfig': { 'SubnetIds': [ 'string', ], 'SecurityGroupIds': [ 'string', ], 'VpcId': 'string' }, 'DeadLetterConfig': { 'TargetArn': 'string' }, 'Environment': { 'Variables': { 'string': 'string' }, 'Error': { 'ErrorCode': 'string', 'Message': 'string' } }, 'KMSKeyArn': 'string', 'TracingConfig': { 'Mode': 'Active'|'PassThrough' } }
Response Structure
(dict) --
A complex type that describes function metadata.
FunctionName (string) --
The name of the function. Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 characters in length.
FunctionArn (string) --
The Amazon Resource Name (ARN) assigned to the function.
Runtime (string) --
The runtime environment for the Lambda function.
Role (string) --
The Amazon Resource Name (ARN) of the IAM role that Lambda assumes when it executes your function to access any other Amazon Web Services (AWS) resources.
Handler (string) --
The function Lambda calls to begin executing your function.
CodeSize (integer) --
The size, in bytes, of the function .zip file you uploaded.
Description (string) --
The user-provided description.
Timeout (integer) --
The function execution time at which Lambda should terminate the function. Because the execution time has cost implications, we recommend you set this value based on your expected execution time. The default is 3 seconds.
MemorySize (integer) --
The memory size, in MB, you configured for the function. Must be a multiple of 64 MB.
LastModified (string) --
The time stamp of the last time you updated the function.
CodeSha256 (string) --
It is the SHA256 hash of your function deployment package.
Version (string) --
The version of the Lambda function.
VpcConfig (dict) --
VPC configuration associated with your Lambda function.
SubnetIds (list) --
A list of subnet IDs associated with the Lambda function.
(string) --
SecurityGroupIds (list) --
A list of security group IDs associated with the Lambda function.
(string) --
VpcId (string) --
The VPC ID associated with you Lambda function.
DeadLetterConfig (dict) --
The parent object that contains the target ARN (Amazon Resource Name) of an Amazon SQS queue or Amazon SNS topic.
TargetArn (string) --
The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic you specify as your Dead Letter Queue (DLQ).
Environment (dict) --
The parent object that contains your environment's configuration settings.
Variables (dict) --
The key-value pairs returned that represent your environment's configuration settings or error information.
(string) --
(string) --
Error (dict) --
The parent object that contains error information associated with your configuration settings.
ErrorCode (string) --
The error code returned by the environment error object.
Message (string) --
The message returned by the environment error object.
KMSKeyArn (string) --
The Amazon Resource Name (ARN) of the KMS key used to encrypt your function's environment variables. If empty, it means you are using the AWS Lambda default service key.
TracingConfig (dict) --
The parent object that contains your function's tracing settings.
Mode (string) --
The tracing mode associated with your Lambda function.