Code Monkey home page Code Monkey 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  = "terraform-module/lambda/aws"
  version = "2.10.0"

  function_name      = "lambda-name-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"
  tracing_config      = { mode = "Active" }

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

  environment = {
    Environment = "test"
  }

  tags = {
    Environment = "test"
  }
}

Module Variables

Requirements

Name Version
terraform >= 0.12.9
aws >= 2.5

Providers

Name Version
aws >= 2.5

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
layers List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function list(string) null 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
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
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({
mode = string
})
null no
vpc_config Provide this to allow your function to access your VPC. Fields documented below. See Lambda in VPC.
object({
security_group_ids = list(string)
subnet_ids = list(string)
})
null no

Outputs

Name Description
arn Lambda ARN
cloudwatch_logs_arn The arn of theh log group.
cloudwatch_logs_name The name of the log group.
invoke_arn ARN to invoke the lambda method
name Lambda Name
version Lambda Version

Commands

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

๐Ÿ“ Guidelines

  • ๐Ÿ“ Use a succinct title and description.
  • ๐Ÿ› Bugs & feature requests can be be opened
  • ๐Ÿ“ถ Support questions are better asked on Stack Overflow
  • ๐Ÿ˜Š Be nice, civil and polite (as always).

License

Copyright 2019 Ivan Katliarhcuk

MIT Licensed. See LICENSE for full details.

How to Contribute

Submit a pull request

Authors

Currently maintained by Ivan Katliarchuk and these awesome contributors.

ForTheBadge uses-git

Terraform Registry

terraform-aws-lambda's People

Contributors

binceline avatar hknerts avatar iragsdale avatar ivankatliarchuk avatar ofirshtrull 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.