You've nailed it bro! absolutely straight to the point and very useful. This was exactly what I needed to see how we can commit lambda to github and deploy it in aws.
@@FelixYu dude, how about if we have to reupload the function because there is a changes of the code, do you have a video for that? your response really appreciated man.
@@gpet2184 if there is a change in the lambda code, u can just make the change and push it to github, and it will automatically trigger CodeBuild to update the lambda function!!!! thats because in 7:15 of the video, we specified it to trigger CodeBuild every time we push a new commit to the github repo
@@FelixYu Thanks a lot for your immediate response, one last thing how about if I have a new function to make, I am not pretty sure about the configuration in iam-policy, especially the resource what I must to do, becuase what I think is I have to add a resource statement, right? --> "Resource": "arn:aws:lambda:us-east-1:your-aws-account-number:function:your-lambda-function-name"... Very thankful for your response :)
@@gpet2184 u will need to add the "lambda:CreateFunction" to the Action list of the IAM policy..and then in the buildspec.yml file u needa add this comment to create it aws lambda create-function --function-name my-new-function-name --zip-file fileb://my-deployment-package.zip --handler lambda_function.lambda_handler --runtime python3.8 --role arn:aws:iam::your-account-id:role/my-lambda-role i would recommend u just create the new function manually on the aws console thou
Your JSON copy and paste didn’t work for me. I’m on windows so i’m not sure if that makes a difference but my visual editor on my CodeBuild function says to “specify resource ATN for the PutFunctionConcurrency and 9 more actions. One or more actions may not support this resource.”
I have a GitHub repo which contains multiple lambda functions code inside. I'm looking for a way to update my lambda function automatically whenever there is any change in the particular lambda function code. Is there any method to achieve this ?
"Primary source webhook events" has changed and is not an option when creating the codebuild. In details, i'm not able to create a webhook like you did in this tutorial. Could this be the reason why the codebuilder is not responding when I push my code into my repo?
HI, I'm facing a lil issue. The code deploy works and everything shows successful but when i try to access the port, it does not connect. i changed the port in the files and added as a custom tcp, still didn't work. so where do i check the server logs, so that i can be able to debug this problem
Thanks, this was super useful. Can you help me with one question? If I use terraform to provision lambda it causes timestamp mismatch and it deploys lambda again when I do terraform apply. I can run codebuild again to package and deploy the latest code in lambda but is there any way to avoid this.
Hi Felix, just want to know if its possible in similar way to automatically deploy lambda from AWS code commit as well? i can just see how to add code commit trigger in lambda
I got this error in code build in Installation , COMMAND_EXECUTION_ERROR: Error while executing command: pip install -r requirements.txt -t lib. Reason: exit status 1 How to get over this?
maybe check requirements.txt file did you use pandas==1.2.1. You need two equalto signs not one. Else, enable the CloudWatch logs for the CodeBuild project. Then you can see the full logs
thank you very much for clear , useful one . i have a git repo with multiple lambda functions , I am able to zip but unable to deploy to S3 and lambda functions , any insight will be useful , Thanks in advance
the first thing i can think of is that make sure the iam role that is attached to CodeBuild has permission to both S3 and lambda. does it give u an error message when u look at the logs? this video only shows how to modify lambda via codebuild. here is a video for uploading to s3 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-AMSdM2dj_eI.html
Can you please share me buildspec file where i can use codebuild ,s3 bucket and aws lambda with environment value . So i can pass password before deployment to aws lambda function for node js application
here are my other two vids where i talked abt how to use codebuild to deploy lambda functions and upload to s3: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-AmHZxULclLQ.html ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-AMSdM2dj_eI.html
Hmm I don’t think there’s any way to do that without other services….if it’s possible, it would be a feature within lambda and lambda currently doesn’t have that feature yet!!
Frankly speaking, got confused. In cicd pipeline we update a source and push to github and that will automatically deploy to the target and becomes available there. But here, I saw python code, yml file, Lamda function, etc. which is for which purpose, could not understand.
if i can use aws lambda update-function-code --function-name github-to-lambda-demo --zip file fileb://deployment_package.zip command, then what is the purpose of using codedeploy and codepipeline? because it seems like you bypass those