-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Is there a way to extract the install preview using the provider? I've tried using the security console resources below - although the install preview task is successful in FortiManager, I can't see a way to get the results as an output.
resource "fortimanager_securityconsole_install_package" "install" {
fmgadom = "testadom"
pkg = "aws"
flags = ["preview"]
force_recreate = uuid()
scope {
name = "testfg1"
vdom = "root"
}
}
resource "fortimanager_securityconsole_install_preview" "preview" {
fmgadom = "testadom"
flags = ["none"]
force_recreate = uuid()
scope {
name = "testfg1"
vdom = "root"
}
}Reviewing https://community.fortinet.com/t5/FortiManager/Technical-Tip-How-to-install-preview-and-review-the-output-of/ta-p/301325 it seems there isn't a securityconsole resource for the final step calling /securityconsole/preview/result
I've tried using a generic api resource to for this API call but it's failing:
resource "time_sleep" "wait_30s" {
create_duration = "30s"
triggers = {
preview_id = fortimanager_securityconsole_install_preview.preview.id
}
}
resource "fortimanager_json_generic_api" "result" {
json_content = <<JSON
{
"id": 1,
"method": "exec",
"params": [
{
"data": {
"adom": "testadom",
"device": "testfg1"
},
"url": "/securityconsole/preview/result"
}
],
"verbose": 1
}
JSON
depends_on = [fortimanager_securityconsole_install_preview.preview, time_sleep.wait_30s]
}Apply result:
fortimanager_json_generic_api.result: Creating...
╷
│ Error: Error createGeneric:
│ err -1: runtime error 0: invalid value
│
│ with fortimanager_json_generic_api.result,
│ on main.tf line 106, in resource "fortimanager_json_generic_api" "result":
│ 106: resource "fortimanager_json_generic_api" "result" {
│
╵
Is there a different way I should be doing this? The provider documentation is unclear.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels