Tabnine Logo For Javascript
@aws-cdk/aws-lambda
Code IndexAdd Tabnine to your IDE (free)

How to use @aws-cdk/aws-lambda

Best JavaScript code snippets using @aws-cdk/aws-lambda(Showing top 8 results out of 1,395)

origin: aws-samples/aws-cdk-changelogs-demo

constructor(parent, id, props) {
  super(parent, id, props);

  // Create a lambda that recrawls changelogs discovered in the past
  const recrawlLambda = new lambda.Function(this, 'recrawl', {
   runtime: lambda.Runtime.NODEJS_12_X,
   handler: 'recrawl.handle',
   code: lambda.Code.asset('./app/recrawl'),
   timeout: cdk.Duration.minutes(5),
   environment: {
    CHANGELOGS_TABLE_NAME: props.changelogsTable.tableName,
    DISCOVERED_TOPIC_NAME: props.toCrawlTopic.topicArn
   }
  });

  // Grant the lambda permission to modify the tables
  props.changelogsTable.grantReadWriteData(recrawlLambda.role);
  props.toCrawlTopic.grantPublish(recrawlLambda.role);

  // Schedule the recrawler to run once every minute
  this.eventRule = new events.Rule(this, 'recrawl-check-schedule', {
   schedule: events.Schedule.rate(cdk.Duration.minutes(1)),
   targets: [new eventTargets.LambdaFunction(recrawlLambda)]
  });
 }
origin: aws-samples/aws-cdk-changelogs-demo

constructor(parent, id, props) {
  super(parent, id, props);

  // Create a lambda that returns autocomplete results
  const autocomplete = new lambda.Function(this, 'autocomplete', {
   runtime: lambda.Runtime.NODEJS_12_X,
   handler: 'autocomplete.handle',
   code: lambda.Code.asset('./app/autocomplete'),
   environment: {
    SEARCH_INDEX_TABLE_NAME: props.searchIndexTable.tableName
   }
  });

  // Grant the lambda permission to modify the tables
  props.searchIndexTable.grantReadWriteData(autocomplete.role);

  this.autocompleteGateway = new apiGateway.LambdaRestApi(this, 'autocomplete-gateway', {
   handler: autocomplete,
   proxy: true
  });

  this.url = this.autocompleteGateway.url;
 }
origin: aws-samples/aws-cdk-changelogs-demo

