This video show you creating lambda function using cloudformation stack.
—————————- Template Using code inside cloudformation stack ——————————-
{
“AWSTemplateFormatVersion”: “2010-09-09”,
“Description”: “A template is for creating lambda “,
“Resources”: {
“LambdaFunResource”: {
“Type”: “AWS::Lambda::Function”,
“Properties”: {
“FunctionName”: “SurajLambdaCFT”,
“Code”: {
“ZipFile”: {
“Fn::Join”: [
“n”,
[
“def lambda_handler(event, context):”,
” print(‘THIS IS LAMBDA CREATED FROM CloudFormation’)”,
” return ‘success'”
]
]
}
},
“Description”: “Used to run job”,
“Handler”: “index.lambda_handler”,
“Role”: “arn:aws:iam::13015229333333455024:role/lambda_basic_execution”,
“Runtime”: “python3.6”,
“Timeout”: 120
}
}
}
}
——————- Template Using code (your lambda python code file) stored S3 Bucket ———————
{
“AWSTemplateFormatVersion”: “2010-09-09”,
“Description”: “A template is for creating lambda from s3 buckets”,
“Resources”: {
“LambdaFunResource”: {
“Type”: “AWS::Lambda::Function”,
“Properties”: {
“FunctionName”: “SurajLambdaCFT”,
“Code”: {
“S3Bucket” : “surajyt”,
“S3Key” : “index.zip”
},
“Description”: “Used to run job”,
“Handler”: “index.lambda_handler”,
“Role”: “arn:aws:iam::13015229333333455024:role/lambda_basic_execution”,
“Runtime”: “python3.6”,
“Timeout”: 120
}
}
}
}
source
Thanks for the tutorial it was helpful, but please remove the music while you talk!
can you please guide how did you assign this role
I'm getting a roll back, please how do I fix this? Error The following resource failed to create: [LamdaFunResource].
Can we create multiple lambda functions within one JSON? Can you please share the sample JSON
how do we add role in the same template?
Nice information, however, the music in the background was distracting, consider omitting.
Can you explain where you got the value for the Role? I didn't quite understand in the video.
Thank you, nicely presented
Can we create CFT with a file watcher trigger?
Could you please do videos on deploying resources through any other tools(like HashiCop Packer) instead of doing from UI?
bro can you please share mobile no otherwise call me once
9671918199
Can I have the same for RDS creation, Backup and Restore with SQLSERVER_BACKUP_RESTORE option