0
votes

I am new to AWS and trying to update a lambda function. The lambda function is initially created using cloud-formation template with s3key as name of my zip file present in s3 bucket.

 "LambdaFunction":{
         "Type" : "AWS::Lambda::Function",
         "Properties" : {
             "Code" : {
               "S3Bucket" : {
                  "Ref":"myBucket"
               },
               "S3Key" : "lambdaFunction.zip"
             },
             "FunctionName" : "HandleUserRequests",
             "Handler" : "index.handler",
             "Role" : {"Fn::GetAtt" : ["LambdaIamRole", "Arn"] },
             "Runtime" : "nodejs10.x",

Now I have updated the function in local and triggered CI/CD to upload the updated code zip onto S3 bucket.

I need to update my lambda function with this new zip upload from s3. Can you please guide, how does deployment work for lambda function ?

1

1 Answers

2
votes

Ideally we wouldn’t want to deploy Lambda functions using CloudFormation. We should be using AWS Serverless Application Model (AWS SAM).

This enables us to write and place our code locally and when u build, package and deploy the template, our code is automatically placed in S3 and linked to the Lambda function.