title: How to specify lambda function and IAM role name in cloudformation template
body: <p>here is my template </p>
  
  <pre><code>{  
     "AWSTemplateFormatVersion":"2010-09-09",
     "Resources":{  
        "lambdafunction":{  
           "Type":"AWS::Lambda::Function",
           "Properties":{  
              "Handler":"index.handler",
              "Role":{  
                 "Fn::GetAtt":[  
                    "RootRole",
                    "Arn"
                 ]
              },
              "Code":{  
                 "S3Bucket":"{s3_bucket_name}",
                 "S3Key":"lambda-zip"
              },
              "Runtime":"java8",
              "Timeout":"25"
           }
        },
        "RootRole":{  
           "Type":"AWS::IAM::Role",
           "Properties":{  
              "AssumeRolePolicyDocument":{  
                 "Version":"2012-10-17",
                 "Statement":[  
                    {  
                       "Effect":"Allow",
                       "Principal":{  
                          "Service":[  
                             "ec2.amazonaws.com"
                          ]
                       },
                       "Action":[  
                          "sts:AssumeRole"
                       ]
                    }
                 ]
              },
              "Path":"/",
              "Policies":[  
                 {  
                    "PolicyName":"root",
                    "PolicyDocument":{  
                       "Version":"2012-10-17",
                       "Statement":[  
                          {  
                             "Effect":"Allow",
                             "Action":"*",
                             "Resource":"*"
                          }
                       ]
                    }
                 }
              ]
           }
        }
     }
  }
  </code></pre>
  
  <p>The name of the lambda function after the stack creation is 
  lambda-lambdafunction-18SJKJ5Q40AKZ
  The name of IAM role is 
  lambda-RootRole-12S8E9CA0EOVM</p>
  
  <p>The template does not seem to have a way to define the lambda function name <a href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html" rel="noreferrer">http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html</a>. And I am not sure why random characters are appended at the end. </p>