sultanGULLU
sultanGULLU

Reputation: 21

Provide lambda function code as S3 Bucket name and Key Name

Right Now i am using inline lambda function code. I want to put the code somewhere in S3 bucket and than Provide it as S3 bucketname and S3 keyname. How can I do it.

Upvotes: 0

Views: 271

Answers (1)

AS90
AS90

Reputation: 106

codeDetails = {"S3Bucket": 'bucketname' , "S3Key": 'lambdaCode/Events.zip' }
lambda_resp = lambda_client.create_function(FunctionName='test-lambda',
                Handler = 'lambda_function.lambda_handler',Runtime='python3.7', Role = role_arn, Code=codeDetails ,Timeout=800, MemorySize = 1024, Publish = True)

By creating a lambda_client this can be done.

Upvotes: 1

Related Questions