AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: An AWS Serverless Specification template describing your function. Resources: myfunction: Type: AWS::Serverless::Function Properties: Handler: index.handler Runtime: nodejs6.10 CodeUri: . Description: '' MemorySize: 128 Timeout: 5 Events: Api1: Type: Api Properties: Path: / Method: GET Tracing: Active Environment: Variables: TABLE_NAME: !Ref MyTable Policies: # Give just CRUD permissions to one table - DynamoDBCrudPolicy: TableName: !Ref MyTable MyTable: Type: AWS::Serverless::SimpleTable Properties: PrimaryKey: Name: id Type: Number ProvisionedThroughput: ReadCapacityUnits: 1 WriteCapacityUnits: 1 Tags: AppType: Serverless Outputs: ApiURL: Description: "API endpoint URL for Prod environment" Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/" TableName: Value: !Ref MyTable