VM data sources
There are a couple of VM data sources:
fortiflexvm_VMS_list
You can get a list of existing VMs for a FortiFlex configuration using the fortiflexvm_vms_list
data source.
Example usage
The following is an example usage of fortiflexvm_vms_list
:
data "fortiflexvm_vms_list" "example" { config_id = 42 } output "my_vms_list"{ value = data.fortiflexvm_vms_list.example }
Argument reference
The following argument is required:
Argument |
Type |
Description |
---|---|---|
|
Number (Required) |
The ID of a FortiFlex configuration. |
Attribute reference
The following attributes are exported:
Attribute |
Type |
Description |
---|---|---|
|
String |
An ID for the resource. |
vms
|
List of objects |
A list of existing VMs using the specified FortiFlex configuration. |
The vms
block contains:
Attribute |
Type |
Description |
---|---|---|
|
Number |
The ID of the FortiFlex configuration that this VM used. |
description
|
String |
The description of the VM. |
|
String |
The VM end date. |
|
String |
The unique serial number of the VM. |
|
String |
The VM creation date. |
|
String |
The VM status, which can be |
|
String |
The VM token. |
|
String |
The status of the VM token, which can be |
fortiflexvm_vms_points
You can get the point usage for VMs using the fortiflexvm_vms_points
data source. It returns the total points consumed by one or more Virtual Machines in a data range.
Example usage
The following is an example usage of fortiflexvm_vms_points
:
data "fortiflexvm_vms_points" "example" { config_id = 42 start_date = "2022-11-25" end_date = "2022-03-07" } output "output1"{ value = data.fortiflexvm_vms_points.example }
Argument reference
The following arguments are required:
Argument |
Type |
Description |
---|---|---|
|
Number (Required) |
The ID of a FortiFlex configuration. |
|
String (Required) |
Specify an end date. Any format that satisfies ISO 8601 is accepted but the recommended format is |
|
String (Required) |
Specify a start date. Any format that satisfies ISO 8601 is accepted but the recommended format is |
Attribute reference
The following attributes are exported:
Attribute |
Type |
Description |
---|---|---|
|
String |
An ID for the resource. |
vms
|
List of objects |
A list of existing VMs using the specified FortiFlex configuration. |
The vms
block contains:
Attribute |
Type |
Description |
---|---|---|
|
Number |
The points consumed by this VM in the date range. |
|
String |
The unique serial number of the VM. |