NPM Download Terraform module
A simple Terraform module to download files distributed via npm .
The module requires that bash
and curl
are installed on the system where Terraform is executed.
module "npm_download" {
source = " milliHQ/download/npm"
module_name = " @millihq/tf-next-image-optimization"
module_version = " 11.1.2"
path_to_file = " dist.zip"
}
output "file_path" {
value = module. npm_download . abs_path
}
Name
Version
terraform
>= 0.13
external
>= 1.2.0
Name
Version
external
>= 1.2.0
Name
Description
Type
Default
Required
cdn_provider_url
The service that should be used for unpacking. jsdelivr or unpkg should work.
string
"https://cdn.jsdelivr.net/npm/"
no
local_cwd
Root path where node.resolve should start looking for the local module.
string
null
no
module_name
The name of the npm module.
string
n/a
yes
module_version
If you want a specific version (or semver range) of the module define it here.
string
""
no
path_to_file
The path inside of the npm module to the file you want to download.
string
n/a
yes
use_local
Fallback for using node.resolve for getting the module locally. Usually used for debug.
bool
false
no
Name
Description
abs_path
The absolute path to the downloaded file on the local file system.
rel_path
The cwd based relative path to the downloaded file on the local file system.
Apache-2.0 - see LICENSE for details.