Skip to main content
Knowledge Base

How can I use lambda with docker images

Answer

Hi, I'm looking for an example of how to use lambda with docker images. I went through the different examples here https://github.com/gruntwork-io/terraform-aws-lambda/tree/master/examples but I wasn't able to find one, could you please point me to one of them if it exists? (I barely remember seeing it in your public docs on the GW website, but I can't find it either now) Thanks.

Hi, Not exactly, we finally went with this: ``` terraform { source = "git@github.com:gruntwork-io/terraform-aws-lambda.git//modules/lambda" } inputs = { name = "lambda-service-sls-backend-sample" memory_size = 512 timeout = 30 package_type = "Image" image_uri = "SHARED_ACCOUNT_ID_HERE.dkr.ecr.sa-east-1.amazonaws.com/br/backend/sample:dev" cloudwatch_log_group_retention_in_days = 365 } ``` But we're getting this error: ``` Error: error creating Lambda Function (1): AccessDeniedException: │ status code: 403, request id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx │ │ with aws_lambda_function.function[0], │ on main.tf line 39, in resource "aws_lambda_function" "function": │ 39: resource "aws_lambda_function" "function" { ``` Any idea what's going on? Thanks.