Fortinet black logo

Administration Guide

Entitlement resources

Entitlement resources

There are several of FortiFlex entitlement resources:

fortiflexvm_entitlements_cloud

Use the fortiflexvm_entitlements_cloud resource to create and update a cloud entitlement based on a configuration.

Example usage

The following is an example usage of fortiflexvm_entitlements_cloud:

resource "fortiflexvm_config" "example"{
  product_type = "FC_EMS_CLOUD"
  program_serial_number = "ELAVMS0000xxxxxx"
  name = "FC_EMS_OP_template"
  fc_ems_cloud {
    ztna_num = 225                # Value should be divisible by 25. Number between 0 and 25000 (inclusive)
    ztna_fgf_num = 225            # Value should be divisible by 25. Number between 0 and 25000 (inclusive)
    epp_ztna_num = 125            # Value should be divisible by 25. Number between 0 and 25000 (inclusive)
    epp_ztna_fgf_num = 125        # Value should be divisible by 25. Number between 0 and 25000 (inclusive)
    chromebook = 100              # Value should be divisible by 25. Number between 0 and 25000 (inclusive) 
    addons = ["BPS"]              # [] or ["BPS"]
  }
  status = "ACTIVE"
}

# Each account can create at most one entitlement for each cloud product.
resource "fortiflexvm_entitlements_cloud" "example"{ 
  config_id = fortiflexvm_config.example.id
  description = "Use v2 terraform" # Optional.
  end_date = "2023-12-12T00:00:00" # Optional. If not set or empty "", it will use the program's end date automatically.
  folder_path = "My Assets/v2" # Optional. If not set, new VM will be in "My Assets"
  # status = "ACTIVE" # Optional, It has many restrictions. Not recommended to set it manually.
}
output "new_entitlement"{
    value = fortiflexvm_entitlements_cloud.example
}

Argument reference

The following argument is required:

Attribute

Type

Description

account_id

Number (Optional)

The account ID.

config_id

Number (Required)

The ID of the FortiFlex configuration.

description

String (Optional)

The description of the entitlement.

end_date

String (Optional)

The Cloud entitlement end date. Any format that satisfies ISO 8601 is accepted but the recommended format is YYYY-MM-DDThh:mm:ss. It cannot be before today's date or after the program's end date. If not specified, it will use the program end date.

folder_path

String (Optional)

The folder path of the cloud entitlement. If not specified, it will be in My Assets.

status

String (Optional)

The entitlement status, which can be ACTIVE or STOPPED. It is not recommended to set this manually.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

account_id

Number

The account ID.

id

String

The ID of the resource. Its value will be {serial_number}.{config_id}.

serial_number

String

The ID of the Cloud entitlement.

start_date

String

The Cloud entitlement start date in the format YYYY-MM-DDThh:mm:ss.sss.

status

String

The entitlement status, which can be PENDING, ACTIVE, EXPIRED, or STOPPED. It can be set as ACTIVE or STOPPED manually.

Import

To import a cloud entitlement:
terraform import fortiflexvm_entitlements_cloud.labelname {{serial_number}}.{{config_id}}
# For example: terraform import fortiflexvm_entitlements_cloud.example FEMSPO8823000143.3196

fortiflexvm_entitlements_hardware

Use the fortiflexvm_entitlements_hardware resource to create and update a hardware entitlement based on a configuration.

Example usage

The following is an example usage of fortiflexvm_entitlements_hardware:

resource "fortiflexvm_entitlements_hardware" "example"{ 
  config_id = 5010
  end_date = "2023-11-12T00:00:00" # Optional. If not set, it will use the program end date automatically.
  # status = "ACTIVE" # "ACTIVE" or "STOPPED". Optional. It has many restrictions. Not recommended to set it manually.
}
output "new_entitlement_hw"{
    value = fortiflexvm_entitlements_hardware.example
}

Argument reference

The following arguments are supported:

Attribute

Type

Description

config_id

Number (Required)

The ID of the FortiFlex configuration.

description

String (Optional)

The description of the entitlement.

end_date

String (Optional)

The hardware entitlement end date. Any format that satisfies ISO 8601 is accepted but the recommended format is YYYY-MM-DDThh:mm:ss. It cannot be before today's date or after the program's end date. If not specified, it will use the program end date.

status

String (Optional)

The entitlement status, which can be ACTIVE or STOPPED. It is not recommended to set this manually.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

account_id

Number

The account ID.

id

String

The ID of the resource. Its value will be {serial_number}.{config_id}.

serial_number

String

The ID of the hardware entitlement.

start_date

String

The hardware entitlement start date in the format YYYY-MM-DDThh:mm:ss.sss.

status

String

The entitlement status, which can be PENDING, ACTIVE, EXPIRED, or STOPPED. It can be set as ACTIVE or STOPPED manually.

Import

To import a hardware entitlement:
terraform import fortiflexvm_entitlements_hardware.labelname {{serial_number}}.{{config_id}}
# For example: terraform import fortiflexvm_entitlements_hardware.example FGT70FTK22000001.5010

fortiflexvm_entitlements_vm

Use the fortiflexvm_entitlements_vm resource to create and update a VM entitlement based on a configuration.

Example usage

The following is an example usage of fortiflexvm_entitlements_vm:

resource "fortiflexvm_entitlements_vm" "example"{ 
  config_id = 3196
  description = "Your description" # Optional.
  end_date = "2023-11-12T00:00:00" # Optional. If not set, it will use the program end date automatically.
  # folder_path = "My Assets" # Optional. If not set, new VM will be in "My Assets"
  # status = "ACTIVE" # "ACTIVE" or "STOPPED". Optional. It has many restrictions. Not recommended to set it manually.
}
output "new_entitlement"{
    value = fortiflexvm_entitlements_vm.example
}
output "new_entitlement_token"{
    value = fortiflexvm_entitlements_vm.example.token
}

Argument reference

The following arguments are supported:

Attribute

Type

Description

account_id

Number (Optional)

The account ID.

config_id

Number (Required)

The ID of the FortiFlex configuration.

description

String (Optional)

The description of the entitlement.

end_date

String (Optional)

The hardware entitlement end date. Any format that satisfies ISO 8601 is accepted but the recommended format is YYYY-MM-DDThh:mm:ss. It cannot be before today's date or after the program's end date. If not specified, it will use the program end date.

folder_path

String (Optional)

The folder path of the VM. If not set, the new VM will be in My Assets.

status

String (Optional)

The entitlement status, which can be ACTIVE or STOPPED. It is not recommended to set this manually.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

account_id

Number

The account ID.

id

String

The ID of the resource. Its value will be {serial_number}.{config_id}.

serial_number

String

The ID of the VM entitlement.

start_date

String

The VM entitlement start date in the format YYYY-MM-DDThh:mm:ss.sss.

status

String

The entitlement status, which can be PENDING, ACTIVE, EXPIRED, or STOPPED. It can be set as ACTIVE or STOPPED manually.

token

String

The token of the VM entitlement.

token_status

String

The status of the token, either "NOTUSED" or "USED".

Import

To import a VM entitlement:
terraform import fortiflexvm_entitlements_vm.labelname {{serial_number}}.{{config_id}}
# For example: terraform import fortiflexvm_entitlements_vm.example FGVMMLTM23001273.3196

fortiflexvm_entitlements_vm_token

Use the fortiflexvm_entitlements_vm_token resource to regenerate a token for a VM.

Example usage

The following is an example usage of fortiflexvm_entitlements_vm_token:

resource "fortiflexvm_entitlements_vm_token" "example"{ 
  config_id = 3196
  serial_number = "FGVMMLTM23001325"
  regenerate_token = true # If set as false, the provider would only provide the token and not regenerate the token.
}
output "entitlement_token"{
    value = fortiflexvm_entitlements_vm_token.example.token
}

Argument reference

The following arguments are supported:

Attribute

Type

Description

config_id

Number (Required)

The ID of the FortiFlex configuration.

serial_number

String (Required)

The ID of the VM entitlement.

regenerate_token

Boolean (Required)

Determines whether to regenerate a token or not. When it is true, every time terraform apply is run, the system will generate a new token for your VM entitlement. Set it to false if you do not want to regenerate the token anymore.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

account_id

Number

The account ID.

id

String

The ID of the resource. Its value will be {serial_number}.{config_id}.

token

String

The token of the VM entitlement.

token_status

String

The status of the token, either "NOTUSED" or "USED".

Import

To import a VM token:
terraform import fortiflexvm_entitlements_vm_token.labelname {{serial_number}}.{{config_id}}
# For example: terraform import fortiflexvm_entitlements_vm_token.example FGVMMLTM23001325.3196

Entitlement resources

There are several of FortiFlex entitlement resources:

fortiflexvm_entitlements_cloud

Use the fortiflexvm_entitlements_cloud resource to create and update a cloud entitlement based on a configuration.

Example usage

The following is an example usage of fortiflexvm_entitlements_cloud:

resource "fortiflexvm_config" "example"{
  product_type = "FC_EMS_CLOUD"
  program_serial_number = "ELAVMS0000xxxxxx"
  name = "FC_EMS_OP_template"
  fc_ems_cloud {
    ztna_num = 225                # Value should be divisible by 25. Number between 0 and 25000 (inclusive)
    ztna_fgf_num = 225            # Value should be divisible by 25. Number between 0 and 25000 (inclusive)
    epp_ztna_num = 125            # Value should be divisible by 25. Number between 0 and 25000 (inclusive)
    epp_ztna_fgf_num = 125        # Value should be divisible by 25. Number between 0 and 25000 (inclusive)
    chromebook = 100              # Value should be divisible by 25. Number between 0 and 25000 (inclusive) 
    addons = ["BPS"]              # [] or ["BPS"]
  }
  status = "ACTIVE"
}

# Each account can create at most one entitlement for each cloud product.
resource "fortiflexvm_entitlements_cloud" "example"{ 
  config_id = fortiflexvm_config.example.id
  description = "Use v2 terraform" # Optional.
  end_date = "2023-12-12T00:00:00" # Optional. If not set or empty "", it will use the program's end date automatically.
  folder_path = "My Assets/v2" # Optional. If not set, new VM will be in "My Assets"
  # status = "ACTIVE" # Optional, It has many restrictions. Not recommended to set it manually.
}
output "new_entitlement"{
    value = fortiflexvm_entitlements_cloud.example
}

Argument reference

The following argument is required:

Attribute

Type

Description

account_id

Number (Optional)

The account ID.

config_id

Number (Required)

The ID of the FortiFlex configuration.

description

String (Optional)

The description of the entitlement.

end_date

String (Optional)

The Cloud entitlement end date. Any format that satisfies ISO 8601 is accepted but the recommended format is YYYY-MM-DDThh:mm:ss. It cannot be before today's date or after the program's end date. If not specified, it will use the program end date.

folder_path

String (Optional)

The folder path of the cloud entitlement. If not specified, it will be in My Assets.

status

String (Optional)

The entitlement status, which can be ACTIVE or STOPPED. It is not recommended to set this manually.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

account_id

Number

The account ID.

id

String

The ID of the resource. Its value will be {serial_number}.{config_id}.

serial_number

String

The ID of the Cloud entitlement.

start_date

String

The Cloud entitlement start date in the format YYYY-MM-DDThh:mm:ss.sss.

status

String

The entitlement status, which can be PENDING, ACTIVE, EXPIRED, or STOPPED. It can be set as ACTIVE or STOPPED manually.

Import

To import a cloud entitlement:
terraform import fortiflexvm_entitlements_cloud.labelname {{serial_number}}.{{config_id}}
# For example: terraform import fortiflexvm_entitlements_cloud.example FEMSPO8823000143.3196

fortiflexvm_entitlements_hardware

Use the fortiflexvm_entitlements_hardware resource to create and update a hardware entitlement based on a configuration.

Example usage

The following is an example usage of fortiflexvm_entitlements_hardware:

resource "fortiflexvm_entitlements_hardware" "example"{ 
  config_id = 5010
  end_date = "2023-11-12T00:00:00" # Optional. If not set, it will use the program end date automatically.
  # status = "ACTIVE" # "ACTIVE" or "STOPPED". Optional. It has many restrictions. Not recommended to set it manually.
}
output "new_entitlement_hw"{
    value = fortiflexvm_entitlements_hardware.example
}

Argument reference

The following arguments are supported:

Attribute

Type

Description

config_id

Number (Required)

The ID of the FortiFlex configuration.

description

String (Optional)

The description of the entitlement.

end_date

String (Optional)

The hardware entitlement end date. Any format that satisfies ISO 8601 is accepted but the recommended format is YYYY-MM-DDThh:mm:ss. It cannot be before today's date or after the program's end date. If not specified, it will use the program end date.

status

String (Optional)

The entitlement status, which can be ACTIVE or STOPPED. It is not recommended to set this manually.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

account_id

Number

The account ID.

id

String

The ID of the resource. Its value will be {serial_number}.{config_id}.

serial_number

String

The ID of the hardware entitlement.

start_date

String

The hardware entitlement start date in the format YYYY-MM-DDThh:mm:ss.sss.

status

String

The entitlement status, which can be PENDING, ACTIVE, EXPIRED, or STOPPED. It can be set as ACTIVE or STOPPED manually.

Import

To import a hardware entitlement:
terraform import fortiflexvm_entitlements_hardware.labelname {{serial_number}}.{{config_id}}
# For example: terraform import fortiflexvm_entitlements_hardware.example FGT70FTK22000001.5010

fortiflexvm_entitlements_vm

Use the fortiflexvm_entitlements_vm resource to create and update a VM entitlement based on a configuration.

Example usage

The following is an example usage of fortiflexvm_entitlements_vm:

resource "fortiflexvm_entitlements_vm" "example"{ 
  config_id = 3196
  description = "Your description" # Optional.
  end_date = "2023-11-12T00:00:00" # Optional. If not set, it will use the program end date automatically.
  # folder_path = "My Assets" # Optional. If not set, new VM will be in "My Assets"
  # status = "ACTIVE" # "ACTIVE" or "STOPPED". Optional. It has many restrictions. Not recommended to set it manually.
}
output "new_entitlement"{
    value = fortiflexvm_entitlements_vm.example
}
output "new_entitlement_token"{
    value = fortiflexvm_entitlements_vm.example.token
}

Argument reference

The following arguments are supported:

Attribute

Type

Description

account_id

Number (Optional)

The account ID.

config_id

Number (Required)

The ID of the FortiFlex configuration.

description

String (Optional)

The description of the entitlement.

end_date

String (Optional)

The hardware entitlement end date. Any format that satisfies ISO 8601 is accepted but the recommended format is YYYY-MM-DDThh:mm:ss. It cannot be before today's date or after the program's end date. If not specified, it will use the program end date.

folder_path

String (Optional)

The folder path of the VM. If not set, the new VM will be in My Assets.

status

String (Optional)

The entitlement status, which can be ACTIVE or STOPPED. It is not recommended to set this manually.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

account_id

Number

The account ID.

id

String

The ID of the resource. Its value will be {serial_number}.{config_id}.

serial_number

String

The ID of the VM entitlement.

start_date

String

The VM entitlement start date in the format YYYY-MM-DDThh:mm:ss.sss.

status

String

The entitlement status, which can be PENDING, ACTIVE, EXPIRED, or STOPPED. It can be set as ACTIVE or STOPPED manually.

token

String

The token of the VM entitlement.

token_status

String

The status of the token, either "NOTUSED" or "USED".

Import

To import a VM entitlement:
terraform import fortiflexvm_entitlements_vm.labelname {{serial_number}}.{{config_id}}
# For example: terraform import fortiflexvm_entitlements_vm.example FGVMMLTM23001273.3196

fortiflexvm_entitlements_vm_token

Use the fortiflexvm_entitlements_vm_token resource to regenerate a token for a VM.

Example usage

The following is an example usage of fortiflexvm_entitlements_vm_token:

resource "fortiflexvm_entitlements_vm_token" "example"{ 
  config_id = 3196
  serial_number = "FGVMMLTM23001325"
  regenerate_token = true # If set as false, the provider would only provide the token and not regenerate the token.
}
output "entitlement_token"{
    value = fortiflexvm_entitlements_vm_token.example.token
}

Argument reference

The following arguments are supported:

Attribute

Type

Description

config_id

Number (Required)

The ID of the FortiFlex configuration.

serial_number

String (Required)

The ID of the VM entitlement.

regenerate_token

Boolean (Required)

Determines whether to regenerate a token or not. When it is true, every time terraform apply is run, the system will generate a new token for your VM entitlement. Set it to false if you do not want to regenerate the token anymore.

Attribute reference

The following attributes are exported:

Attribute

Type

Description

account_id

Number

The account ID.

id

String

The ID of the resource. Its value will be {serial_number}.{config_id}.

token

String

The token of the VM entitlement.

token_status

String

The status of the token, either "NOTUSED" or "USED".

Import

To import a VM token:
terraform import fortiflexvm_entitlements_vm_token.labelname {{serial_number}}.{{config_id}}
# For example: terraform import fortiflexvm_entitlements_vm_token.example FGVMMLTM23001325.3196