corey-cole / terraform-lambda-insights-lookup

Terraform module that provides AWS Lambda Insights layer lookup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lambda Insights Layer Lookup

The AWS Lambda Insights layer ARN varies by target region. This data-only module provides an easy lookup source. The underlying lookup data can be found in the Amazon CloudWatch User Guide

Example

The example below assumes the use of the Lambda resource from the AWS provider.

module "lambda_insights_layer" {
  source = "github.com/corey-cole/terraform-lambda-insights-lookup"

  region = "us-west-2"
}

resource "aws_lambda_function" "example" {
  # ... other configuration ...
  layers = [module.lambda_insights_layer.layer_arn]
}

resource "aws_iam_role_policy_attachment" "attach_insights_policy" {
    role = # The role used for the Lambda function
    policy_arn = module.lambda_insights_layer.policy_arn
}

Limitations

  1. Not all regions have the ARM64 layer.
  2. The managed policy ARN uses the default partition separator ("aws"). If your partition is different, update the value as appropriate.

About

Terraform module that provides AWS Lambda Insights layer lookup

License:MIT License


Languages

Language:HCL 67.1%Language:Go 32.9%