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
Name | Required / Optional | Type | Description | ||
---|---|---|---|---|---|
policy_id | Required | String | Policy ID | ||
group_ids | Required | Array of strings | List of IDs of resource and device groups The default is an empty array. | ||
resource_ids | Required | Array of strings | List of IDs of resource managers and managed devices The default is an empty array. | ||
overwrite | Required | Boolean | Indicates whether the policy for the platform is changed if another policy is assigned to that platform. This can be one of the following values.
|
Outputs
Name | Type | Description | ||
---|---|---|---|---|
id | String | Job ID | ||
status | String | Message 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"
}
Give feedback