-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change serverless-functions to export-serverless. Add iamStatements. …
…Remove logs from model (only test)
- Loading branch information
maguimarijuan
committed
May 20, 2020
1 parent
33042b5
commit 3445e30
Showing
4 changed files
with
48 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
'use strict'; | ||
|
||
const path = require('path'); | ||
|
||
const handlerPath = path.join(process.env.MS_PATH || '', 'lambda', 'ExportProcess', 'index.handler'); | ||
const clientModelPath = path.join(process.env.MS_PATH || '', 'models', 'client.js'); | ||
const controllersPath = path.join(process.env.MS_PATH || '', 'controllers', 'export', '**'); | ||
const modelsPath = path.join(process.env.MS_PATH || '', 'models', '**'); | ||
|
||
const resourceAux = '${self:custom.stage}';// eslint-disable-line | ||
|
||
module.exports = serviceName => [ | ||
[ | ||
'janis.apiPost', { | ||
entityName: 'export', | ||
authorizer: 'ImportExportAuthorizer', | ||
cors: true, | ||
timeout: 10, | ||
package: { include: [modelsPath, controllersPath] } | ||
} | ||
], | ||
|
||
[ | ||
'function', { | ||
functionName: 'ExportProcess', | ||
handler: handlerPath, | ||
description: 'Export Process Lambda', | ||
timeout: 60, | ||
package: { include: ['schemas/mongo/**', clientModelPath] } | ||
} | ||
], | ||
|
||
[ | ||
'iamStatement', { | ||
action: [ | ||
's3:PutObject', | ||
's3:GetObject' | ||
], | ||
resource: `arn:aws:s3:::janis-${serviceName}-service-${resourceAux}/*`// eslint-disable-line | ||
} | ||
] | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters