---
AWSTemplateFormatVersion: '2010-09-09'
Description: Fantastic Lambda Function
Parameters:
  s3Bucket:
    Description: bucket of the thingy
    Type: String
  s3Key:
    Description: key of the thingy
    Type: String
    Default: lambda/something.zip
  functionName:
    Description: name of the thingy
    Type: String
    Default: something
  handler:
    Description: entry point
    Type: String
    Default: main.lambda_handler
  memorySize:
    Description: memory size
    Type: String
    Default: 128
  runTime:
    Description: run time engine of the thingy
    Type: String
    Default: python2.7
  timeOut:
    Description: time out in seconds
    Type: String
    Default: 60
${subnetsParameterSection}
${sgParameterSection}
${roleParameterSection}
${snsTopicARN}
${trustedService}
${scheduleExpression}
Resources:
  LambdaFunction:
    Type: AWS::Lambda::Function
    Properties:
      Code:
        S3Bucket:
          Ref: s3Bucket
        S3Key:
          Ref: s3Key
${environment_section}
      FunctionName:
        Ref: functionName
      Handler: 
        Ref: handler
      MemorySize:
        Ref: memorySize
      Role: 
        # Ref: role if given as a parameter
        # Fn::ImportValue: <something> if given as an import
        ${roleSpecification}
      Runtime: 
        Ref: runTime
      Timeout:
        Ref: timeOut
      VpcConfig:
        SecurityGroupIds:
          ${securityGroupIds}
        SubnetIds:
          ${subnetIds}
${snsSubscriptionResource}
${trustedServiceResource}
${scheduleResource}
${theAPI}
