# Terraform - Lambda function unable to modify - Error: error modifying Lambda Function (lamda name)

**URL:** <https://discuss.hashicorp.com/t/terraform-lambda-function-unable-to-modify-error-error-modifying-lambda-function-lamda-name/44682>\
**Category:** AWS\
**Created:** [September 22, 2022, 11:36pm UTC](https://discuss.hashicorp.com/t/terraform-lambda-function-unable-to-modify-error-error-modifying-lambda-function-lamda-name/44682 "2022-09-22T23:36:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sutterhome1971](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/sutterhome1971/32/24045_2.png) [@sutterhome1971](https://discuss.hashicorp.com/u/sutterhome1971)\
**Post date:** [September 22, 2022, 11:36pm UTC](https://discuss.hashicorp.com/t/terraform-lambda-function-unable-to-modify-error-error-modifying-lambda-function-lamda-name/44682/1 "2022-09-22T23:36:54Z")

</div>

I have created a lambda successfully thru terraform script. But now when I run an apply it throws the following error:

```
      Error: error modifying Lambda Function (mylambda) configuration 
     : ValidationException: 
     status code: 400, request id: d6c28f7c-49b4-4edd-848e-a2a763242e09

```

This is the code:

```
            data "archive_file" "lambda_zip_mylambda" {
                   type = "zip"
                  source_dir = "./Packages/aaa/index"
                 excludes = [".gitkeep"]
                output_path = "./Packages/aaa/index/index.zip"
        }
              resource "aws_lambda_function" "mylambda" {
                      description = "-"
                    function_name = var.lambdafunctionname
                    handler = "lambda_handler"
                    runtime = "python3.8"
                      filename = data.archive_file.lambda_zip_mylambda.output_path
                  source_code_hash =   
                                 data.archive_file.lambda_zip_mylambda.output_base64sha256
                                role = var.lambda_role_arn
                                tags = var.lambdatags
                                timeout = 300
                                memory_size = 128
                     }

```
