Creating lambda function using cloudformation stack

    8
    12



    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

    Previous articleWie wird man Data Scientist?
    Next articleMicrosoft Azure Pipelines-Jira Integration

    12 COMMENTS