Skip to content

Commit

Permalink
Refactor device acl policy definition resource and data source
Browse files Browse the repository at this point in the history
  • Loading branch information
danischm committed Jul 24, 2023
1 parent 1b44b17 commit 7320cf6
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 148 deletions.
9 changes: 4 additions & 5 deletions docs/data-sources/device_acl_policy_definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "sdwan_device_acl_policy_definition Data Source - terraform-provider-sdwan"
subcategory: "Localized Policies"
description: |-
This data source can read the Device ACL policy definition.
This data source can read the Device ACL Policy Definition .
---

# sdwan_device_acl_policy_definition (Data Source)

This data source can read the Device ACL policy definition.
This data source can read the Device ACL Policy Definition .

## Example Usage

Expand All @@ -23,16 +23,15 @@ data "sdwan_device_acl_policy_definition" "example" {

### Required

- `id` (String) The id of the policy definition
- `id` (String) The id of the object

### Read-Only

- `default_action` (String) Default action, either `accept` or `drop`
- `description` (String) The description of the policy definition
- `name` (String) The name of the policy definition
- `sequences` (Attributes List) List of ACL sequences (see [below for nested schema](#nestedatt--sequences))
- `type` (String) The policy definition type
- `version` (Number) The version of the policy definition
- `version` (Number) The version of the object

<a id="nestedatt--sequences"></a>
### Nested Schema for `sequences`
Expand Down
13 changes: 6 additions & 7 deletions docs/resources/device_acl_policy_definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "sdwan_device_acl_policy_definition Resource - terraform-provider-sdwan"
subcategory: "Localized Policies"
description: |-
This resource can manage a Device ACL policy definition.
This resource can manage a Device ACL Policy Definition .
---

# sdwan_device_acl_policy_definition (Resource)

This resource can manage a Device ACL policy definition.
This resource can manage a Device ACL Policy Definition .

## Example Usage

Expand Down Expand Up @@ -56,9 +56,8 @@ resource "sdwan_device_acl_policy_definition" "example" {

### Read-Only

- `id` (String) The id of the policy definition
- `type` (String) The policy defintion type
- `version` (Number) The version of the policy definition
- `id` (String) The id of the object
- `version` (Number) The version of the object

<a id="nestedatt--sequences"></a>
### Nested Schema for `sequences`
Expand All @@ -67,6 +66,7 @@ Required:

- `id` (Number) Sequence ID
- Range: `1`-`65534`
- `name` (String) Sequence name

Optional:

Expand All @@ -76,7 +76,6 @@ Optional:
- `ip_type` (String) IP version, either `ipv4` or `ipv6`
- Choices: `ipv4`, `ipv6`
- `match_entries` (Attributes List) List of match entries (see [below for nested schema](#nestedatt--sequences--match_entries))
- `name` (String) Sequence name

<a id="nestedatt--sequences--action_entries"></a>
### Nested Schema for `sequences.action_entries`
Expand Down Expand Up @@ -104,7 +103,7 @@ Optional:
- `destination_data_prefix_list_id` (String) Destination data prefix list ID
- `destination_data_prefix_list_version` (Number) Destination data prefix list version
- `destination_ip` (String) Destination IP prefix
- `destination_port` (Number) Destination port
- `destination_port` (Number) Destination port, only `22` and `161` supported
- Range: `0`-`65535`
- `source_data_prefix_list_id` (String) Source data prefix list ID
- `source_data_prefix_list_version` (Number) Source data prefix list version
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
---
name: Device ACL
type: deviceAccessPolicy
name: Device ACL Policy Definition
rest_endpoint: /template/policy/definition/deviceaccesspolicy/
has_version: true
id_attribute: definitionId
doc_category: Localized Policies
skip_templates: [model.go, resource.go]
attributes:
- model_name: type
value: deviceAccessPolicy
- model_name: name
tf_name: name
type: String
mandatory: true
description: The name of the policy definition
example: Example
- model_name: description
tf_name: description
type: String
mandatory: true
description: The description of the policy definition
example: My description
- model_name: type
tf_name: default_action
data_path: [defaultAction]
Expand All @@ -19,6 +34,7 @@ attributes:
- model_name: sequenceId
tf_name: id
type: Int64
id: true
mandatory: true
description: Sequence ID
min_int: 1
Expand All @@ -33,6 +49,8 @@ attributes:
- model_name: sequenceName
tf_name: name
type: String
id: true
mandatory: true
description: Sequence name
example: Sequence 10
- model_name: sequenceType
Expand All @@ -52,6 +70,7 @@ attributes:
- model_name: field
tf_name: type
type: String
id: true
mandatory: true
enum_values:
[
Expand All @@ -66,18 +85,27 @@ attributes:
example: destinationPort
- model_name: value
tf_name: source_ip
conditional_attribute:
name: type
value: sourceIp
type: String
description: Source IP prefix
exclude_test: true
example: 10.0.0.0/8
- model_name: value
tf_name: destination_ip
conditional_attribute:
name: type
value: destinationIp
type: String
description: Destination IP prefix
exclude_test: true
example: 192.168.0.0/16
- model_name: value
tf_name: source_port
conditional_attribute:
name: type
value: sourcePort
type: Int64
model_type_string: true
description: Source port
Expand All @@ -87,6 +115,9 @@ attributes:
example: 8000
- model_name: value
tf_name: destination_port
conditional_attribute:
name: type
value: destinationPort
type: Int64
model_type_string: true
description: Destination port, only `22` and `161` supported
Expand All @@ -95,24 +126,30 @@ attributes:
example: 22
- model_name: ref
tf_name: source_data_prefix_list_id
conditional_attribute:
name: type
value: sourceDataPrefixList
type: String
description: Source data prefix list ID
exclude_test: true
example: 2081c2f4-3f9f-4fee-8078-dcc8904e368d
- tf_name: source_data_prefix_list_version
tf_only: true
type: Int64
type: Version
description: Source data prefix list version
exclude_test: true
- model_name: ref
tf_name: destination_data_prefix_list_id
conditional_attribute:
name: type
value: destinationDataPrefixList
type: String
description: Destination data prefix list ID
exclude_test: true
example: 2081c2f4-3f9f-4fee-8078-dcc8904e368d
- tf_name: destination_data_prefix_list_version
tf_only: true
type: Int64
type: Version
description: Destination data prefix list version
exclude_test: true
- model_name: actions
Expand All @@ -123,12 +160,16 @@ attributes:
- model_name: type
tf_name: type
type: String
id: true
mandatory: true
enum_values: [count]
description: Type of action entry
example: count
- model_name: parameter
tf_name: counter_name
conditional_attribute:
name: type
value: count
type: String
description: Counter name
example: count1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7320cf6

Please sign in to comment.