# Data Layer not updating in Lambda additional resource

**URL:** <https://discuss.hashicorp.com/t/data-layer-not-updating-in-lambda-additional-resource/56869>\
**Category:** AWS\
**Created:** [August 4, 2023, 5:13am UTC](https://discuss.hashicorp.com/t/data-layer-not-updating-in-lambda-additional-resource/56869 "2023-08-04T05:13:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sureshkumar-SJ](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/sureshkumar-sj/32/37200_2.png) [@sureshkumar-SJ](https://discuss.hashicorp.com/u/sureshkumar-SJ)\
**Post date:** [August 4, 2023, 5:13am UTC](https://discuss.hashicorp.com/t/data-layer-not-updating-in-lambda-additional-resource/56869/1 "2023-08-04T05:13:06Z")

</div>

resource “null\_resource” “example\_common\_node\_modules” {

```
triggers = {
  always_trigger = timestamp()
}

provisioner "local-exec" {
  working_dir = "${path.module}/../lambdas/dependency-layer"
  command = "npm install && mkdir -p nodejs && ls && cp -r node_modules nodejs/"
}

```

}

data “archive\_file” “example\_common\_node\_modules” {  
source\_dir = “{path.module}/../lambdas/dependency-layer" type = "zip" output\_path = "{path.module}/lambda-archive/dependency-layer.zip”

```
depends_on = [null_resource.example_common_node_modules]

```

}

resource “aws\_lambda\_layer\_version” “example\_common\_node\_modules” {  
filename = data.archive\_file.example\_common\_node\_modules.output\_path  
layer\_name = “${module.example\_label.id}-dependency-layer”

```
compatible_runtimes = ["nodejs16.x"]

```

}

When creating new layer with following packages

{  
“name”: “DependenciesLayer”,  
“version”: “0.1.0”,  
“main”: “index.js”,  
“dependencies”: {  
“uuid”: “^8.3.2”,  
“axios”: “^1.4.0”  
},  
“scripts”: {}  
}

its working fine. all node module package created.

**ISSUE**

while adding or removing package  
eg. “chart.js”: “^4.3.3”

In Data layer not updated. it showing again the older version of node module.  
chart js not added to node modules
