Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Terraform Lambda function configuration changes

I want to create a lambda function with terraform. But the standard timeout for a lambda function is set at 3 sec and my function takes longer then this to execute.
enter image description here
I know you can just change the configuration for this but my question is how and if you can do this in terraform. My current file to create the lambda function looks like this.

resource "aws_lambda_function" "etl_pipeline_test" {
  function_name = var.project_name
  image_uri = "${var.ecr_repo_uri}:${var.image_tag}"
  package_type = "Image"
  role = var.execution_role_arn
}

I fairly new to terraform and AWS but could it also be possible that you define this timeout in a policy of some sort, I looked but did not find anything so my best guess is still at terraform.
All help is greatly appreciated.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

aws_lambda_function has a timeout argument:

resource "aws_lambda_function" "etl_pipeline_test" {
  function_name = var.project_name
  image_uri = "${var.ecr_repo_uri}:${var.image_tag}"
  package_type = "Image"
  role = var.execution_role_arn

  timeout = 60
}

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading