terraform-aws-lambda-base

Create environment dependencies for Lambda functions:

  • IAM role
  • Permissions
  • CloudWatch Log Group

Usage

Example:

module "lambda_base" {
  source = "github.com/andreswebs/terraform-aws-lambda-base"
  name   = "demo"
}

Inputs

Name Description Type Default Required
log_group_prefix The log group prefix string "/aws/lambda" no
log_retention_in_days The number of days to retain the log events in the log group number 30 no
name Generic service name, used to name module resources string n/a yes
service The service principal for the role. Can be 'lambda' or 'states' string "lambda" no
vpc_permissions_enabled (Optional) Whether to enable VPC permissions for the execution role bool false no

Modules

No modules.

Outputs

Name Description
iam_role The aws_iam_role resource
log_group The aws_cloudwatch_log_group resource

Providers

Name Version
aws n/a

Requirements

Name Version
terraform ~> 1.3

Resources

Name Type
aws_cloudwatch_log_group.this resource
aws_iam_role.exec resource
aws_iam_role_policy.service_permissions resource
aws_iam_role_policy_attachment.cloudwatch_lambda_insights resource
aws_iam_role_policy_attachment.xray resource
aws_caller_identity.current data source
aws_iam_policy_document.log_permissions data source
aws_iam_policy_document.service_permissions data source
aws_iam_policy_document.service_trust data source
aws_iam_policy_document.vpc_permissions data source
aws_partition.current data source
aws_region.current data source

Authors

Andre Silva @andreswebs

License

This project is licensed under the Unlicense.