0.2.5 • Published 5 years ago

@tfinjs/aws-lambda v0.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

AWS lambda resource for tfinjs

Usage

Definition

import { resource as awsLambda } from '@tfinjs/aws-lambda';
import lambdaDeploymentBucket from './lambdaDeploymentBucket';
import api from './api';

const petLambdas = awsLambda(api, 'petLambdas', {
  cloudwatch: true,
  apigw: {
    enabled: true,
    cors: true,
    path: '*/*',
  },
  s3DeploymentBucket: api.reference(lambdaDeploymentBucket, 'id'),
  entry: {
    path: join(__dirname, './service.js'),
    export: 'handler'
  }
  /* byotranspiler */
  /* given the input file path, transpile the input into some output file content which path should be returned */
  /* if you dont want to transpile the file, just return the fs.readFileSync(inputFilePath, 'binary'); buffer */
  /* If you use some env files you can transpile using webpack and the env provider plugin such that you can use the api during runtime */
  build: async (inputFilePath) => {
    return fs.readFileSync(inputFilePath, 'binary');
  }
});

export default lambda;

Reference the arn in lambdas

/* service.js */
import { getArn } from '@tfinjs/aws-lambda';
import api from './target-lambda/api';

const arn = getArn(api, 'petLambda', 'queue');
0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.0.5

5 years ago

0.0.5-beta

5 years ago

0.0.4-beta

5 years ago

0.0.3-beta

5 years ago

0.0.2-beta

5 years ago

0.0.1-beta

5 years ago