Skip to content

A terraform module for setting up a Lambda that runs an ECR Image

Notifications You must be signed in to change notification settings

togethercomputer/tf-mod-ecr-image-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Lambda ECR Module

This module creates an ECR repository and Lambda function with image configuration. It's designed to work with CI/CD pipelines for image updates.

Requirements

Name Version
terraform >=1.7.0
aws >= 5.64.0

Providers

Name Version
aws 5.94.1

Modules

No modules.

Resources

Name Type
aws_cloudwatch_log_group.lambda_logs resource
aws_ecr_lifecycle_policy.lambda_repo resource
aws_ecr_repository.lambda_repo resource
aws_ecr_repository_policy.lambda_repo resource
aws_iam_policy.lambda_logging resource
aws_iam_role.lambda_role resource
aws_iam_role_policy.lambda_ecr_pull resource
aws_iam_role_policy_attachment.lambda_logs resource
aws_iam_role_policy_attachment.lambda_vpc resource
aws_lambda_function.function resource

Inputs

Name Description Type Default Required
ecr_repository_name Name of the ECR repository string n/a yes
encryption_type The encryption type to use for the repository. Valid values are AES256 or KMS string "AES256" no
environment_variables Environment variables for the Lambda function map(string) {} no
function_name Name of the Lambda function string n/a yes
image_tag_mutability The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE string "MUTABLE" no
initial_image_uri Initial image URI to use for Lambda function string "" no
log_retention_days Number of days to retain Lambda function logs number 14 no
memory_size Amount of memory in MB your Lambda Function can use at runtime number 128 no
non_release_image_retention_count The number of images to keep in the repository number 50 no
release_image_retention_count The number of images to keep in the repository with v-prefixed tags number 100 no
scan_on_push Indicates whether images are scanned after being pushed to the repository bool true no
security_group_ids List of security group IDs associated with the Lambda function (VPC) list(string) null no
subnet_ids List of subnet IDs associated with the Lambda function (VPC) list(string) null no
tags A map of tags to add to all resources map(string) {} no
timeout The amount of time your Lambda Function has to run in seconds number 30 no

Outputs

Name Description
cloudwatch_log_group_arn The ARN of the CloudWatch log group
cloudwatch_log_group_name The name of the CloudWatch log group
ecr_repository_arn The ARN of the ECR repository
ecr_repository_url The URL of the ECR repository
lambda_function_arn The ARN of the Lambda function
lambda_function_invoke_arn The invoke ARN of the Lambda function
lambda_function_name The name of the Lambda function
lambda_function_role_arn The ARN of the IAM role created for the Lambda function
lambda_function_role_name The name of the IAM role created for the Lambda function

About

A terraform module for setting up a Lambda that runs an ECR Image

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages