Skip to content

Commit d5a93e4

Browse files
Add remaining update rank resources (#83)
1 parent fa93166 commit d5a93e4

File tree

87 files changed

+5520
-41
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+5520
-41
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
subcategory: "Guides"
3+
page_title: "Authentication Rules"
4+
description: |-
5+
Authentication Rules
6+
---
7+
8+
# Authentication Rules
9+
10+
This example demonstrates how the provider can be used to configure a network access authentication rules. The full example can be found here: [https://github.com/CiscoDevNet/terraform-provider-ise/tree/main/examples/basic/authentication_rules](https://github.com/CiscoDevNet/terraform-provider-ise/tree/main/examples/basic/authentication_rules)
11+
12+
First of all we need to add the necessary provider configuration to the Terraform configuration file:
13+
14+
```hcl
15+
terraform {
16+
required_providers {
17+
ise = {
18+
source = "CiscoDevNet/ise"
19+
}
20+
}
21+
}
22+
23+
provider "ise" {
24+
username = "admin"
25+
password = "password"
26+
url = "https://10.1.1.1"
27+
}
28+
```
29+
30+
Next we add the configuration for a network access policy set, under which we will later configure authentication rules.
31+
32+
```hcl
33+
resource "ise_network_access_policy_set" "policy_set_1" {
34+
name = "PolicySet1"
35+
description = "My first policy set"
36+
rank = 0
37+
service_name = "Default Network Access"
38+
condition_type = "ConditionAttributes"
39+
condition_attribute_name = "Location"
40+
condition_attribute_value = "All Locations"
41+
condition_dictionary_name = "DEVICE"
42+
condition_operator = "equals"
43+
}
44+
```
45+
46+
Next we add the configuration for the authentication rules. We make use of `network_access_authentication_rule` and `network_access_authentication_rule_update_rank` resources. The first resource manages all fields except for the rank, while the second resource specifically updates the rank field. This is a workaround for the ISE API/Backend limitation that enforces strictly incremental rank assignments. By using both resources, you can bypass this limitation. The network_access_authentication_rule_update_rank resource performs a PUT operation to update the rank and only tracks that field. When destroyed, it is simply removed from the state without affecting the ISE configuration. This ensures the correct sequence of resource configuration.
47+
48+
```hcl
49+
locals {
50+
rules = [
51+
{ name = "rule_0" },
52+
{ name = "rule_1" },
53+
{ name = "rule_2" },
54+
{ name = "rule_3" },
55+
{ name = "rule_4" },
56+
{ name = "rule_5" }
57+
]
58+
}
59+
60+
locals {
61+
rules_with_ranks = [
62+
for idx, rule in local.rules : merge(rule, {
63+
rank = idx
64+
})
65+
]
66+
}
67+
68+
resource "ise_network_access_authentication_rule" "auth_rule" {
69+
for_each = { for rule in local.rules_with_ranks : rule.name => rule }
70+
policy_set_id = ise_network_access_policy_set.policy_set_1.id
71+
name = each.value.name
72+
default = false
73+
state = "enabled"
74+
condition_type = "ConditionAttributes"
75+
condition_is_negate = false
76+
condition_attribute_name = "Location"
77+
condition_attribute_value = "All Locations"
78+
condition_dictionary_name = "DEVICE"
79+
condition_operator = "equals"
80+
identity_source_name = "Internal Endpoints"
81+
if_auth_fail = "REJECT"
82+
if_process_fail = "DROP"
83+
if_user_not_found = "REJECT"
84+
}
85+
86+
resource "ise_network_access_authentication_rule_update_rank" "example_with_rank" {
87+
for_each = { for rule in local.rules_with_ranks : rule.name => rule }
88+
policy_set_id = ise_network_access_policy_set.policy_set_1.id
89+
rule_id = ise_network_access_authentication_rule.auth_rule[each.value.name].id
90+
rank = each.value.rank
91+
}
92+
```

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ All resources and data sources have been tested with the following releases.
2424
The following guides with examples exist to demonstrate the use of the provider:
2525

2626
- [Getting Started](https://registry.terraform.io/providers/CiscoDevNet/ise/latest/docs/guides/getting_started)
27+
- [Authentication Rules](https://registry.terraform.io/providers/CiscoDevNet/ise/latest/docs/guides/authentication_rules)
2728

2829
## Example Usage
2930

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "ise_device_admin_authentication_rule_update_rank Resource - terraform-provider-ise"
4+
subcategory: "Device Administration"
5+
description: |-
6+
This resource is used to update rank field in device admin authentication rule. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and device_admin_authentication_rule resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
7+
---
8+
9+
# ise_device_admin_authentication_rule_update_rank (Resource)
10+
11+
This resource is used to update rank field in device admin authentication rule. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and device_admin_authentication_rule resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "ise_device_admin_authentication_rule_update_rank" "example" {
17+
rule_id = "9b3680da-0165-44f6-9cff-88e778d98020"
18+
policy_set_id = "d82952cb-b901-4b09-b363-5ebf39bdbaf9"
19+
rank = 0
20+
}
21+
```
22+
23+
<!-- schema generated by tfplugindocs -->
24+
## Schema
25+
26+
### Required
27+
28+
- `policy_set_id` (String) Policy set ID
29+
- `rank` (Number) The rank (priority) in relation to other rules. Lower rank is higher priority.
30+
- `rule_id` (String) Authentication rule ID
31+
32+
### Read-Only
33+
34+
- `id` (String) The id of the object
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "ise_device_admin_authorization_exception_rule_update_rank Resource - terraform-provider-ise"
4+
subcategory: "Device Administration"
5+
description: |-
6+
This resource is used to update rank field in device admin Authorization exception rule. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and device_admin_authorization_exception_rule resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
7+
---
8+
9+
# ise_device_admin_authorization_exception_rule_update_rank (Resource)
10+
11+
This resource is used to update rank field in device admin Authorization exception rule. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and device_admin_authorization_exception_rule resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "ise_device_admin_authorization_exception_rule_update_rank" "example" {
17+
rule_id = "9b3680da-0165-44f6-9cff-88e778d98020"
18+
policy_set_id = "d82952cb-b901-4b09-b363-5ebf39bdbaf9"
19+
rank = 0
20+
}
21+
```
22+
23+
<!-- schema generated by tfplugindocs -->
24+
## Schema
25+
26+
### Required
27+
28+
- `policy_set_id` (String) Policy set ID
29+
- `rank` (Number) The rank (priority) in relation to other rules. Lower rank is higher priority.
30+
- `rule_id` (String) Authorization exception rule ID
31+
32+
### Read-Only
33+
34+
- `id` (String) The id of the object
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "ise_device_admin_authorization_global_exception_rule_update_rank Resource - terraform-provider-ise"
4+
subcategory: "Device Administration"
5+
description: |-
6+
This resource is used to update rank field in device admin authorization global exception rule. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and device_admin_authorization_global_exception_rule resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
7+
---
8+
9+
# ise_device_admin_authorization_global_exception_rule_update_rank (Resource)
10+
11+
This resource is used to update rank field in device admin authorization global exception rule. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and device_admin_authorization_global_exception_rule resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "ise_device_admin_authorization_global_exception_rule_update_rank" "example" {
17+
rule_id = "d82952cb-b901-4b09-b363-5ebf39bdbaf9"
18+
rank = 0
19+
}
20+
```
21+
22+
<!-- schema generated by tfplugindocs -->
23+
## Schema
24+
25+
### Required
26+
27+
- `rank` (Number) The rank (priority) in relation to other rules. Lower rank is higher priority.
28+
- `rule_id` (String) Authorization global exception rule ID
29+
30+
### Read-Only
31+
32+
- `id` (String) The id of the object
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "ise_device_admin_authorization_rule_update_rank Resource - terraform-provider-ise"
4+
subcategory: "Device Administration"
5+
description: |-
6+
This resource is used to update rank field in device admin authorization rule. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and device_admin_authorization_rule resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
7+
---
8+
9+
# ise_device_admin_authorization_rule_update_rank (Resource)
10+
11+
This resource is used to update rank field in device admin authorization rule. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and device_admin_authorization_rule resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "ise_device_admin_authorization_rule_update_rank" "example" {
17+
rule_id = "9b3680da-0165-44f6-9cff-88e778d98020"
18+
policy_set_id = "d82952cb-b901-4b09-b363-5ebf39bdbaf9"
19+
rank = 0
20+
}
21+
```
22+
23+
<!-- schema generated by tfplugindocs -->
24+
## Schema
25+
26+
### Required
27+
28+
- `policy_set_id` (String) Policy set ID
29+
- `rank` (Number) The rank (priority) in relation to other rules. Lower rank is higher priority.
30+
- `rule_id` (String) Authorization rule ID
31+
32+
### Read-Only
33+
34+
- `id` (String) The id of the object
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "ise_device_admin_policy_set_update_rank Resource - terraform-provider-ise"
4+
subcategory: "Device Administration"
5+
description: |-
6+
This resource is used to update rank field in device admin policy set. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and device_admin_policy_set resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
7+
---
8+
9+
# ise_device_admin_policy_set_update_rank (Resource)
10+
11+
This resource is used to update rank field in device admin policy set. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and device_admin_policy_set resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "ise_device_admin_policy_set_update_rank" "example" {
17+
policy_set_id = "d82952cb-b901-4b09-b363-5ebf39bdbaf9"
18+
rank = 0
19+
}
20+
```
21+
22+
<!-- schema generated by tfplugindocs -->
23+
## Schema
24+
25+
### Required
26+
27+
- `policy_set_id` (String) Policy set ID
28+
- `rank` (Number) The rank (priority) in relation to other rules. Lower rank is higher priority.
29+
30+
### Read-Only
31+
32+
- `id` (String) The id of the object

docs/resources/network_access_authentication_rule_update_rank.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This resource is used to update rank field in network access authentication rule
1414

1515
```terraform
1616
resource "ise_network_access_authentication_rule_update_rank" "example" {
17-
auth_rule_id = "9b3680da-0165-44f6-9cff-88e778d98020"
17+
rule_id = "9b3680da-0165-44f6-9cff-88e778d98020"
1818
policy_set_id = "d82952cb-b901-4b09-b363-5ebf39bdbaf9"
1919
rank = 0
2020
}
@@ -25,9 +25,9 @@ resource "ise_network_access_authentication_rule_update_rank" "example" {
2525

2626
### Required
2727

28-
- `auth_rule_id` (String) Authentication rule ID
2928
- `policy_set_id` (String) Policy set ID
3029
- `rank` (Number) The rank (priority) in relation to other rules. Lower rank is higher priority.
30+
- `rule_id` (String) Authentication rule ID
3131

3232
### Read-Only
3333

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "ise_network_access_authorization_exception_rule_update_rank Resource - terraform-provider-ise"
4+
subcategory: "Network Access"
5+
description: |-
6+
This resource is used to update rank field in network access authorization exception rule. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and network_access_authorization_exception_rule resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
7+
---
8+
9+
# ise_network_access_authorization_exception_rule_update_rank (Resource)
10+
11+
This resource is used to update rank field in network access authorization exception rule. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and network_access_authorization_exception_rule resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "ise_network_access_authorization_exception_rule_update_rank" "example" {
17+
rule_id = "9b3680da-0165-44f6-9cff-88e778d98020"
18+
policy_set_id = "d82952cb-b901-4b09-b363-5ebf39bdbaf9"
19+
rank = 0
20+
}
21+
```
22+
23+
<!-- schema generated by tfplugindocs -->
24+
## Schema
25+
26+
### Required
27+
28+
- `policy_set_id` (String) Policy set ID
29+
- `rank` (Number) The rank (priority) in relation to other rules. Lower rank is higher priority.
30+
- `rule_id` (String) Authorization exception rule ID
31+
32+
### Read-Only
33+
34+
- `id` (String) The id of the object
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "ise_network_access_authorization_global_exception_rule_update_rank Resource - terraform-provider-ise"
4+
subcategory: "Network Access"
5+
description: |-
6+
This resource is used to update rank field in network access authorization global exception rule. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and network_access_authorization_global_exception_rule resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
7+
---
8+
9+
# ise_network_access_authorization_global_exception_rule_update_rank (Resource)
10+
11+
This resource is used to update rank field in network access authorization global exception rule. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and network_access_authorization_global_exception_rule resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "ise_network_access_authorization_global_exception_rule_update_rank" "example" {
17+
rule_id = "d82952cb-b901-4b09-b363-5ebf39bdbaf9"
18+
rank = 0
19+
}
20+
```
21+
22+
<!-- schema generated by tfplugindocs -->
23+
## Schema
24+
25+
### Required
26+
27+
- `rank` (Number) The rank (priority) in relation to other rules. Lower rank is higher priority.
28+
- `rule_id` (String) Authorization global exception rule ID
29+
30+
### Read-Only
31+
32+
- `id` (String) The id of the object

0 commit comments

Comments
 (0)