Skip to content

Instantly share code, notes, and snippets.

@hendrixroa
Created March 23, 2023 20:20
Show Gist options
  • Save hendrixroa/9ac934550b23a53a7040d4a52732b9c0 to your computer and use it in GitHub Desktop.
Save hendrixroa/9ac934550b23a53a7040d4a52732b9c0 to your computer and use it in GitHub Desktop.
Null resource terraform to packaging node modules given a package.json
resource "null_resource" "main" {
triggers = {
updated_at = timestamp()
}
provisioner "local-exec" {
command = <<EOF
yarn config set no-progress
yarn
mkdir -p nodejs
cp -r node_modules nodejs/
rm -r node_modules
EOF
working_dir = "${path.module}/${var.code_location}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment