# Serverless format/language?

**URL:** <https://forum.serverless.com/t/serverless-format-language/315>\
**Category:** Serverless Framework\
**Created:** [September 16, 2016, 7:32pm UTC](https://forum.serverless.com/t/serverless-format-language/315 "2016-09-16T19:32:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinodhum](https://avatars.discourse-cdn.com/v4/letter/v/e56c9b/32.png) [@vinodhum](https://forum.serverless.com/u/vinodhum)\
**Post date:** [September 16, 2016, 7:32pm UTC](https://forum.serverless.com/t/serverless-format-language/315/1 "2016-09-16T19:32:38Z")

</div>

Hi,  
how do I convert below code in serverless format ?  
I am trying to create dynomoDB table  
I also noticed that we have “-” in front for http event what does that mean ?

```
"mySecondDDBTable" : {
  "Type" : "AWS::DynamoDB::Table",
  "DependsOn" : "myFirstDDBTable" ,
  "Properties" : {
    "AttributeDefinitions" : [
      {
        "AttributeName" : "ArtistId",
        "AttributeType" : "S"        
      },
      {
        "AttributeName" : "Concert",
        "AttributeType" : "S"        
      },
      {
        "AttributeName" : "TicketSales",
        "AttributeType" : "S"        
      }
    ],
    "KeySchema" : [
      {
        "AttributeName" : "ArtistId",
        "KeyType" : "HASH"
      },
      {
        "AttributeName" : "Concert",
        "KeyType" : "RANGE"
      }
    ],
    "ProvisionedThroughput" : {
      "ReadCapacityUnits" : {"Ref" : "ReadCapacityUnits"},
      "WriteCapacityUnits" : {"Ref" : "WriteCapacityUnits"}
    },
    "GlobalSecondaryIndexes" : [{
      "IndexName" : "myGSI",
      "KeySchema" : [
        {
          "AttributeName" : "TicketSales",
          "KeyType" : "HASH"
        }
      ],                           
      "Projection" : {
        "ProjectionType" : "KEYS_ONLY"
      },    
      "ProvisionedThroughput" : {
        "ReadCapacityUnits" : {"Ref" : "ReadCapacityUnits"},
        "WriteCapacityUnits" : {"Ref" : "WriteCapacityUnits"}
      }
    }]
  }
```

---

<div class="post-metadata">

**Author:** ![vinodhum](https://avatars.discourse-cdn.com/v4/letter/v/e56c9b/32.png) [@vinodhum](https://forum.serverless.com/u/vinodhum)\
**Post date:** [September 16, 2016, 8:24pm UTC](https://forum.serverless.com/t/serverless-format-language/315/2 "2016-09-16T20:24:23Z")

</div>

never mind i figured it out, its yaml.

got another question.  
how to I reference the table created in iamRole ?

```
iamRoleStatements:
  - Effect: Allow
    Action:
      - dynamodb:GetItem
        dynamodb:PutItem
        dynamodb:UpdateItem
        dynamodb:DeleteItem
        dynamodb:Query
        dynamodb:Scan
    Resource: 
        ?????????????????????????????????
```

---

<div class="post-metadata">

**Author:** ![vinodhum](https://avatars.discourse-cdn.com/v4/letter/v/e56c9b/32.png) [@vinodhum](https://forum.serverless.com/u/vinodhum)\
**Post date:** [September 17, 2016, 4:34am UTC](https://forum.serverless.com/t/serverless-format-language/315/3 "2016-09-17T04:34:50Z")

</div>

anybody know how to the ref to table to iamRole Resource ?

---

<div class="post-metadata">

**Author:** ![flomotlik](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/flomotlik/32/3_2.png) [@flomotlik](https://forum.serverless.com/u/flomotlik)\
**Post date:** [September 17, 2016, 1:36pm UTC](https://forum.serverless.com/t/serverless-format-language/315/4 "2016-09-17T13:36:16Z")

</div>

Wouldn’t using Ref work like described here: [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html)

---

<div class="post-metadata">

**Author:** ![vinodhum](https://avatars.discourse-cdn.com/v4/letter/v/e56c9b/32.png) [@vinodhum](https://forum.serverless.com/u/vinodhum)\
**Post date:** [September 17, 2016, 6:03pm UTC](https://forum.serverless.com/t/serverless-format-language/315/5 "2016-09-17T18:03:31Z")

</div>

ya fallowed that guide  
but I keep getting below error

An error occurred while provisioning your stack: IamPolicyLambdaExecution  
- Actions/Condition can contain only one colon…

here what I am using

```
Resource:
  Fn::Join:
  - ''
  - - 'arn:aws:dynamodb:'
    - Ref: AWS::Region
    - ":xxxxxxxxxxxxx:table/"
    - Ref: DynamoDBTable
```

---

<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:** [September 19, 2016, 3:18am UTC](https://forum.serverless.com/t/serverless-format-language/315/6 "2016-09-19T03:18:41Z")

</div>

Shameless self-promotion here; I wrote [a blog post](http://blog.rowanudell.com/using-dyanmodb-with-serverless/) on adding DDB to my Serverless Service.
