Skip to main content

Assigning an update-compliance policy to a group of resources

Uses this definition to assign an update-compliance policy to a group of resources.

A job is created to complete this request.

Usage

resource "lxco_firmware" "assignPolicy" {
policy_action = "assignPolicy"
group_ids = array of strings
resource_ids = array of strings
overwrite = BBoolean
policy_id = string
}

output "assignPolicy" {
value = lxco_firmware.assignPolicy
}

Example

The following example assigns a policy to a group of serves and a specific server.
terraform {
required_providers {
lxco = {
version = "0.1"
source = "lenovo.com/xclarity/lxco"
}
}
}

provider "lxco" {
host = "192.0.2.0"
# username = ""
# password = ""
}

# Assign a firmware-compliance policy, and return the results
resource "lxco_firmware" "assignPolicy" {
policy_action = "assignPolicy"
group_ids = ["G_E261C2F34895442482F7D638BA40F964"]
resource_ids = ["80CE6AB8FF7D11E685CB819F6B26BCF8-C3B280177A194899B5C122118EDFB944"]
overwrite = true
policy_id = "1631709885143"
}

output "assignPolicy" {
value = lxco_firmware.assignPolicy
}

Inputs

NameRequired / OptionalTypeDescription
policy_idRequiredStringPolicy ID
group_idsRequiredArray of stringsList of IDs of resource and device groups

The default is an empty array.

resource_idsRequiredArray of stringsList of IDs of resource managers and managed devices

The default is an empty array.

overwriteRequiredBooleanIndicates whether the policy for the platform is changed if another policy is assigned to that platform. This can be one of the following values.
  • true. If another policy is assigned to the platform, the policy is changed.
  • false. (default) If another policy is assigned to the platform, the policy is not changed.

Outputs

NameTypeDescription
idStringJob ID
statusStringMessage about the status of the action
The following example is returned if the request is successful.
{
"id": "125",
"status": "The job was created successfully. The job was launched in the
orchestrator server and will be run asynchronously. Job ID: 125"
}