const regenerateHomepage = new lambda.Function(this, 'regenerate-homepage', {
 runtime: lambda.Runtime.NODEJS_12_X,
 handler: 'regenerate-homepage.handle',
 code: lambda.Code.asset('./app/regenerate-homepage'),
 environment: {
  CHANGELOGS_TABLE_NAME: props.changelogsTable.tableName,
props.feedsTable.grantReadData(regenerateHomepage.role);
props.changelogsTable.grantReadData(regenerateHomepage.role);
props.webBucket.grantReadWrite(regenerateHomepage.role);
origin: daviddeejjames/send-that-invoice

const lambdaFn = new lambda.Function(this, lambdaName, {
 functionName: lambdaName,
 code: lambda.Code.asset('src'),
 handler: 'handler.main',
 timeout: cdk.Duration.seconds(300),
 runtime: lambda.Runtime.NODEJS_10_X,
 environment: {
  DATA_BUCKET: `${bucket.bucketName}`,
origin: aws-samples/aws-cdk-changelogs-demo

constructor(parent, id, props) {
  super(parent, id, props);

  // Create a lambda that returns autocomplete results
  const recentlyCrawled = new lambda.Function(this, 'recently-crawled', {
   runtime: lambda.Runtime.NODEJS_12_X,
   handler: 'recently-crawled.handle',
   code: lambda.Code.asset('./app/recently-crawled'),
   environment: {
    FEEDS_TABLE_NAME: props.feedsTable.tableName,
    API_BUCKET_NAME: props.apiBucket.bucketName
   }
  });

  // Grant the lambda permission to modify the tables and S3 bucket
  props.feedsTable.grantReadWriteData(recentlyCrawled.role);
  props.apiBucket.grantReadWrite(recentlyCrawled.role);

  // Schedule the recrawler to run once every minute
  this.eventRule = new events.Rule(this, 'recrawl-check-schedule', {
   schedule: events.Schedule.rate(cdk.Duration.minutes(1)),
   targets: [new eventTargets.LambdaFunction(recentlyCrawled)]
  });
 }
origin: aws-samples/aws-cdk-changelogs-demo

const crawlLambda = new lambda.Function(this, 'crawl-lambda', {
 runtime: lambda.Runtime.NODEJS_12_X,
 handler: 'crawl.handle',
 code: lambda.Code.asset('./app/crawl'),
 timeout: cdk.Duration.seconds(30),
 vpc: props.vpc,
crawlLambda.addEventSource(crawlEventSource);
props.changelogsTable.grantReadWriteData(crawlLambda.role);
props.feedsTable.grantReadWriteData(crawlLambda.role);
props.searchIndexTable.grantReadWriteData(crawlLambda.role);
props.webBucket.grantReadWrite(crawlLambda.role);
props.apiBucket.grantReadWrite(crawlLambda.role);
crawlLambda.connections.allowToDefaultPort(props.redis);
origin: aws-samples/aws-cdk-changelogs-demo

constructor(parent, id, props) {
  super(parent, id, props);

  // Create the lambda
  const pypiFollower = new lambda.Function(this, 'pypi-follower', {
   runtime: lambda.Runtime.NODEJS_12_X,
   handler: 'pypi-recent.handle',
   code: lambda.Code.asset('./app/pypi-recent'),
   timeout: cdk.Duration.minutes(1),
   environment: {
    CHANGELOGS_TABLE_NAME: props.changelogsTable.tableName,
    DISCOVERED_TOPIC_NAME: props.toCrawlTopic.topicArn
   }
  });

  // Grant this application access to the DynamoDB table and SNS topic
  props.changelogsTable.grantReadWriteData(pypiFollower.role);
  props.toCrawlTopic.grantPublish(pypiFollower.role);

  // Schedule the follower to run once every 5 mins
  this.eventRule = new events.Rule(this, 'check-recent-pypi', {
   schedule: events.Schedule.rate(cdk.Duration.minutes(5)),
   targets: [new eventTargets.LambdaFunction(pypiFollower)]
  });
 }
origin: aws-samples/aws-cdk-changelogs-demo

constructor(parent, id, props) {
  super(parent, id, props);

  // Create the lambda
  const rubygemFollower = new lambda.Function(this, 'rubygem-follower', {
   runtime: lambda.Runtime.NODEJS_12_X,
   handler: 'rubygem-recent.handle',
   code: lambda.Code.asset('./app/rubygem-recent'),
   timeout: cdk.Duration.minutes(1),
   environment: {
    CHANGELOGS_TABLE_NAME: props.changelogsTable.tableName,
    DISCOVERED_TOPIC_NAME: props.toCrawlTopic.topicArn
   }
  });

  // Grant this application access to the DynamoDB table and SNS topic
  props.changelogsTable.grantReadWriteData(rubygemFollower.role);
  props.toCrawlTopic.grantPublish(rubygemFollower.role);

  // Schedule the follower to run once every 5 mins
  this.eventRule = new events.Rule(this, 'check-recent-rubygems', {
   schedule: events.Schedule.rate(cdk.Duration.minutes(5)),
   targets: [new eventTargets.LambdaFunction(rubygemFollower)]
  });
 }
@aws-cdk/aws-lambda(npm)

Most used @aws-cdk/aws-lambda functions

  • Code.asset
  • Code
  • Code.Code
  • Function
  • Function.Function
  • Function.connections,
  • Function.role,
  • Runtime,
  • Runtime.NODEJS_10_X,
  • Runtime.NODEJS_12_X,
  • Runtime.Runtime

Popular in JavaScript

  • handlebars
    Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
  • mime-types
    The ultimate javascript content-type utility.
  • webpack
    Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
  • async
    Higher-order functions and common patterns for asynchronous code
  • aws-sdk
    AWS SDK for JavaScript
  • request
    Simplified HTTP request client.
  • cheerio
    Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • rimraf
    A deep deletion module for node (like `rm -rf`)
  • minimist
    parse argument options
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now