Closed Priyanka-Chatterjee-2000 closed 8 months ago
A pipeline to generate the same error.
pipeline "scan_url" {
title = "Submit a URL for scanning"
description = "Submit a URL for scanning by VirusTotal."
param "api_key" {
type = string
description = "VirusTotal API key"
default = var.api_key
}
param "url" {
type = string
description = "URL to scan"
default = var.url
}
step "http" "scan_url" {
title = "Scan url"
description = "Submit a URL to VirusTotal for scanning."
# curl --request POST \
# --url https://www.virustotal.com/api/v3/urls \
# --form url=<Your URL here>
# --header 'x-apikey: <your API key>'
insecure = "false"
url = "https://www.virustotal.com/api/v3/urls"
method = "post"
request_timeout_ms = 20000
request_body = "url=${parm.url}"
request_headers = {
x-apikey = "${var.api_key}"
Content-Type : "application/x-www-form-urlencoded"
}
}
output "status_code" {
value = step.http.list_issues.status_code
}
}
Changing request_body = "url=${parm.url}"
to request_body = "url=${param.url}"
resolve the panic: runtime error: index out of range [2] with length 2
error.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.
This issue was closed because it has been stalled for 90 days with no activity.
Verified in v0.3 main this issue is no longer valid. We have the following parse error:
Bad Request: invalid property path: pram.name
if there's an invalid reference to param/resources.