CiscoISE / terraform-provider-ciscoise

Terraform Provider for Cisco ISE
https://registry.terraform.io/providers/CiscoISE/ciscoise/latest/docs
MIT License
10 stars 4 forks source link

Resource 'ciscoise_device_administration_policy_set' with single condition match returns multiple unsupported argument errors #69

Closed aussietexan closed 2 years ago

aussietexan commented 2 years ago

Environment: ISE version and patch: ISE 3.1 patch 4 Terraform version: 1.3.1 ISE provider version: 0.6.10-beta OS version: MacOS 12.6

Describe the bug When using the 'ciscoise_device_administration_policy_set' resource with a single condition match, it returns multiple 'unsupported argument' errors.

│ Error: Unsupported argument
│ 
│   on devadmin.tf line 108, in resource "ciscoise_device_administration_policy_set" "cisco-router":
│  108:       dictionary_name  = "DEVICE"
│ 
│ An argument named "dictionary_name" is not expected here.
╵
╷
│ Error: Unsupported argument
│ 
│   on devadmin.tf line 109, in resource "ciscoise_device_administration_policy_set" "cisco-router":
│  109:       attribute_name  = "Device Type"
│ 
│ An argument named "attribute_name" is not expected here.
╵
╷
│ Error: Unsupported argument
│ 
│   on devadmin.tf line 110, in resource "ciscoise_device_administration_policy_set" "cisco-router":
│  110:       operator = "equals"
│ 
│ An argument named "operator" is not expected here.
╵
╷
│ Error: Unsupported argument
│ 
│   on devadmin.tf line 111, in resource "ciscoise_device_administration_policy_set" "cisco-router":
│  111:       attribute_value = "All Device Types#IOS_XE Router"
│ 
│ An argument named "attribute_value" is not expected here.

Terraform code

resource "ciscoise_device_administration_policy_set" "cisco-router" {
  provider = ciscoise.ise31-2
  parameters {
    default     = "false"
    description = ""
    is_proxy    = "false"
    name         = "Cisco Router"
    rank         = 0
    service_name = "PAP_ASCII"
    state        = "enabled"
    condition {
      condition_type = "ConditionAttributes"
      is_negate = "false"
      dictionary_name  = "DEVICE"
      attribute_name  = "Device Type"
      operator = "equals"
      attribute_value = "All Device Types#IOS_XE Router"
    }
  }
}

Example POST OpenAPI call to '/device-admin/policy-set'

{
        "default": false,
        "name": "Cisco Router",
        "description": null,
        "rank": 0,
        "state": "enabled",
        "serviceName": "PAP_ASCII",
        "isProxy": false,
        "condition": {
            "conditionType": "ConditionAttributes",
            "isNegate": false,
            "dictionaryName": "DEVICE",
            "attributeName": "Device Type",
            "operator": "equals",
            "dictionaryValue": null,
            "attributeValue": "All Device Types#IOS_XE Router"
        }
    }

201 Created API response

{
    "version": "1.0.0",
    "response": {
        "default": false,
        "id": "9ef07a78-9fba-4bd6-9bc9-01ddcb85f188",
        "name": "Cisco Router",
        "description": null,
        "hitCounts": 0,
        "rank": 0,
        "state": "enabled",
        "condition": {
            "link": null,
            "conditionType": "ConditionAttributes",
            "isNegate": false,
            "dictionaryName": "DEVICE",
            "attributeName": "Device Type",
            "operator": "equals",
            "dictionaryValue": null,
            "attributeValue": "All Device Types#IOS_XE Router"
        },
        "serviceName": "PAP_ASCII",
        "isProxy": false,
        "link": {
            "rel": "self",
            "href": "https://ise31-2.ise.trappedunderise.com/api/v1/policy/device-admin/policy-set/9ef07a78-9fba-4bd6-9bc9-01ddcb85f188",
            "type": "application/json"
        }
    }
}
fmunozmiranda commented 2 years ago

@aussietexan , please try it with 0.6.11-beta and let us know if it is working for you.

fmunozmiranda commented 2 years ago

Hi @aussietexan , update us if it works for you or issue will be closed due inactivity in next 24 hours.

aussietexan commented 2 years ago

Hi @fmunozmiranda , I've confirmed that the resource creation works using the single matching condition as per the TF code block above. Please feel free to close this issue. Thanks