From 87a32ee0d542a2fcf0ed841bd79b7cc7631334fe Mon Sep 17 00:00:00 2001 From: Hendrix Roa Date: Fri, 27 Dec 2019 17:06:11 -0400 Subject: [PATCH] Update readme --- README.md | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/README.md b/README.md index e69de29..3f65e10 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,76 @@ +# Lambda Node.js + yarn + +Lambda Module with the best security practice prebuilt with yarn installing to add custom modules and libreries from npmjs.com, ideally to integrate to CI/CD pipeline. Some features: + +- Integrated with S3 bucket to deploy latest version and compare if a lambda require update. +- Best security best practices witn encryption features. +- Easy handle to packaging zip + node_modules folder. +- Terraform `0.12.+` + +## How to use + +```hcl +module "my-lambda" { + source = "hendrixroa/lambda-nodejs-yarn/aws" + code_location = "../mylambdas/lambda" + key_s3_bucket = "lambda.zip" + s3_bucket_id = aws_s3_bucket.lambdas.id + lambda_iam_role = aws_iam_role.lambda_basic_role.arn + lambda_function_name = "lambda" + lambda_runtime = "nodejs10.x" + kms_key_logs = "kms key arn for logs" + kms_key_lambda = "kms key arn for lambda" + + environment_variables = { + myAwesomeEnv = "my awesome value" + } +} +``` + +- Basic IAM Role and Policy: + +```hcl +resource "aws_iam_role" "lambda_basic_role" { + name = "lambda_basic_role" + + assume_role_policy = <