Closed wiwa1978 closed 2 years ago
Hey @wiwa1978 do you have some screenshot of a valid API call? Could you pass it?
It works when using Swagger:
REQUEST:
RESPONSE
Cisco ISE UI
The equivalent using Terraform is in below code and gives the error:
resource "ciscoise_network_access_policy_set" "example" {
provider = ciscoise
parameters {
condition {
link = null
condition_type = "ConditionReference"
is_negate = false
name = "Wired_MAB"
id = "9aab0da7-e3e3-4cd7-81c2-18c3ebbe6a96"
description = "A condition to match MAC Authentication Bypass service based authentication requests from switches, according to the corresponding MAB attributes defined in the device profile."
}
description = "New Policy Set test 1"
is_proxy = "false"
link {
href = "https://{{ISE_IP}}/api/v1/policy/{{protocol}}/policy-set/{{resource-id}}"
rel = "self"
type = "application/json"
}
name = "New Policy Set 1"
rank = 0
service_name = "Default Network Access"
state = "disabled"
}
}
The above Terraform snippet gives the following response:
terraform apply
╷
│ Error: Unsupported argument
│
│ on network_access_policy_set.tf line 16, in resource "ciscoise_network_access_policy_set" "example":
│ 16: name = "Wired_MAB"
│
│ An argument named "name" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│ on network_access_policy_set.tf line 17, in resource "ciscoise_network_access_policy_set" "example":
│ 17: id = "9aab0da7-e3e3-4cd7-81c2-18c3ebbe6a96"
│
│ An argument named "id" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│ on network_access_policy_set.tf line 18, in resource "ciscoise_network_access_policy_set" "example":
│ 18: description = "A condition to match MAC Authentication Bypass service based authentication requests from switches, according to the corresponding MAB attributes defined in the device profile."
│
│ An argument named "description" is not expected here.
Hi @wiwa1978, there's new provider version (v0.6.7) try this again and let us know if it works for you. Here's a valid, terraform file to this resource:
resource "ciscoise_network_access_policy_set" "example" {
provider = ciscoise
parameters {
condition {
condition_type = "ConditionReference"
id = "898c705e-d80c-4c88-bc2a-f0900488e430"
is_negate = "false"
name = "My New Condition"
}
default = "false"
description = "New Policy Set test 1"
hit_counts = 0
is_proxy = "false"
name = "New Policy Set 1"
rank = 0
service_name = "Default Network Access"
state = "disabled"
}
}
Note:
link
is computed, so you don't have to include it.It works using 0.6.7. I found another issue though which I added as a new issue in Github (issue #53). This issue can be closed.
Prerequisites
Describe the bug When using
ciscoise_network_access_policy_set
resource, Terraform outputs that id and name are not expected.Results in:
If I remove id and name from the condition, then I would get:
Expected behavior As per documentation, the id and name are expected attributes, even though they are optional. They should be accepted if passed along.
Environment (please complete the following information):