Fortinet white logo
Fortinet white logo

Administration Guide

VM data sources

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

config_id

Number (Required)

The ID of a FortiFlex configuration.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

id

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

config_id

Number

The ID of the FortiFlex configuration that this VM used.

description

String

The description of the VM.

end_date

String

The VM end date.

serial_number

String

The unique serial number of the VM.

start_date

String

The VM creation date.

status

String

The VM status, which can be PENDING, ACTIVE, STOPPED, or EXPIRED.

token

String

The VM token.

token_status

String

The status of the VM token, which can be NOTUSED or USED.

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

config_id

Number (Required)

The ID of a FortiFlex configuration.

end_date

String (Required)

Specify an end date. Any format that satisfies ISO 8601 is accepted but the recommended format is YYYY-MM-DD.

start_date

String (Required)

Specify a start date. Any format that satisfies ISO 8601 is accepted but the recommended format is YYYY-MM-DD.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

id

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

points

Number

The points consumed by this VM in the date range.

serial_number

String

The unique serial number of the VM.

VM data sources

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

config_id

Number (Required)

The ID of a FortiFlex configuration.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

id

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

config_id

Number

The ID of the FortiFlex configuration that this VM used.

description

String

The description of the VM.

end_date

String

The VM end date.

serial_number

String

The unique serial number of the VM.

start_date

String

The VM creation date.

status

String

The VM status, which can be PENDING, ACTIVE, STOPPED, or EXPIRED.

token

String

The VM token.

token_status

String

The status of the VM token, which can be NOTUSED or USED.

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

config_id

Number (Required)

The ID of a FortiFlex configuration.

end_date

String (Required)

Specify an end date. Any format that satisfies ISO 8601 is accepted but the recommended format is YYYY-MM-DD.

start_date

String (Required)

Specify a start date. Any format that satisfies ISO 8601 is accepted but the recommended format is YYYY-MM-DD.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

id

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

points

Number

The points consumed by this VM in the date range.

serial_number

String

The unique serial number of the VM.