Giter Club home page Giter Club logo

terraform-aws-lambda's Introduction

AWS Lambda

Deploy Lambda into VPC or outside of the vpc

Usage example

Here's the gist of using it via github.

module lambda {
  source = "github.com/terraform-module/terraform-aws-lambda?ref=v2.4.0"

  function_name      = "lambda-to-deploy"
  filename           = "${path.module}/lambda.zip"
  description        = "description should be here"
  handler            = "index.handler"
  runtime            = "nodejs12.x"
  memory_size        = "128"
  concurrency        = "5"
  lambda_timeout     = "20"
  log_retention      = "1"
  role_arn           = "some-role-arn"

  vpc_config = {
    subnet_ids         = ["sb-q53asdfasdfasdf", "sf-3asdfasdfasdf6"]
    security_group_ids = ["sg-3asdfadsfasdfas"]
  }

  environment = {
    Environment = "test"
  }

  tags = {
    Environment = "test"
  }
}

Module Variables

Inputs

Name Description Type Default Required
concurrency The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. number n/a yes
description Description of what your Lambda Function does. string n/a yes
environment The Lambda environment's configuration settings. map(string) "null" no
event_age_in_seconds Maximum age of a request that Lambda sends to a function for processing in seconds. Valid values between 60 and 21600. number "100" no
filename The path to the function's deployment package within the local filesystem. If defined. No S3 support string n/a yes
function_name A unique name for your Lambda Function. string n/a yes
handler The function entrypoint in your code. string n/a yes
lambda_timeout The amount of time your Lambda Function has to run in seconds. Defaults to 5 number "5" no
log_retention Specifies the number of days you want to retain log events in the specified log group. number "1" no
memory_size Amount of memory in MB your Lambda Function can use at runtime. Defaults to 128. number n/a yes
publish Whether to publish creation/change as new Lambda Function Version. Defaults to true. bool "true" no
retry_attempts Maximum number of times to retry when the function returns an error. Valid values between 0 and 2. Defaults to 2. number "0" no
role_arn IAM role attached to the Lambda Function. This governs both who / what can invoke your Lambda Function, as well as what resources our Lambda Function has access to. string n/a yes
runtime See Runtimes for valid values. string n/a yes
tags A mapping of tags to assign to the object. map {} no
tracing_config Use AWS X-Ray to collect data about events that your function processes, and to identify the cause of errors in your serverless applications. Can be either PassThrough or Active. object "null" no
vpc_config Provide this to allow your function to access your VPC. Fields documented below. See Lambda in VPC. object "null" no
source_code_hash Used to trigger updates when file contents change. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or s3_key. string "null" no

Outputs

Name Description
arn Lambda ARN
cloudwatch_logs_arn
name Lambda Name

Commands

$ make help 
hooks                          Commit hooks setup
validate                       Validate with pre-commit hooks
changelog                      Update changelog
release                        Create release version 

How to Contribute

Submit a pull request

terraform-aws-lambda's People

Contributors

ivankatliarchuk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.