Fortinet black logo

Administration Guide

Group data sources

Group data sources

There are a couple of FortiFlex group data sources:

fortiflexvm_groups_list

Use the fortiflexvm_groups_list data source to get a list of FortiFlex groups. The data source returns a list of asset folders that have FortiFlex products in them.

Example usage

The following is an example usage of fortiflexvm_groups_list:

data "fortiflexvm_groups_list" "example" {
}

output "my_groups_list"{
    value = data.fortiflexvm_groups_list.example
}

Argument reference

There is no argument required.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

groups

List of objects

The list of groups.

id

String

An ID for the resource.

The groups block contains:

Attribute

Type

Description

available_tokens

Number

The number of available tokens in the group.

folder_path

String

The folder path of the group.

used_tokens

Number

The number of tokens used in the group.

fortiflexvm_groups_nexttoken

Use the fortiflexvm_groups_nexttoken data source to get the next available, unused token. The data source returns the first available token by asset folder or configuration ID.

Example usage

The following is an example usage of fortiflexvm_groups_nexttoken:

data "fortiflexvm_groups_nexttoken" "example" {
    config_id = 42
    folder_path = "My Assets"
}

output "output1"{
    value = data.fortiflexvm_groups_nexttoken.example
}

Argument reference

The following arguments are supported:

Argument

Type

Description

config_id

Number (Optional)

The ID of a FortiFlex configuration.

folder_path

String (Optional)

The folder path.

Note

Although both arguments are optional, you must specify at least one argument to get the result.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

id

String

An ID for the resource.

vms

List of objects

One Virtual Machine with an unused token.

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.

Group data sources

There are a couple of FortiFlex group data sources:

fortiflexvm_groups_list

Use the fortiflexvm_groups_list data source to get a list of FortiFlex groups. The data source returns a list of asset folders that have FortiFlex products in them.

Example usage

The following is an example usage of fortiflexvm_groups_list:

data "fortiflexvm_groups_list" "example" {
}

output "my_groups_list"{
    value = data.fortiflexvm_groups_list.example
}

Argument reference

There is no argument required.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

groups

List of objects

The list of groups.

id

String

An ID for the resource.

The groups block contains:

Attribute

Type

Description

available_tokens

Number

The number of available tokens in the group.

folder_path

String

The folder path of the group.

used_tokens

Number

The number of tokens used in the group.

fortiflexvm_groups_nexttoken

Use the fortiflexvm_groups_nexttoken data source to get the next available, unused token. The data source returns the first available token by asset folder or configuration ID.

Example usage

The following is an example usage of fortiflexvm_groups_nexttoken:

data "fortiflexvm_groups_nexttoken" "example" {
    config_id = 42
    folder_path = "My Assets"
}

output "output1"{
    value = data.fortiflexvm_groups_nexttoken.example
}

Argument reference

The following arguments are supported:

Argument

Type

Description

config_id

Number (Optional)

The ID of a FortiFlex configuration.

folder_path

String (Optional)

The folder path.

Note

Although both arguments are optional, you must specify at least one argument to get the result.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

id

String

An ID for the resource.

vms

List of objects

One Virtual Machine with an unused token.

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.