service: ${file(env.configs.yml):feature} frameworkVersion: ">=1.6.0 <2.1.0" provider: name: aws stackName: ${file(env.configs.yml):feature}-${file(env.configs.yml):environment} runtime: dotnetcore2.1 region: ${file(env.configs.yml):region} accountId: ${file(env.configs.yml):accountId} environment: DynamoDbConfiguration__TableName: ${file(env.configs.yml):dynamoTable} iamRoleStatements: - Effect: Allow Action: - dynamodb:* Resource: "arn:aws:dynamodb:${self:provider.region}:*:table/${self:provider.environment.DynamoDbConfiguration__TableName}" package: artifact: bin/release/netcoreapp2.1/deploy-package.zip functions: create: handler: DotNetServerless.Lambda::DotNetServerless.Lambda.Functions.CreateItemFunction::Run events: - http: path: items method: post cors: true get: handler: DotNetServerless.Lambda::DotNetServerless.Lambda.Functions.GetItemFunction::Run events: - http: path: items/{id} method: get cors: true update: handler: DotNetServerless.Lambda::DotNetServerless.Lambda.Functions.UpdateItemFunction::Run events: - http: path: items method: put cors: true resources: Resources: ItemsDynamoDbTable: Type: 'AWS::DynamoDB::Table' DeletionPolicy: Retain Properties: AttributeDefinitions: - AttributeName: Id AttributeType: S - AttributeName: Code AttributeType: S KeySchema: - AttributeName: Id KeyType: HASH - AttributeName: Code KeyType: RANGE ProvisionedThroughput: ReadCapacityUnits: 1 WriteCapacityUnits: 1 TableName: ${self:provider.environment.DynamoDbConfiguration__TableName}