I'm new to Serverless framework. Is there a way to deploy the functions from NodeJS with Serverless framework in order to have the same code in my local src files than in Lambda functions? I would like to see the original code, and maybe put there manually some console.log, but all I see is minified code:
serverless.ymp code
service: XXX
provider:
name: aws
runtime: nodejs12.x
region: ${opt:region, 'us-east-2'}
stage: ${opt:stage, 'dev'}
tags:
datadog: ${self:provider.stage}
environment:
DYNAMODB_XXXXXS: ${self:provider.stage}-banks
DYNAMODB_XXXXX_ACCOUNTS: ${self:provider.stage}-bank-accounts
NODE_STAGE: ${self:provider.stage}
iamRoleStatements:
- Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: "arn:aws:logs:*:*:*"
- Effect: Allow
Action:
- dynamodb:Query
Resource:
- "arn:aws:dynamodb:${self:provider.region}:*:table/${self:provider.environment.DYNAMODB_XXXXXS}"
- "arn:aws:dynamodb:${self:provider.region}:*:table/${self:provider.environment.DYNAMODB_XXXXXS}/*"
- Effect: Allow
Action:
- dynamodb:PutItem
Resource:
- "arn:aws:dynamodb:${self:provider.region}:*:table/${self:provider.environment.DYNAMODB_XXXXX_ACCOUNTS}"
functions:
banks:
handler: src/index.handler
events:
- http:
path: /banks
method: post
cors: true
authorizer:
name: authorizer
arn: arn:aws:cognito-idp:${self:provider.region}:2XXXX4:userpool/${self:custom.XXX.cognito.userpool}
- http:
path: /banks
method: get
cors: true
authorizer:
name: authorizer
arn: arn:aws:cognito-idp:${self:provider.region}:XXXX04:userpool/${self:custom.XXx.cognito.userpool}
plugins:
- serverless-dynamodb-local
- serverless-webpack
- serverless-offline
package:
individually: true
exclude:
- node_modules/**
resources:
Resources:
DynamoDBTableBanks:
Type: AWS::DynamoDB::Table
Properties:
TableName: ${self:provider.environment.DYNAMODB_XXXXXS}
KeySchema:
- AttributeName: code
KeyType: HASH
- AttributeName: agent
KeyType: RANGE
AttributeDefinitions:
- AttributeName: code
AttributeType: S
- AttributeName: agent
AttributeType: S
- AttributeName: country
AttributeType: S
GlobalSecondaryIndexes:
- IndexName: banksByAgentCountry
KeySchema:
- AttributeName: agent
KeyType: HASH
- AttributeName: country
KeyType: RANGE
Projection:
ProjectionType: "ALL"
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
DynamoDBTableBankAccount:
Type: AWS::DynamoDB::Table
Properties:
TableName: ${self:provider.environment.DYNAMODB_XXXXX_ACCOUNTS}
KeySchema:
- AttributeName: id
KeyType: HASH
- AttributeName: receiverId
KeyType: RANGE
AttributeDefinitions:
- AttributeName: id
AttributeType: S
- AttributeName: receiverId
AttributeType: S
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
custom:
XXXX:
cognito:
userpool: ${env:COGNITO_USER_POOL_ID, 'us-east-2_XXXX'}
dynamodb:
stages:
- dev
start:
convertEmptyValues: true
heapInitial: 200m
heapMax: 1g
inMemory: true
migrate: true
port: 8000
webpack:
webpackConfig: "webpack.config.js"
packager: "npm"
includeModules:
forceExclude:
- aws-sdk

serverless.ymland the relevant function code? - jellycsc