# AWS::Lambda::Function is NOT Supported

**URL:** <https://forum.serverless.com/t/aws-lambda-function-is-not-supported/2880>\
**Category:** Serverless Framework\
**Created:** [October 13, 2017, 7:48pm UTC](https://forum.serverless.com/t/aws-lambda-function-is-not-supported/2880 "2017-10-13T19:48:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ross](https://avatars.discourse-cdn.com/v4/letter/r/e274bd/32.png) [@Ross](https://forum.serverless.com/u/Ross)\
**Post date:** [October 13, 2017, 7:48pm UTC](https://forum.serverless.com/t/aws-lambda-function-is-not-supported/2880/1 "2017-10-13T19:48:32Z")

</div>

about AWS::Lambda::Function, based on [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html)

and it looks serverless framework does NOT support Method definition in resource but only in functions block

for example: let’s say if we have defined functions block as below which works fine

```
functions:
  getToken:
    handler: index.getToken
    name: getToken
    memorySize: 256

```

Then use the new Method in resource to replace above definition ( remove above from yml file)

```
resource
 Resources:
   getToken: 
      Type: "AWS::Lambda::Function"
      Properties: 
        Handler: "index.getToken"
        MemorySize: 256
        Role: 
          Fn::GetAtt: 
            - "LambdaExecutionRole"
            - "Arn"
        Code: 
          S3Bucket: "yourbucketofDeployment"
          S3Key: "service1.zip"
        Runtime: ${self:provider.runtime}
        Timeout: 25
        TracingConfig:
          Mode: "Active"

```

try to run `sls deploy --alias dev` , you get **Cannot read property ‘Properties’ of undefined** error all the time unless you revert it back to functions structure as before the old way.

Simply tested and say if we remove functions block from yml file , it throws this error all the time . are we stuck at this structure?

---

<div class="post-metadata">

**Author:** ![rowanu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rowanu/32/75_2.png) [@rowanu](https://forum.serverless.com/u/rowanu)\
**Post date:** [October 22, 2017, 4:17am UTC](https://forum.serverless.com/t/aws-lambda-function-is-not-supported/2880/2 "2017-10-22T04:17:00Z")

</div>

Is that your actual `resources` section? The indentation is not right in the code you’ve pasted (`Resources` should be 2 spaces in).

You definitely can define functions you the `resources` block, it’s just CloudFormation.
